- //case IDNO: nothing to do
- }
-#else // !MSW
- switch ( wxMessageBox(szBuf, wxT("Debug"),
+bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg)
+{
+#if wxDEBUG_LEVEL
+ // under MSW we prefer to use the base class version using ::MessageBox()
+ // even if wxMessageBox() is available because it has less chances to
+ // double fault our app than our wxMessageBox()
+ //
+ // under DFB the message dialog is not always functional right now
+ //
+ // and finally we can't use wxMessageBox() if it wasn't compiled in, of
+ // course
+#if !defined(__WXMSW__) && !defined(__WXDFB__) && wxUSE_MSGDLG
+
+ // we can't (safely) show the GUI dialog from another thread, only do it
+ // for the asserts in the main thread
+ if ( wxIsMainThread() )
+ {
+ wxString msgDlg = msg;
+
+#if wxUSE_STACKWALKER
+ const wxString stackTrace = GetAssertStackTrace();
+ if ( !stackTrace.empty() )
+ msgDlg << wxT("\n\nCall stack:\n") << stackTrace;
+#endif // wxUSE_STACKWALKER
+
+ // this message is intentionally not translated -- it is for
+ // developpers only
+ msgDlg += wxT("\nDo you want to stop the program?\n")
+ wxT("You can also choose [Cancel] to suppress ")
+ wxT("further warnings.");
+
+ switch ( wxMessageBox(msgDlg, wxT("wxWidgets Debug Alert"),