]> git.saurik.com Git - wxWidgets.git/commitdiff
Altered the message loop to process implicit accelerators correctly in controls
authorJulian Smart <julian@anthemion.co.uk>
Fri, 8 Jun 2001 11:33:22 +0000 (11:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 8 Jun 2001 11:33:22 +0000 (11:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index 5cbf84c3b7825b8fcecf5c50a2399b525205af58..64b718e4e05224a0ad7dd8939c71e2408d01afef 100644 (file)
@@ -1061,23 +1061,19 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg)
     // a translation table.
     wxWindow *wnd;
 
+    bool pastTopLevelWindow = FALSE;
     for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
     {
-        if ( wnd->MSWTranslateMessage(wxmsg) )
+        if ( !pastTopLevelWindow && wnd->MSWTranslateMessage(wxmsg))
+            return TRUE;
+        if ( wnd->MSWProcessMessage(wxmsg) )
             return TRUE;
 
         // 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
         // frame - this doesn't make much sense
         if ( wnd->IsTopLevel() )
-            break;
-    }
-
-    // Anyone for a non-translation message? Try youngest descendants first.
-    for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
-    {
-        if ( wnd->MSWProcessMessage(wxmsg) )
-            return TRUE;
+            pastTopLevelWindow = TRUE;
     }
 
     return FALSE;