]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menu.cpp
Ignore Windows key
[wxWidgets.git] / src / msw / menu.cpp
index 94e9827cdb632b5b303671320730da828dfaf78d..0c2a54e3a908758ce97ab111bd814e973c5cabd3 100644 (file)
@@ -777,7 +777,12 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id)
     // ignore commands from the menu title
     if ( id != (WXWORD)idMenuTitle )
     {
-        // get the checked status of the command: notice that menuState is the
+        // update the check item when it's clicked
+        wxMenuItem * const item = FindItem(id);
+        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
         UINT menuState = ::GetMenuState(GetHmenu(), id, MF_BYCOMMAND);
         SendEvent(id, !(menuState & MF_CHECKED));