]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
Include wx/utils.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / common / framecmn.cpp
index 3137700a8875b5f0f66d598fe3cb7296f1760f49..923fb49e2df6ea42f1cd600dd4fc1e53ff133710 100644 (file)
@@ -523,16 +523,16 @@ void wxFrameBase::SetToolBar(wxToolBar *toolbar)
 // update all menus
 void wxFrameBase::DoMenuUpdates(wxMenu* menu)
 {
-    wxEvtHandler* source = GetEventHandler();
-    wxMenuBar* bar = GetMenuBar();
-
     if (menu)
+    {
+        wxEvtHandler* source = GetEventHandler();
         menu->UpdateUI(source);
-    else if ( bar != NULL )
+    }
+    else
     {
-        int nCount = bar->GetMenuCount();
-        for (int n = 0; n < nCount; n++)
-            bar->GetMenu(n)->UpdateUI(source);
+        wxMenuBar* bar = GetMenuBar();
+        if (bar != NULL)
+            bar->UpdateMenus();
     }
 }