From 99893e284f45586bc8c0732eb28bce5aab77beb7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 Sep 2011 13:23:10 +0000 Subject: [PATCH] Fix int field of wxCommandEvent generated by popup menu items in wxMSW. 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 --- src/msw/menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 543ed55116..8e11eeb1d3 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -960,7 +960,7 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id_) // 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); } return true; -- 2.45.2