]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
fix from Robert
[wxWidgets.git] / src / common / framecmn.cpp
index 3d94d675e1c6fd7eda261a6758e353947af197b6..c7678d5b5f55afd743a4735ff53594202680a002 100644 (file)
@@ -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);
 }