From: Vadim Zeitlin Date: Mon, 24 Jul 2006 18:18:34 +0000 (+0000) Subject: do nothing in Refresh() if the control is frozen X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3e6e514739bdd157966d2bd2726118f1054dd1c1 do nothing in Refresh() if the control is frozen git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index ccaa5fbdb0..b4c3e11e79 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -208,6 +208,7 @@ public: virtual void Freeze(); virtual void Thaw(); + virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL); virtual bool SetFont( const wxFont &font ); virtual void SetWindowStyle(const long styles); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 0c37bbbc46..2ebb0d6c30 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -3399,10 +3399,16 @@ void wxGenericTreeCtrl::CalculatePositions() CalculateLevel( m_anchor, dc, 0, y ); // start recursion } +void wxGenericTreeCtrl::Refresh(bool eraseBackground, const wxRect *rect) +{ + if ( !m_freezeCount ) + wxTreeCtrlBase::Refresh(eraseBackground, rect); +} + void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item) { - if (m_dirty) return; - if (m_freezeCount) return; + if (m_dirty || m_freezeCount) + return; wxSize client = GetClientSize(); @@ -3418,8 +3424,8 @@ void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item) void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item ) { - if (m_dirty) return; - if (m_freezeCount) return; + if (m_dirty || m_freezeCount) + return; wxRect rect; CalcScrolledPosition(0, item->GetY(), NULL, &rect.y); @@ -3431,7 +3437,8 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item ) void wxGenericTreeCtrl::RefreshSelected() { - if (m_freezeCount) return; + if (m_freezeCount || m_freezeCount) + return; // TODO: this is awfully inefficient, we should keep the list of all // selected items internally, should be much faster @@ -3441,7 +3448,8 @@ void wxGenericTreeCtrl::RefreshSelected() void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item) { - if (m_freezeCount) return; + if (m_freezeCount || m_freezeCount) + return; if ( item->IsSelected() ) RefreshLine(item); @@ -3478,8 +3486,6 @@ bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour) if ( !wxWindow::SetBackgroundColour(colour) ) return false; - if (m_freezeCount) return true; - Refresh(); return true; @@ -3490,8 +3496,6 @@ bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour) if ( !wxWindow::SetForegroundColour(colour) ) return false; - if (m_freezeCount) return true; - Refresh(); return true;