6 #ifndef UTILS_DIALOGS_H 7 #define UTILS_DIALOGS_H 16 #include <Utils/ExtSTD.h> 24 inline void Error(
const std::string &msg,
const std::string &title =
"Error")
29 MessageBox(0, msgW.c_str(), titleW.c_str(), MB_OK | MB_ICONERROR | MB_TASKMODAL);
31 std::cout <<
"Title:" << title << std::endl;
32 std::cout <<
"Message:" << msg << std::endl;
34 #error "platform not supported" 39 inline void Warning(
const std::string &msg,
const std::string &title =
"Warning")
44 MessageBox(0, msgW.c_str(), titleW.c_str(), MB_OK | MB_ICONWARNING | MB_TASKMODAL);
46 std::cout <<
"Title:" << title << std::endl;
47 std::cout <<
"Message:" << msg << std::endl;
49 #error "platform not supported" 54 inline void Info(
const std::string &msg,
const std::string &title =
"Information")
59 MessageBox(0, msgW.c_str(), titleW.c_str(), MB_OK | MB_ICONINFORMATION | MB_TASKMODAL);
61 std::cout <<
"Title:" << title << std::endl;
62 std::cout <<
"Message:" << msg << std::endl;
64 #error "platform not supported" 69 inline bool Confirmation(
const std::string &question,
const std::string &title =
"Confirmation")
74 const int result = MessageBox(0, questionW.c_str(), titleW.c_str(), MB_YESNO | MB_TASKMODAL);
75 return result == IDYES;
77 std::cout <<
"implement me" << std::endl;
80 #error "platform not supported" bool Confirmation(const std::string &question, const std::string &title="Confirmation")
Show dialog with YES and NO buttons and returns answer. Program waits until user selects answer...
Definition: Dialogs.h:69
Dialog message boxes wrapper functions.
Definition: Dialogs.h:20
void Error(const std::string &msg, const std::string &title="Error")
Shows error dialog and displays message. Program waits until user confirms.
Definition: Dialogs.h:24
std::wstring ToWString(const std::string &text)
Convert single-byte std::string to std::wstring.
Definition: ExtSTD.h:68
void Info(const std::string &msg, const std::string &title="Information")
Show information dialog with specified message. Program waits until user confirms.
Definition: Dialogs.h:54
void Warning(const std::string &msg, const std::string &title="Warning")
Show warning dialog and displays message. Program waits until user confirms.
Definition: Dialogs.h:39