]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
Restore fixes needed for wxRenderer functions to work with wxGCDC.
[wxWidgets.git] / src / common / appbase.cpp
index a02e091ff1575b84454f4997b9b9dff2f473cd7a..740deebb2b4b221369d1e0e38b48c13061ae7fd6 100644 (file)
@@ -243,7 +243,7 @@ int wxAppConsoleBase::OnExit()
 #if wxUSE_CONFIG
     // delete the config object if any (don't use Get() here, but Set()
     // because Get() could create a new config object)
-    delete wxConfigBase::Set((wxConfigBase *) NULL);
+    delete wxConfigBase::Set(NULL);
 #endif // wxUSE_CONFIG
 
     return 0;
@@ -385,6 +385,9 @@ void wxAppConsoleBase::WakeUpIdle()
 
 bool wxAppConsoleBase::ProcessIdle()
 {
+    // process pending wx events before sending idle events
+    ProcessPendingEvents();
+
     wxIdleEvent event;
 
     event.SetEventObject(this);
@@ -413,6 +416,20 @@ wxAppConsoleBase::HandleEvent(wxEvtHandler *handler,
     (handler->*func)(event);
 }
 
+void wxAppConsoleBase::CallEventHandler(wxEvtHandler *handler,
+                                        wxEventFunctor& functor,
+                                        wxEvent& event) const
+{
+    // If the functor holds a method then, for backward compatibility, call
+    // HandleEvent():
+    wxEventFunction eventFunction = functor.GetMethod();
+
+    if ( eventFunction )
+        HandleEvent(handler, eventFunction, event);
+    else
+        functor(handler, event);
+}
+
 void wxAppConsoleBase::OnUnhandledException()
 {
 #ifdef __WXDEBUG__