-
- // Send OnIdle events to all windows
- if ( SendIdleEvents() )
- {
- // SendIdleEvents() returns TRUE if at least one window requested more
- // idle events
- event.RequestMore(TRUE);
- }
-
- wxIsInOnIdleFlag = FALSE;
-}
-
-// Send idle event to all top-level windows
-bool wxApp::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 wxApp::SendIdleEvents(wxWindow* win)
-{
- wxIdleEvent event;
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
-
- bool 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;