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:
@@ -491,19 +491,21 @@ bool wxToolMenuBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
|
|||||||
wxToolBarToolBase *tool = FindById((int)id);
|
wxToolBarToolBase *tool = FindById((int)id);
|
||||||
if ( !tool )
|
if ( !tool )
|
||||||
{
|
{
|
||||||
if (m_menuBar)
|
bool checked = false;
|
||||||
|
if ( m_menuBar )
|
||||||
{
|
{
|
||||||
wxMenuItem *item = m_menuBar->FindItem(id);
|
wxMenuItem *item = m_menuBar->FindItem(id);
|
||||||
if (item && item->IsCheckable())
|
if ( item && item->IsCheckable() )
|
||||||
{
|
{
|
||||||
item->Toggle();
|
item->Toggle();
|
||||||
|
checked = item->IsChecked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
|
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
event.SetId(id);
|
event.SetId(id);
|
||||||
event.SetInt(id);
|
event.SetInt(checked);
|
||||||
|
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user