// if this returns TRUE, set continueToDispatch to False
// (don't continue processing).
// Otherwise set it to True and call OnChar.
- wxKeyEvent keyEvent(wxEVENT_TYPE_CHAR);
+ wxKeyEvent keyEvent(wxEVT_CHAR);
if (wxTranslateKeyEvent(keyEvent, dialog, wid, event))
{
keyEvent.SetEventObject(dialog);
void wxFrame::ProcessCommand(int id)
{
- 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)) ;
+ }
+*/
+
+ GetEventHandler()->ProcessEvent(commandEvent);
}
// Checks if there is a toolbar, and returns the first free client position