]> git.saurik.com Git - wxWidgets.git/commitdiff
Perform wxAuiToolBar idle updates from UpdateWindowUI(), not OnIdle().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Oct 2011 16:51:10 +0000 (16:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Oct 2011 16:51:10 +0000 (16:51 +0000)
No real changes, just optimize the idle updates by doing it from (less often
called) UpdateWindowUI() instead of EVT_IDLE handler.

Closes #10075.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69594 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aui/auibar.h
src/aui/auibar.cpp

index 548ec7db791bce6292d311af09fb647b89b6037c..8f28232d340cbe07c1ea9d771719281ce7a0254b 100644 (file)
@@ -577,6 +577,9 @@ public:
     wxSize GetHintSize(int dockDirection) const;
     bool IsPaneValid(const wxAuiPaneInfo& pane) const;
 
+    // Override to call DoIdleUpdate().
+    virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
+
 protected:
 
     virtual void OnCustomRender(wxDC& WXUNUSED(dc),
index 0d71b3162ae98d4ae0563db701a8f47dcdb8536f..ea22e1b6befbbb3325f348cdcfd5b1ee0c08cdd4 100644 (file)
@@ -2338,11 +2338,19 @@ void wxAuiToolBar::OnIdle(wxIdleEvent& evt)
             }
         }
     }
-
-    DoIdleUpdate();
     evt.Skip();
 }
 
+void wxAuiToolBar::UpdateWindowUI(long flags)
+{
+    if ( flags & wxUPDATE_UI_FROMIDLE )
+    {
+        DoIdleUpdate();
+    }
+
+    wxControl::UpdateWindowUI(flags);
+}
+
 void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt))
 {
     wxAutoBufferedPaintDC dc(this);