Add menu object to menu item highlight events
The OSX highlight events already included the menu object, so this adds it to the other platforms to make it consistent.
This commit is contained in:
parent
050ca4ce3a
commit
65a21a5393
@ -560,7 +560,7 @@ static void menuitem_select(GtkWidget*, wxMenuItem* item)
|
||||
if (!item->IsEnabled())
|
||||
return;
|
||||
|
||||
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item->GetId());
|
||||
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item->GetId(), item->GetMenu());
|
||||
DoCommonMenuCallbackCode(item->GetMenu(), event);
|
||||
}
|
||||
}
|
||||
@ -575,7 +575,7 @@ static void menuitem_deselect(GtkWidget*, wxMenuItem* item)
|
||||
if (!item->IsEnabled())
|
||||
return;
|
||||
|
||||
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1 );
|
||||
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, -1, item->GetMenu());
|
||||
DoCommonMenuCallbackCode(item->GetMenu(), event);
|
||||
}
|
||||
}
|
||||
|
@ -645,7 +645,7 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
|
||||
if (!menu->IsEnabled(id))
|
||||
return;
|
||||
|
||||
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, id );
|
||||
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, id, menu );
|
||||
event.SetEventObject( menu );
|
||||
|
||||
wxEvtHandler* handler = menu->GetEventHandler();
|
||||
@ -673,7 +673,7 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
|
||||
if (!menu->IsEnabled(id))
|
||||
return;
|
||||
|
||||
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1 );
|
||||
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1, menu );
|
||||
event.SetEventObject( menu );
|
||||
|
||||
wxEvtHandler* handler = menu->GetEventHandler();
|
||||
|
@ -385,7 +385,7 @@ void wxMenuItemArmCallback (Widget WXUNUSED(w), XtPointer clientData,
|
||||
{
|
||||
if (item->GetMenuBar() && item->GetMenuBar()->GetMenuBarFrame())
|
||||
{
|
||||
wxMenuEvent menuEvent(wxEVT_MENU_HIGHLIGHT, item->GetId());
|
||||
wxMenuEvent menuEvent(wxEVT_MENU_HIGHLIGHT, item->GetId(), item->GetMenu());
|
||||
menuEvent.SetEventObject(item->GetMenuBar()->GetMenuBarFrame());
|
||||
|
||||
item->GetMenuBar()->GetMenuBarFrame()
|
||||
@ -405,7 +405,7 @@ wxMenuItemDisarmCallback (Widget WXUNUSED(w), XtPointer clientData,
|
||||
{
|
||||
// TODO: not sure this is correct, since -1 means something
|
||||
// special to event system
|
||||
wxMenuEvent menuEvent(wxEVT_MENU_HIGHLIGHT, -1);
|
||||
wxMenuEvent menuEvent(wxEVT_MENU_HIGHLIGHT, -1, item->GetMenu());
|
||||
menuEvent.SetEventObject(item->GetMenuBar()->GetMenuBarFrame());
|
||||
|
||||
item->GetMenuBar()->GetMenuBarFrame()
|
||||
|
@ -2420,8 +2420,9 @@ wxWindowMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
|
||||
if ( flags & (MF_POPUP | MF_SEPARATOR) )
|
||||
item = wxID_NONE;
|
||||
|
||||
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item);
|
||||
if ( wxMenu::ProcessMenuEvent(MSWFindMenuFromHMENU(hMenu), event, this) )
|
||||
wxMenu* menu = MSWFindMenuFromHMENU(hMenu);
|
||||
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item, menu);
|
||||
if ( wxMenu::ProcessMenuEvent(menu, event, this) )
|
||||
return true;
|
||||
|
||||
// by default, i.e. if the event wasn't handled above, clear the status bar
|
||||
|
Loading…
Reference in New Issue
Block a user