From 6b6267d320a02bfa4baef63916824ed4f5caf9ab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Sep 2000 11:27:21 +0000 Subject: [PATCH] use the native msg box if available, fall back to wxWin one instead of doing the opposite git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/log.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index 837956d26a..e7669a12e9 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -750,20 +750,9 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg) // developpers only wxStrcat(szBuf, wxT("\nDo you want to stop the program?\nYou can also choose [Cancel] to suppress further warnings.")); -#if wxUSE_GUI - switch ( wxMessageBox(szBuf, wxT("Debug"), - wxYES_NO | wxCANCEL | wxICON_STOP ) ) { - case wxYES: - Trap(); - break; - - case wxCANCEL: - s_bNoAsserts = TRUE; - break; - - //case wxNO: nothing to do - } -#else // !GUI, but MSW + // use the native message box if available: this is more robust than + // using our own +#ifdef __WXMSW__ switch ( ::MessageBox(NULL, szBuf, _T("Debug"), MB_YESNOCANCEL | MB_ICONSTOP ) ) { case IDYES: @@ -776,6 +765,19 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg) //case IDNO: nothing to do } +#else // !MSW + switch ( wxMessageBox(szBuf, wxT("Debug"), + wxYES_NO | wxCANCEL | wxICON_STOP ) ) { + case wxYES: + Trap(); + break; + + case wxCANCEL: + s_bNoAsserts = TRUE; + break; + + //case wxNO: nothing to do + } #endif // GUI or MSW #else // !GUI