Action menu: ensure a wxEVT_COMMAND_MENU_SELECTED event is sent to the menu,

when a wxTextCtrl has the focus but is read only, and cannot use a CHAR event.
It fixes an issue in Kicad manager (menus with accelerator not working) when
the wxTextCtrl window showing messages has the focus.
This commit is contained in:
jean-pierre charras 2020-06-17 12:00:34 +02:00
parent 0dd34d197e
commit 5db2b6ed8d
1 changed files with 6 additions and 1 deletions

View File

@ -415,7 +415,12 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent )
focus->HandleWindowEvent( keyEvent );
}
return;
// If the event was used as KEY event (not skipped) by the focused window,
// just finish.
// Otherwise this is actually a wxEVT_COMMAND_MENU_SELECTED, or the
// focused window is read only
if( !keyEvent.GetSkipped() )
return;
}
}