X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a50a2c4d3b39901947b68c81973016d56da75e1..fdfedfc07701a1db96b8217321b09bd19808ac24:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 82e0f7a3ee..76aca9086c 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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())