]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
removing duplicated method, wiring native maxlength support, see #10269
[wxWidgets.git] / src / common / appbase.cpp
index 34dbcf00895d548fba98903aa2485eeac7b08381..544f727b9e22a8fafba57817f07a0931782638b9 100644 (file)
     #include <typeinfo>
 #endif
 
-#ifndef __WXPALMOS5__
 #if !defined(__WXMSW__) || defined(__WXMICROWIN__)
   #include  <signal.h>      // for SIGTRAP used by wxTrap()
 #endif  //Win/Unix
 
 #include <locale.h>
-#endif // ! __WXPALMOS5__
 
 #if wxUSE_FONTMAP
     #include "wx/fontmap.h"
@@ -150,10 +148,14 @@ wxAppConsoleBase::wxAppConsoleBase()
     wxDELETE(m_traits);
 #endif
 #endif
+
+    wxEvtHandler::AddFilter(this);
 }
 
 wxAppConsoleBase::~wxAppConsoleBase()
 {
+    wxEvtHandler::RemoveFilter(this);
+
     // we're being destroyed and using this object from now on may not work or
     // even crash so don't leave dangling pointers to it
     ms_appInstance = NULL;
@@ -177,7 +179,6 @@ bool wxAppConsoleBase::Initialize(int& WXUNUSED(argc), wxChar **WXUNUSED(argv))
 wxString wxAppConsoleBase::GetAppName() const
 {
     wxString name = m_appName;
-#ifndef __WXPALMOS__
     if ( name.empty() )
     {
         if ( argv )
@@ -186,7 +187,6 @@ wxString wxAppConsoleBase::GetAppName() const
             wxFileName::SplitPath(argv[0], NULL, &name, NULL);
         }
     }
-#endif // !__WXPALMOS__
     return name;
 }
 
@@ -345,8 +345,11 @@ bool wxAppConsoleBase::Dispatch()
 bool wxAppConsoleBase::Yield(bool onlyIfNeeded)
 {
     wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+    if ( loop )
+       return loop->Yield(onlyIfNeeded);
 
-    return loop && loop->Yield(onlyIfNeeded);
+    wxScopedPtr<wxEventLoopBase> tmpLoop(CreateMainLoop());
+    return tmpLoop->Yield(onlyIfNeeded);
 }
 
 void wxAppConsoleBase::WakeUpIdle()
@@ -398,7 +401,7 @@ bool wxAppConsoleBase::IsMainLoopRunning()
 int wxAppConsoleBase::FilterEvent(wxEvent& WXUNUSED(event))
 {
     // process the events normally by default
-    return -1;
+    return Event_Skip;
 }
 
 void wxAppConsoleBase::DelayPendingEventHandler(wxEvtHandler* toDelay)
@@ -999,6 +1002,15 @@ bool wxAssertIsEqual(int x, int y)
     return x == y;
 }
 
+void wxAbort()
+{
+#ifdef __WXWINCE__
+    ExitThread(3);
+#else
+    abort();
+#endif
+}
+
 #if wxDEBUG_LEVEL
 
 // break into the debugger
@@ -1025,7 +1037,7 @@ wxDefaultAssertHandler(const wxString& file,
 {
     // If this option is set, we should abort immediately when assert happens.
     if ( wxSystemOptions::GetOptionInt("exit-on-assert") )
-        abort();
+        wxAbort();
 
     // FIXME MT-unsafe
     static int s_bInAssert = 0;