fixed wxCommandEvent::IsChecked() for the menu events

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-07-18 19:44:32 +00:00
parent 555b2cf3c9
commit 8f3299d8ee

View File

@@ -196,15 +196,17 @@ bool wxFrameBase::ProcessCommand(int id)
if ( !bar ) if ( !bar )
return FALSE; return FALSE;
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
commandEvent.SetEventObject(this);
wxMenuItem *item = bar->FindItem(id); wxMenuItem *item = bar->FindItem(id);
if ( item && item->IsCheckable() ) if ( item && item->IsCheckable() )
{ {
item->Toggle(); item->Toggle();
}
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); // use the new value
commandEvent.SetInt(id); commandEvent.SetInt(item->IsChecked());
commandEvent.SetEventObject(this); }
return GetEventHandler()->ProcessEvent(commandEvent); return GetEventHandler()->ProcessEvent(commandEvent);
} }