From ba88028c9e6f7a2da0b9bc31e86ca9633613745e Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 16 Apr 2005 01:03:31 +0000 Subject: Changed message boxes to take a title string --- src/common.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/common.cpp') 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; } -- cgit v1.2.3