Fix checked state for the popup menu items in the events generated by them.

We incorrectly passed the sign-extended int id to ::GetMenuState() function
that expects an unsigned WORD id, so it never found the item if the WORD id
had the high bit set. Fix this by correctly passing the unsigned id to it.

Closes #11644.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-09-16 13:23:05 +00:00
parent 7aab7c77f4
commit 3f8502f7fc

View File

@ -956,7 +956,10 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id_)
// 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);
//
// Also notice that we must pass unsigned id_ and not sign-extended id
// to ::GetMenuState() as this is what it expects.
UINT menuState = ::GetMenuState(GetHmenu(), id_, MF_BYCOMMAND);
SendEvent(id, menuState & MF_CHECKED);
}