]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appcmn.cpp
added support for POST method and alternate ports (part of patch 649438)
[wxWidgets.git] / src / common / appcmn.cpp
index 78ede412b947a79f9c5afb3f69bb577e3085e26c..9424db3196fa936343481ae128b43451e64a3318 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/bitmap.h"
     #include "wx/intl.h"
     #include "wx/list.h"
     #include "wx/log.h"
     #include "wx/msgdlg.h"
     #include "wx/intl.h"
     #include "wx/list.h"
     #include "wx/log.h"
     #include "wx/msgdlg.h"
+    #include "wx/bitmap.h"
+    #include "wx/confbase.h"
 #endif
 
 #include "wx/apptrait.h"
 #endif
 
 #include "wx/apptrait.h"
@@ -164,7 +167,7 @@ void wxAppBase::Exit()
 
 wxAppTraits *wxAppBase::CreateTraits()
 {
 
 wxAppTraits *wxAppBase::CreateTraits()
 {
-    return wxAppTraits::CreateGUI();
+    return new wxGUIAppTraits;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -202,6 +205,72 @@ void wxAppBase::DeletePendingObjects()
     }
 }
 
     }
 }
 
+// Returns TRUE if more time is needed.
+bool wxAppBase::ProcessIdle()
+{
+    wxWindowList::Node* node = wxTopLevelWindows.GetFirst();
+    node = wxTopLevelWindows.GetFirst();
+    while (node)
+    {
+        wxWindow* win = node->GetData();
+        win->ProcessInternalIdle();
+        node = node->GetNext();
+    }
+
+    wxIdleEvent event;
+    event.SetEventObject(this);
+    bool processed = ProcessEvent(event);
+
+    wxUpdateUIEvent::ResetUpdateTime();
+    
+    return processed && event.MoreRequested();
+}
+
+// Send idle event to all top-level windows
+bool wxAppBase::SendIdleEvents()
+{
+    bool needMore = FALSE;
+
+    wxWindowList::Node* node = wxTopLevelWindows.GetFirst();
+    while (node)
+    {
+        wxWindow* win = node->GetData();
+        if (SendIdleEvents(win))
+            needMore = TRUE;
+        node = node->GetNext();
+    }
+
+    return needMore;
+}
+
+// Send idle event to window and all subwindows
+bool wxAppBase::SendIdleEvents(wxWindow* win)
+{
+    bool needMore = FALSE;
+    
+    if (wxIdleEvent::CanSend(win))
+    {
+        wxIdleEvent event;
+        event.SetEventObject(win);
+        win->GetEventHandler()->ProcessEvent(event);
+
+        needMore = event.MoreRequested();
+    }
+
+    wxWindowList::Node *node = win->GetChildren().GetFirst();
+    while ( node )
+    {
+        wxWindow *win = node->GetData();
+        if (SendIdleEvents(win))
+            needMore = TRUE;
+
+        node = node->GetNext();
+    }
+
+    return needMore;
+}
+
+
 // ----------------------------------------------------------------------------
 // wxGUIAppTraitsBase
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxGUIAppTraitsBase
 // ----------------------------------------------------------------------------
@@ -302,12 +371,3 @@ void wxGUIAppTraitsBase::RemoveFromPendingDelete(wxObject *object)
     wxPendingDelete.DeleteObject(object);
 }
 
     wxPendingDelete.DeleteObject(object);
 }
 
-// ----------------------------------------------------------------------------
-// wxAppTraits
-// ----------------------------------------------------------------------------
-
-wxAppTraits *wxAppTraitsBase::CreateGUI()
-{
-    return new wxGUIAppTraits;
-}
-