]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
merged in the commit from the 2.2 branch
[wxWidgets.git] / src / common / log.cpp
index 837956d26ad3039c05c740b8efe98a706078a80c..e7669a12e9c1fbaec5432b50d7aebd200dc6ccee 100644 (file)
@@ -750,31 +750,33 @@ 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."));
 
         // 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:
+        // 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:
                 Trap();
                 break;
 
                 Trap();
                 break;
 
-            case wxCANCEL:
+            case IDCANCEL:
                 s_bNoAsserts = TRUE;
                 break;
 
                 s_bNoAsserts = TRUE;
                 break;
 
-            //case wxNO: nothing to do
+            //case IDNO: nothing to do
         }
         }
-#else // !GUI, but MSW
-        switch ( ::MessageBox(NULL, szBuf, _T("Debug"),
-                              MB_YESNOCANCEL | MB_ICONSTOP ) ) {
-            case IDYES:
+#else // !MSW
+        switch ( wxMessageBox(szBuf, wxT("Debug"),
+                              wxYES_NO | wxCANCEL | wxICON_STOP ) ) {
+            case wxYES:
                 Trap();
                 break;
 
                 Trap();
                 break;
 
-            case IDCANCEL:
+            case wxCANCEL:
                 s_bNoAsserts = TRUE;
                 break;
 
                 s_bNoAsserts = TRUE;
                 break;
 
-            //case IDNO: nothing to do
+            //case wxNO: nothing to do
         }
 #endif // GUI or MSW
 
         }
 #endif // GUI or MSW