]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes to refreshing code in wxTreeCtrl
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 12 Mar 2002 23:20:55 +0000 (23:20 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 12 Mar 2002 23:20:55 +0000 (23:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 590ca0211351b378cc757dd1eda60843920b4dd5..2b2808ae7b2ab52883ff58795cc5b7e20b79b372 100644 (file)
@@ -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()