Nameless Engine
Loading...
Searching...
No Matches
MessageBox.h
1#pragma once
2
3// Standard.
4#include <string>
5
6#if defined(WIN32)
7#pragma push_macro("MessageBox")
8#undef MessageBox
9#pragma push_macro("IGNORE")
10#undef IGNORE
11#endif
12
13namespace ne {
15 enum class MessageBoxResult { OK, CANCEL, YES, NO, ABORT, RETRY, IGNORE };
16
18 enum class MessageBoxChoice { OK, OK_CANCEL, YES_NO, YES_NO_CANCEL, RETRY_CANCEL, ABORT_RETRY_IGNORE };
19
21 class MessageBox {
22 public:
34 static MessageBoxResult info(
35 const std::string& sTitle,
36 const std::string& sText,
37 MessageBoxChoice buttons = MessageBoxChoice::OK);
38
50 static MessageBoxResult question(
51 const std::string& sTitle,
52 const std::string& sText,
53 MessageBoxChoice buttons = MessageBoxChoice::OK);
54
66 static MessageBoxResult warning(
67 const std::string& sTitle,
68 const std::string& sText,
69 MessageBoxChoice buttons = MessageBoxChoice::OK);
70
82 static MessageBoxResult error(
83 const std::string& sTitle,
84 const std::string& sText,
85 MessageBoxChoice buttons = MessageBoxChoice::OK);
86 };
87} // namespace ne
88
89#if defined(WIN32)
90#pragma pop_macro("IGNORE")
91#pragma pop_macro("MessageBox")
92#endif
Definition: MessageBox.h:21
static MessageBoxResult warning(const std::string &sTitle, const std::string &sText, MessageBoxChoice buttons=MessageBoxChoice::OK)
Definition: MessageBox.cpp:65
static MessageBoxResult question(const std::string &sTitle, const std::string &sText, MessageBoxChoice buttons=MessageBoxChoice::OK)
Definition: MessageBox.cpp:59
static MessageBoxResult error(const std::string &sTitle, const std::string &sText, MessageBoxChoice buttons=MessageBoxChoice::OK)
Definition: MessageBox.cpp:71
static MessageBoxResult info(const std::string &sTitle, const std::string &sText, MessageBoxChoice buttons=MessageBoxChoice::OK)
Definition: MessageBox.cpp:54