git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45013
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( item && item->IsCheckable() )
item->Toggle();
if ( item && item->IsCheckable() )
item->Toggle();
- // get the checked status of the menu item: note that menuState is the
- // old state of the menu, so the test for MF_CHECKED must be inverted
+ // get the status of the menu item: note that it has been just changed
+ // by Toggle() above so here we already get the new state of the item
UINT menuState = ::GetMenuState(GetHmenu(), id, MF_BYCOMMAND);
UINT menuState = ::GetMenuState(GetHmenu(), id, MF_BYCOMMAND);
- SendEvent(id, !(menuState & MF_CHECKED));
+ SendEvent(id, menuState & MF_CHECKED);