git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21934
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
13 files changed:
// it should return TRUE if more idle events are needed, FALSE if not
virtual bool ProcessIdle() ;
// it should return TRUE if more idle events are needed, FALSE if not
virtual bool ProcessIdle() ;
// Send idle event to all top-level windows.
// Returns TRUE if more idle time is requested.
virtual bool SendIdleEvents();
// Send idle event to all top-level windows.
// Returns TRUE if more idle time is requested.
virtual bool SendIdleEvents();
// Send idle event to window and all subwindows
// Returns TRUE if more idle time is requested.
// Send idle event to window and all subwindows
// Returns TRUE if more idle time is requested.
- virtual bool SendIdleEvents(wxWindow* win);
+ virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
// top level window functions
// top level window functions
virtual void OnInternalIdle() {}
// call internal idle recursively
virtual void OnInternalIdle() {}
// call internal idle recursively
- void ProcessInternalIdle() ;
+// void ProcessInternalIdle() ;
// get the handle of the window for the underlying window system: this
// is only used for wxWin itself or for user code which wants to call
// get the handle of the window for the underlying window system: this
// is only used for wxWin itself or for user code which wants to call
// Returns TRUE if more time is needed.
bool wxAppBase::ProcessIdle()
{
// Returns TRUE if more time is needed.
bool wxAppBase::ProcessIdle()
{
+ wxIdleEvent event;
+ bool needMore = FALSE;
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
node = wxTopLevelWindows.GetFirst();
while (node)
{
wxWindow* win = node->GetData();
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
node = wxTopLevelWindows.GetFirst();
while (node)
{
wxWindow* win = node->GetData();
- win->ProcessInternalIdle();
+ if (SendIdleEvents(win, event))
+ needMore = TRUE;
node = node->GetNext();
}
node = node->GetNext();
}
event.SetEventObject(this);
event.SetEventObject(this);
- bool processed = ProcessEvent(event);
+ (void) ProcessEvent(event);
+ if (event.MoreRequested())
+ needMore = TRUE;
wxUpdateUIEvent::ResetUpdateTime();
wxUpdateUIEvent::ResetUpdateTime();
- return processed && event.MoreRequested();
// Send idle event to all top-level windows
bool wxAppBase::SendIdleEvents()
{
// Send idle event to all top-level windows
bool wxAppBase::SendIdleEvents()
{
// Send idle event to window and all subwindows
// Send idle event to window and all subwindows
-bool wxAppBase::SendIdleEvents(wxWindow* win)
+bool wxAppBase::SendIdleEvents(wxWindow* win, wxIdleEvent& event)
if (wxIdleEvent::CanSend(win))
{
if (wxIdleEvent::CanSend(win))
{
event.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event);
event.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event);
- needMore = event.MoreRequested();
+ if (event.MoreRequested())
+ needMore = TRUE;
}
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while ( node )
{
wxWindow *win = node->GetData();
}
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while ( node )
{
wxWindow *win = node->GetData();
- if (SendIdleEvents(win))
+ if (SendIdleEvents(win, event))
needMore = TRUE;
node = node->GetNext();
needMore = TRUE;
node = node->GetNext();
// call internal idle recursively
// call internal idle recursively
+// may be obsolete (wait until OnIdle scheme stabilises)
void wxWindowBase::ProcessInternalIdle()
{
OnInternalIdle();
void wxWindowBase::ProcessInternalIdle()
{
OnInternalIdle();
node = node->GetNext();
}
}
node = node->GetNext();
}
}
// ----------------------------------------------------------------------------
// dialog units translations
// ----------------------------------------------------------------------------
// dialog units translations
// 'Garbage' collection of windows deleted with Close()
DeletePendingObjects();
// 'Garbage' collection of windows deleted with Close()
DeletePendingObjects();
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// 'Garbage' collection of windows deleted with Close()
DeletePendingObjects();
// 'Garbage' collection of windows deleted with Close()
DeletePendingObjects();
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
if ( s_inOnIdle )
return;
if ( s_inOnIdle )
return;
s_inOnIdle = TRUE;
// 'Garbage' collection of windows deleted with Close().
s_inOnIdle = TRUE;
// 'Garbage' collection of windows deleted with Close().
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// If they are pending events, we must process them: pending events are
// either events to the threads other than main or events posted with
// If they are pending events, we must process them: pending events are
// either events to the threads other than main or events posted with
if ( s_inOnIdle )
return;
if ( s_inOnIdle )
return;
s_inOnIdle = TRUE;
// 'Garbage' collection of windows deleted with Close().
s_inOnIdle = TRUE;
// 'Garbage' collection of windows deleted with Close().
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// If they are pending events, we must process them: pending events are
// either events to the threads other than main or events posted with
// If they are pending events, we must process them: pending events are
// either events to the threads other than main or events posted with
wxLog::FlushActive();
#endif // wxUSE_LOG
wxLog::FlushActive();
#endif // wxUSE_LOG
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
if ( SendIdleEvents() )
event.RequestMore(TRUE);
// Send OnIdle events to all windows
if ( SendIdleEvents() )
event.RequestMore(TRUE);
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
wxDC::ClearCache();
#endif // wxUSE_DC_CACHEING
wxDC::ClearCache();
#endif // wxUSE_DC_CACHEING
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
if ( SendIdleEvents() )
{
// Send OnIdle events to all windows
if ( SendIdleEvents() )
{
// idle events
event.RequestMore(TRUE);
}
// idle events
event.RequestMore(TRUE);
}
wxIsInOnIdleFlag = FALSE;
}
wxIsInOnIdleFlag = FALSE;
}
wxDC::ClearCache();
#endif // wxUSE_DC_CACHEING
wxDC::ClearCache();
#endif // wxUSE_DC_CACHEING
+ // Now done in ProcessIdle()
+#if 0
//
// Send OnIdle events to all windows
//
//
// Send OnIdle events to all windows
//
//
rEvent.RequestMore(TRUE);
}
//
rEvent.RequestMore(TRUE);
}
gbInOnIdle = FALSE;
} // end of wxApp::OnIdle
gbInOnIdle = FALSE;
} // end of wxApp::OnIdle
// 'Garbage' collection of windows deleted with Close()
DeletePendingObjects();
// 'Garbage' collection of windows deleted with Close()
DeletePendingObjects();
+ // Now done in ProcessIdle()
+#if 0
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);
// Send OnIdle events to all windows
bool needMore = SendIdleEvents();
if (needMore)
event.RequestMore(TRUE);