The intention of the code generating the event for popup menu items was to
pass false (0) or true (1) in the int field of wxCommandEvent to indicate
whether the item was checked or not but, because wxMenu::SendEvent() takes int
as second argument and not book, we passed either 0 or MF_CHECKED (== 8).
Fix this by correctly passing a boolean for checkable items.
See #11644.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69100
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// 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);
// 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);
+ SendEvent(id, menuState & MF_CHECKED ? 1 : 0);