]> git.saurik.com Git - wxWidgets.git/commitdiff
make code dealing with wxUSE_IDLEMENUUPDATES a bit more clear and avoid warning due...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 14 Nov 2008 23:26:55 +0000 (23:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 14 Nov 2008 23:26:55 +0000 (23:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/framecmn.cpp

index 61efbb6cf699a34e54616384468517978f817bb7..206c959dfb1039b8636700b32f9dab983da63d0c 100644 (file)
@@ -228,14 +228,12 @@ void wxFrameBase::UpdateWindowUI(long flags)
 #if wxUSE_MENUS
     if (GetMenuBar())
     {
 #if wxUSE_MENUS
     if (GetMenuBar())
     {
-        if ((flags & wxUPDATE_UI_FROMIDLE) && !wxUSE_IDLEMENUUPDATES)
-        {
-            // If coming from an idle event, we only
-            // want to update the menus if we're
-            // in the wxUSE_IDLEMENUUPDATES configuration:
-            // so if we're not, do nothing
-        }
-        else
+        // If coming from an idle event, we only want to update the menus if
+        // we're in the wxUSE_IDLEMENUUPDATES configuration, otherwise they
+        // will be update when the menu is opened later
+#if !wxUSE_IDLEMENUUPDATES
+        if ( !(flags & wxUPDATE_UI_FROMIDLE) )
+#endif // wxUSE_IDLEMENUUPDATES
             DoMenuUpdates();
     }
 #endif // wxUSE_MENUS
             DoMenuUpdates();
     }
 #endif // wxUSE_MENUS
@@ -254,15 +252,14 @@ void wxFrameBase::OnMenuHighlight(wxMenuEvent& event)
 #endif // wxUSE_STATUSBAR
 }
 
 #endif // wxUSE_STATUSBAR
 }
 
-#if !wxUSE_IDLEMENUUPDATES
 void wxFrameBase::OnMenuOpen(wxMenuEvent& event)
 void wxFrameBase::OnMenuOpen(wxMenuEvent& event)
-#else
-void wxFrameBase::OnMenuOpen(wxMenuEvent& WXUNUSED(event))
-#endif
 {
 {
-#if !wxUSE_IDLEMENUUPDATES
+#if wxUSE_IDLEMENUUPDATES
+    wxUnusedVar(event);
+#else // !wxUSE_IDLEMENUUPDATES
+    // as we didn't update the menus from idle time, do it now
     DoMenuUpdates(event.GetMenu());
     DoMenuUpdates(event.GetMenu());
-#endif // !wxUSE_IDLEMENUUPDATES
+#endif // wxUSE_IDLEMENUUPDATES/!wxUSE_IDLEMENUUPDATES
 }
 
 void wxFrameBase::OnMenuClose(wxMenuEvent& WXUNUSED(event))
 }
 
 void wxFrameBase::OnMenuClose(wxMenuEvent& WXUNUSED(event))