summaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-04-16 01:03:31 +0000
committerIan C <ianc@noddybox.co.uk>2005-04-16 01:03:31 +0000
commitba88028c9e6f7a2da0b9bc31e86ca9633613745e (patch)
treea5c45537df2930eb31a8991d2727e27d2c3f86aa /src/common.cpp
parent339682700982983738dd6cdffc387393bb2bd5bb (diff)
Changed message boxes to take a title string
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp26
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;
}