- // VZ: previosuly, the command int was set to id too which was quite
- // useless anyhow (as it could be retrieved using GetId()) and
- // uncompatible with wxGTK, so now we use the command int instead
- // to pass the checked status
- UINT menuState = ::GetMenuState(GetHmenu(), id, MF_BYCOMMAND) ;
- SendEvent(id, menuState & MF_CHECKED);
+ // get the checked status of the command: notice that menuState is the
+ // old state of the menu, so the test for MF_CHECKED must be inversed
+ UINT menuState = ::GetMenuState(GetHmenu(), id, MF_BYCOMMAND);
+ SendEvent(id, !(menuState & MF_CHECKED));