- Moved wxApp::SendIdleEvents and wxApp::ProcessIdle into common code.
- wxWindow::OnInternalIdle is now used in all ports, and ensures that user OnIdle events do not interfere with crucial internal processing. - wxWindow::UpdateWindowUI is now a documented function that sends wxUpdateUIEvents, and can be overridden. It has a helper function DoUpdateWindowUI for taking appropriate wxUpdateUIEvent action. - Added functions to wxUpdateUIEvent: Set/GetMode, Set/GetUpdateInterval, CanUpdate, to assist with optimising update event frequency. - Added functions to wxIdleEvent: Set/GetMode, CanSend, to determine whether a window should receive idle events. - Added wxWS_EX_PROCESS_IDLE, wxWS_EX_PROCESS_UI_UPDATES window styles for use with conservative idle and update event modes. - wxMSW and wxGTK now send menu update events only when a menu is about to be used. - Added WM_INITMENU processing instead of WM_ENTERMENULOOP, or accelerators don't always get called since menu items may still be disabled. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -672,20 +672,6 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Returns TRUE if more time is needed.
|
||||
// Note that this duplicates wxEventLoopImpl::SendIdleEvent
|
||||
// but ProcessIdle may be needed by apps, so is kept.
|
||||
bool wxApp::ProcessIdle()
|
||||
{
|
||||
wxIdleEvent event;
|
||||
event.SetEventObject(this);
|
||||
ProcessEvent(event);
|
||||
|
||||
wxUpdateUIEvent::ResetUpdateTime();
|
||||
|
||||
return event.MoreRequested();
|
||||
}
|
||||
|
||||
void wxApp::ExitMainLoop()
|
||||
{
|
||||
if (m_mainLoop)
|
||||
@@ -748,51 +734,6 @@ void wxApp::WakeUpIdle()
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
bool needMore = FALSE;
|
||||
|
||||
wxIdleEvent event;
|
||||
event.SetEventObject(win);
|
||||
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
|
||||
wxWindowListNode* node = win->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->GetData();
|
||||
if (SendIdleEvents(win))
|
||||
needMore = TRUE;
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
win->OnInternalIdle();
|
||||
|
||||
return needMore;
|
||||
}
|
||||
|
||||
// Create display, and other initialization
|
||||
bool wxApp::OnInitGui()
|
||||
{
|
||||
|
Reference in New Issue
Block a user