diff options
Diffstat (limited to 'src/common.cpp')
-rw-r--r-- | src/common.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/common.cpp b/src/common.cpp index d0b94a6..9bc1b80 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -36,49 +36,51 @@ void Common::Initialise() // ------------------------------------------------------------ // -void Common::Message(HWND parent, const char *msg) +void Common::Message(HWND parent, const char *title, const char *msg) { - ::MessageBox(parent,msg,"Message",MB_ICONINFORMATION|MB_OK); + ::MessageBox(parent,msg,title ? title:"Message",MB_ICONINFORMATION|MB_OK); } // ------------------------------------------------------------ // -void Common::Message(HWND parent, const std::string& msg) +void Common::Message(HWND parent, const char *title, const std::string& msg) { - ::MessageBox(parent,msg.c_str(),"Message",MB_ICONINFORMATION|MB_OK); + ::MessageBox(parent,msg.c_str(),title ? title:"Message", + MB_ICONINFORMATION|MB_OK); } // ------------------------------------------------------------ // -void Common::Error(HWND parent, const char *msg) +void Common::Error(HWND parent, const char *title, const char *msg) { - ::MessageBox(parent,msg,"Error",MB_ICONSTOP|MB_OK); + ::MessageBox(parent,msg,title ? title:"Error",MB_ICONSTOP|MB_OK); } // ------------------------------------------------------------ // -void Common::Error(HWND parent, const std::string& msg) +void Common::Error(HWND parent, const char *title, const std::string& msg) { - ::MessageBox(parent,msg.c_str(),"Error",MB_ICONSTOP|MB_OK); + ::MessageBox(parent,msg.c_str(),title ? title:"Error",MB_ICONSTOP|MB_OK); } // ------------------------------------------------------------ // -bool Common::Query(HWND parent, const char *msg) +bool Common::Query(HWND parent, const char *title, const char *msg) { - return ::MessageBox(parent,msg,"Question",MB_ICONQUESTION|MB_YESNO)==IDOK; + return ::MessageBox(parent,msg,title ? title:"Question", + MB_ICONQUESTION|MB_YESNO)==IDOK; } // ------------------------------------------------------------ // -bool Common::Query(HWND parent, const std::string& msg) +bool Common::Query(HWND parent, const char *title, const std::string& msg) { - return ::MessageBox(parent,msg.c_str(),"Question", + return ::MessageBox(parent,msg.c_str(),title ? title:"Question", MB_ICONQUESTION|MB_YESNO)==IDOK; } |