added (and documented) wxSafeShowMessage, use it in wxLogFatalError instead of wxMessageBox

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-05-09 15:59:42 +00:00
parent 9cb47ea276
commit c11d62a6e2
3 changed files with 44 additions and 7 deletions

View File

@@ -159,17 +159,22 @@ IMPLEMENT_LOG_FUNCTION(Message)
IMPLEMENT_LOG_FUNCTION(Info)
IMPLEMENT_LOG_FUNCTION(Status)
void wxSafeShowMessage(const wxString& title, const wxString& text)
{
#ifdef __WINDOWS__
::MessageBox(NULL, text, title, MB_OK | MB_ICONSTOP);
#else
wxFprintf(stderr, _T("%s: %s\n"), title.c_str(), text.c_str());
#endif
}
// fatal errors can't be suppressed nor handled by the custom log target and
// always terminate the program
void wxVLogFatalError(const wxChar *szFormat, va_list argptr)
{
wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr);
#if wxUSE_GUI
wxMessageBox(s_szBuf, _("Fatal Error"), wxID_OK | wxICON_STOP);
#else
wxFprintf(stderr, _("Fatal error: %s\n"), s_szBuf);
#endif
wxSafeShowMessage(_T("Fatal Error"), s_szBuf);
abort();
}