]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
another attempt to fix strconv.cpp compilation
[wxWidgets.git] / src / common / framecmn.cpp
index 3d94d675e1c6fd7eda261a6758e353947af197b6..5782c231eff4c8304a89d89d41ff6f1af5707dd5 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);
 }
@@ -288,6 +290,14 @@ void wxFrameBase::OnMenuHighlight(wxMenuEvent& event)
 #endif // wxUSE_STATUSBAR
 }
 
+bool wxFrameBase::SendIconizeEvent(bool iconized)
+{
+    wxIconizeEvent event(GetId(), iconized);
+    event.SetEventObject(this);
+
+    return GetEventHandler()->ProcessEvent(event);
+}
+
 // ----------------------------------------------------------------------------
 // status bar stuff
 // ----------------------------------------------------------------------------
@@ -425,18 +435,23 @@ void wxFrameBase::DoMenuUpdates()
 {
     wxMenuBar* bar = GetMenuBar();
 
+#ifdef __WXMSW__
+    wxWindow* focusWin = wxFindFocusDescendant((wxWindow*) this);
+#else
+    wxWindow* focusWin = (wxWindow*) NULL;
+#endif
     if ( bar != NULL )
     {
         int nCount = bar->GetMenuCount();
         for (int n = 0; n < nCount; n++)
-            DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
+            DoMenuUpdates(bar->GetMenu(n), focusWin);
     }
 }
 
 // update a menu and all submenus recursively
-void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin))
+void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin)
 {
-    wxEvtHandler* evtHandler = GetEventHandler();
+    wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler();
     wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst();
     while (node)
     {