From 8f3299d8ee141a23d5602ce67f3cd690865624ce Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Jul 2000 19:44:32 +0000 Subject: [PATCH] fixed wxCommandEvent::IsChecked() for the menu events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/framecmn.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 3d94d675e1..c7678d5b5f 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -196,15 +196,17 @@ bool wxFrameBase::ProcessCommand(int id) if ( !bar ) return FALSE; + wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); + commandEvent.SetEventObject(this); + wxMenuItem *item = bar->FindItem(id); if ( item && item->IsCheckable() ) { item->Toggle(); - } - wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); - commandEvent.SetInt(id); - commandEvent.SetEventObject(this); + // use the new value + commandEvent.SetInt(item->IsChecked()); + } return GetEventHandler()->ProcessEvent(commandEvent); }