From: Vadim Zeitlin Date: Sun, 30 Oct 2011 16:51:10 +0000 (+0000) Subject: Perform wxAuiToolBar idle updates from UpdateWindowUI(), not OnIdle(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3ac17397c5860210f35d5ac47ea9c1834d4bce85 Perform wxAuiToolBar idle updates from UpdateWindowUI(), not OnIdle(). 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 --- diff --git a/include/wx/aui/auibar.h b/include/wx/aui/auibar.h index 548ec7db79..8f28232d34 100644 --- a/include/wx/aui/auibar.h +++ b/include/wx/aui/auibar.h @@ -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), diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 0d71b3162a..ea22e1b6be 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -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);