From cb9965c3cc86503f4b5cab286378f576fe515280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 12 Mar 2002 23:20:55 +0000 Subject: [PATCH] fixes to refreshing code in wxTreeCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 590ca02113..2b2808ae7b 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2996,17 +2996,15 @@ void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item) wxClientDC dc(this); PrepareDC(dc); - int cw = 0; - int ch = 0; - GetClientSize( &cw, &ch ); + wxRect client = GetClientRect(); wxRect rect; - rect.x = dc.LogicalToDeviceX( 0 ); - rect.width = cw; - rect.y = dc.LogicalToDeviceY( item->GetY() ); - rect.height = ch; + rect.x = dc.LogicalToDeviceX(-client.x); + rect.width = client.width; + rect.y = dc.LogicalToDeviceY(-client.y + item->GetY()); + rect.height = client.height; - Refresh( TRUE, &rect ); + Refresh(TRUE, &rect); AdjustMyScrollbars(); } @@ -3016,19 +3014,17 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item ) if (m_dirty) return; wxClientDC dc(this); - PrepareDC( dc ); + PrepareDC(dc); - int cw = 0; - int ch = 0; - GetClientSize( &cw, &ch ); + wxRect client = GetClientRect(); wxRect rect; - rect.x = dc.LogicalToDeviceX( 0 ); - rect.y = dc.LogicalToDeviceY( item->GetY() ); - rect.width = cw; + rect.x = dc.LogicalToDeviceX(-client.x); + rect.y = dc.LogicalToDeviceY(-client.y + item->GetY()); + rect.width = client.width; rect.height = GetLineHeight(item); //dc.GetCharHeight() + 6; - Refresh( TRUE, &rect ); + Refresh(TRUE, &rect); } void wxGenericTreeCtrl::RefreshSelected()