- wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id);
- commandEvent.SetInt( id );
- commandEvent.SetEventObject( this );
-
- wxMenuBar *bar = GetMenuBar() ;
- if (!bar)
- return;
-
- /* TODO: check the menu item if required
- wxMenuItem *item = bar->FindItemForId(id) ;
- if (item && item->IsCheckable())
- {
- bar->Check(id,!bar->Checked(id)) ;
- }
- */
-
- GetEventHandler()->ProcessEvent(commandEvent);
+ wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
+ commandEvent.SetInt( id );
+ commandEvent.SetEventObject( this );
+
+ wxMenuBar *bar = GetMenuBar() ;
+ if (!bar)
+ return;
+
+/* TODO: check the menu item if required
+ wxMenuItem *item = bar->FindItemForId(id) ;
+ if (item && item->IsCheckable())
+ {
+ bar->Check(id,!bar->Checked(id)) ;
+ }
+*/
+
+ wxEvtHandler* evtHandler = GetEventHandler();
+
+ evtHandler->ProcessEvent(commandEvent);