- 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:
@@ -191,12 +191,7 @@ void wxFrame::DoGetClientSize(int *x, int *y) const
|
||||
|
||||
void wxFrame::Raise()
|
||||
{
|
||||
#ifdef __WIN16__
|
||||
// no SetForegroundWindow() in Win16
|
||||
wxFrameBase::Raise();
|
||||
#else // Win32
|
||||
::SetForegroundWindow(GetHwnd());
|
||||
#endif // Win16/32
|
||||
}
|
||||
|
||||
// generate an artificial resize event
|
||||
@@ -749,6 +744,10 @@ long wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_INITMENU:
|
||||
processed = HandleInitMenu();
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
processed = HandlePaint();
|
||||
break;
|
||||
@@ -763,16 +762,18 @@ long wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
processed = HandleMenuSelect(item, flags, hmenu);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifndef __WIN16__
|
||||
|
||||
// We don't need to send the wxEVT_MENU_OPEN
|
||||
// when we get WM_ENTERMENULOOP now, because we send
|
||||
// it when we get WM_INITMENU.
|
||||
#if 0
|
||||
case WM_ENTERMENULOOP:
|
||||
processed = HandleMenuLoop(wxEVT_MENU_OPEN, wParam);
|
||||
break;
|
||||
|
||||
#endif
|
||||
case WM_EXITMENULOOP:
|
||||
processed = HandleMenuLoop(wxEVT_MENU_CLOSE, wParam);
|
||||
break;
|
||||
#endif // __WIN16__
|
||||
|
||||
case WM_QUERYDRAGICON:
|
||||
{
|
||||
@@ -792,3 +793,15 @@ long wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return rc;
|
||||
}
|
||||
|
||||
// handle WM_INITMENU message
|
||||
bool wxFrame::HandleInitMenu()
|
||||
{
|
||||
wxMenuEvent event(wxEVT_MENU_OPEN, 0);
|
||||
event.SetEventObject(this);
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user