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
This commit is contained in:
Vadim Zeitlin
2006-07-24 18:18:34 +00:00
parent 27f8357f3c
commit 3e6e514739
2 changed files with 15 additions and 10 deletions

View File

@@ -208,6 +208,7 @@ public:
virtual void Freeze(); virtual void Freeze();
virtual void Thaw(); virtual void Thaw();
virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL);
virtual bool SetFont( const wxFont &font ); virtual bool SetFont( const wxFont &font );
virtual void SetWindowStyle(const long styles); virtual void SetWindowStyle(const long styles);

View File

@@ -3399,10 +3399,16 @@ void wxGenericTreeCtrl::CalculatePositions()
CalculateLevel( m_anchor, dc, 0, y ); // start recursion 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) void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
{ {
if (m_dirty) return; if (m_dirty || m_freezeCount)
if (m_freezeCount) return; return;
wxSize client = GetClientSize(); wxSize client = GetClientSize();
@@ -3418,8 +3424,8 @@ void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item ) void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
{ {
if (m_dirty) return; if (m_dirty || m_freezeCount)
if (m_freezeCount) return; return;
wxRect rect; wxRect rect;
CalcScrolledPosition(0, item->GetY(), NULL, &rect.y); CalcScrolledPosition(0, item->GetY(), NULL, &rect.y);
@@ -3431,7 +3437,8 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
void wxGenericTreeCtrl::RefreshSelected() 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 // TODO: this is awfully inefficient, we should keep the list of all
// selected items internally, should be much faster // selected items internally, should be much faster
@@ -3441,7 +3448,8 @@ void wxGenericTreeCtrl::RefreshSelected()
void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item) void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item)
{ {
if (m_freezeCount) return; if (m_freezeCount || m_freezeCount)
return;
if ( item->IsSelected() ) if ( item->IsSelected() )
RefreshLine(item); RefreshLine(item);
@@ -3478,8 +3486,6 @@ bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour)
if ( !wxWindow::SetBackgroundColour(colour) ) if ( !wxWindow::SetBackgroundColour(colour) )
return false; return false;
if (m_freezeCount) return true;
Refresh(); Refresh();
return true; return true;
@@ -3490,8 +3496,6 @@ bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour)
if ( !wxWindow::SetForegroundColour(colour) ) if ( !wxWindow::SetForegroundColour(colour) )
return false; return false;
if (m_freezeCount) return true;
Refresh(); Refresh();
return true; return true;