made wxAcceleratorTable work with buttons in wxGTK too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -869,8 +869,18 @@ gtk_window_key_press_callback( GtkWidget *widget,
|
||||
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
|
||||
if (command != -1)
|
||||
{
|
||||
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
|
||||
ret = ancestor->HandleWindowEvent( command_event );
|
||||
wxCommandEvent menu_event( wxEVT_COMMAND_MENU_SELECTED, command );
|
||||
ret = ancestor->HandleWindowEvent( menu_event );
|
||||
|
||||
if ( !ret )
|
||||
{
|
||||
// if the accelerator wasn't handled as menu event, try
|
||||
// it as button click (for compatibility with other
|
||||
// platforms):
|
||||
wxCommandEvent button_event( wxEVT_COMMAND_BUTTON_CLICKED, command );
|
||||
ret = ancestor->HandleWindowEvent( button_event );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if (ancestor->IsTopLevel())
|
||||
|
Reference in New Issue
Block a user