+bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg)
+{
+ // 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
+ return wxAppTraitsBase::ShowAssertDialog(msg);
+#else // wxUSE_MSGDLG
+#if wxDEBUG_LEVEL
+ wxString msgDlg = msg;
+
+#if wxUSE_STACKWALKER
+ // on Unix stack frame generation may take some time, depending on the
+ // size of the executable mainly... warn the user that we are working
+ wxFprintf(stderr, wxT("[Debug] Generating a stack trace... please wait"));
+ fflush(stderr);
+
+ 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"),
+ wxYES_NO | wxCANCEL | wxICON_STOP ) )
+ {
+ case wxYES:
+ wxTrap();
+ break;