Altered the message loop to process implicit accelerators correctly in controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1061,23 +1061,19 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg)
|
|||||||
// a translation table.
|
// a translation table.
|
||||||
wxWindow *wnd;
|
wxWindow *wnd;
|
||||||
|
|
||||||
|
bool pastTopLevelWindow = FALSE;
|
||||||
for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
|
for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
|
||||||
{
|
{
|
||||||
if ( wnd->MSWTranslateMessage(wxmsg) )
|
if ( !pastTopLevelWindow && wnd->MSWTranslateMessage(wxmsg))
|
||||||
|
return TRUE;
|
||||||
|
if ( wnd->MSWProcessMessage(wxmsg) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
// stop at first top level window, i.e. don't try to process the key
|
// stop at first top level window, i.e. don't try to process the key
|
||||||
// strokes originating in a dialog using the accelerators of the parent
|
// strokes originating in a dialog using the accelerators of the parent
|
||||||
// frame - this doesn't make much sense
|
// frame - this doesn't make much sense
|
||||||
if ( wnd->IsTopLevel() )
|
if ( wnd->IsTopLevel() )
|
||||||
break;
|
pastTopLevelWindow = TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
// Anyone for a non-translation message? Try youngest descendants first.
|
|
||||||
for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
|
|
||||||
{
|
|
||||||
if ( wnd->MSWProcessMessage(wxmsg) )
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Reference in New Issue
Block a user