From a84fc80be30a9b2a3dc18b19d4b699584d2ca510 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 18 Jan 2000 14:22:10 +0000 Subject: [PATCH] Change to wxWindow::HandleCommand to allow accelerators to work even if there 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 56c4913473..ce331f7452 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -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; }