Move SendIdleEvents() from wxApp to wxWindow.

Use it to properly implement idle events for
wxGTK menubar, toolbar and statusbar.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2011-01-08 06:42:41 +00:00
parent 8d6eed5f04
commit 0c3e2a5baa
7 changed files with 45 additions and 72 deletions

View File

@@ -2604,6 +2604,34 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
// Idle processing
// ----------------------------------------------------------------------------
// Send idle event to window and all subwindows
bool wxWindowBase::SendIdleEvents(wxIdleEvent& event)
{
bool needMore = false;
OnInternalIdle();
// should we send idle event to this window?
if (wxIdleEvent::GetMode() == wxIDLE_PROCESS_ALL ||
HasExtraStyle(wxWS_EX_PROCESS_IDLE))
{
event.SetEventObject(this);
HandleWindowEvent(event);
if (event.MoreRequested())
needMore = true;
}
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
for (; node; node = node->GetNext())
{
wxWindow* child = node->GetData();
if (child->SendIdleEvents(event))
needMore = true;
}
return needMore;
}
void wxWindowBase::OnInternalIdle()
{
if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())