From: Vadim Zeitlin Date: Sun, 11 Feb 2007 00:58:11 +0000 (+0000) Subject: update the popup menu item when it's [un]checked too, as it already happens for the... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/18138662efd0bc550d78cbe32e93e25b43bbcbd2 update the popup menu item when it's [un]checked too, as it already happens for the items in the main menu bar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 94e9827cdb..0c2a54e3a9 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -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));