]> git.saurik.com Git - wxWidgets.git/commitdiff
Change to wxWindow::HandleCommand to allow accelerators to work even if there
authorJulian Smart <julian@anthemion.co.uk>
Tue, 18 Jan 2000 14:22:10 +0000 (14:22 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 18 Jan 2000 14:22:10 +0000 (14:22 +0000)
is no corresponding child window.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 56c491347362357e384a8b3fd54227f9eaea1054..ce331f74524b4c6867f6f227598af7bdf9c20547 100644 (file)
@@ -2997,6 +2997,17 @@ bool wxWindow::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
 
     if ( win )
         return win->MSWCommand(cmd, id);
+    else
+    {
+        // If no child window, it may be an accelerator, e.g. for
+        // a popup menu command.
+
+        wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
+        event.SetEventObject(this);
+        event.SetId(id);
+        event.SetInt(id);
+        return ProcessEvent(event);
+    }
 
     return FALSE;
 }