set command int (indicating whether the item is checked) correctly for the menu events (bug 1639891)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-01-20 14:13:52 +00:00
parent 9030e77918
commit 869c929083

View File

@ -491,19 +491,21 @@ bool wxToolMenuBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
wxToolBarToolBase *tool = FindById((int)id);
if ( !tool )
{
if (m_menuBar)
bool checked = false;
if ( m_menuBar )
{
wxMenuItem *item = m_menuBar->FindItem(id);
if (item && item->IsCheckable())
if ( item && item->IsCheckable() )
{
item->Toggle();
checked = item->IsChecked();
}
}
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
event.SetEventObject(this);
event.SetId(id);
event.SetInt(id);
event.SetInt(checked);
return GetEventHandler()->ProcessEvent(event);
}