]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
Committing in .
[wxWidgets.git] / src / common / appbase.cpp
index 2091e12a70196af8179ec2d5290fa1fe13aa90ac..d479bef6e1dbd0efef91195c7815efba152c4e92 100644 (file)
@@ -46,7 +46,7 @@
 #endif  //Win/Unix
 
 #if defined(__WXMSW__)
-  #include  "wx/msw/private.h"  // includes windows.h for MessageBox()
+  #include  "wx/msw/wrapwin.h"  // includes windows.h for MessageBox()
 #endif
 
 #if wxUSE_FONTMAP
@@ -109,6 +109,13 @@ wxAppConsole::wxAppConsole()
 
 #ifdef __WXDEBUG__
     SetTraceMasks();
+#if wxUSE_UNICODE
+    // In unicode mode the SetTraceMasks call can cause an apptraits to be
+    // created, but since we are still in the constructor the wrong kind will
+    // be created for GUI apps.  Destroy it so it can be created again later.
+    delete m_traits;
+    m_traits = NULL;
+#endif
 #endif
 }
 
@@ -277,6 +284,34 @@ int wxAppConsole::FilterEvent(wxEvent& WXUNUSED(event))
     return -1;
 }
 
+// ----------------------------------------------------------------------------
+// exception handling
+// ----------------------------------------------------------------------------
+
+#if wxUSE_EXCEPTIONS
+
+void
+wxAppConsole::HandleEvent(wxEvtHandler *handler,
+                          wxEventFunction func,
+                          wxEvent& event) const
+{
+    // by default, simply call the handler
+    (handler->*func)(event);
+}
+
+bool
+wxAppConsole::OnExceptionInMainLoop()
+{
+    throw;
+
+    // some compilers are too stupid to know that we never return after throw
+#if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200)
+    return false;
+#endif
+}
+
+#endif // wxUSE_EXCEPTIONS
+
 // ----------------------------------------------------------------------------
 // cmd line parsing
 // ----------------------------------------------------------------------------
@@ -371,10 +406,10 @@ bool wxAppConsole::CheckBuildOptions(const char *optionsSignature,
         wxString prog = wxString::FromAscii(optionsSignature);
         wxString progName = wxString::FromAscii(componentName);
         wxString msg;
-        
-        msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s, and %s used %s."),
+
+        msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
                    lib.c_str(), progName.c_str(), prog.c_str());
-        
+
         wxLogFatalError(msg);
 
         // normally wxLogFatalError doesn't return
@@ -392,7 +427,7 @@ void wxAppConsole::OnAssert(const wxChar *file,
                             const wxChar *cond,
                             const wxChar *msg)
 {
-    ShowAssertDialog(file, line, cond, msg, m_traits);
+    ShowAssertDialog(file, line, cond, msg, GetTraits());
 }
 
 #endif // __WXDEBUG__
@@ -457,6 +492,13 @@ void wxConsoleAppTraitsBase::RemoveFromPendingDelete(wxObject * WXUNUSED(object)
     // nothing to do
 }
 
+#if wxUSE_SOCKETS
+GSocketGUIFunctionsTable* wxConsoleAppTraitsBase::GetSocketGUIFunctionsTable()
+{
+    return NULL;
+}
+#endif
+
 // ----------------------------------------------------------------------------
 // wxAppTraits
 // ----------------------------------------------------------------------------
@@ -526,7 +568,7 @@ void wxAssert(int cond,
               const wxChar *szFile,
               int nLine,
               const wxChar *szCond,
-              const wxChar *szMsg) 
+              const wxChar *szMsg)
 {
     if ( !cond )
         wxOnAssert(szFile, nLine, szCond, szMsg);