]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/treebase.cpp
copy setup.h from setup0.h
[wxWidgets.git] / src / common / treebase.cpp
index 4d9c1094e61039d954798d7e18a8cce744940b3e..38d242bf063267c577be5b432f2fea0ef96c50a6 100644 (file)
@@ -113,6 +113,12 @@ wxGetBestTreeSize(const wxTreeCtrlBase* treeCtrl, wxTreeItemId id, wxSize& size)
 
     if ( treeCtrl->GetBoundingRect(id, rect, true /* just the item */) )
     {
 
     if ( treeCtrl->GetBoundingRect(id, rect, true /* just the item */) )
     {
+        // Translate to logical position so we get the full extent
+#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
+        rect.x += treeCtrl->GetScrollPos(wxHORIZONTAL);
+        rect.y += treeCtrl->GetScrollPos(wxVERTICAL);
+#endif
+
         size.IncTo(wxSize(rect.GetRight(), rect.GetBottom()));
     }
 
         size.IncTo(wxSize(rect.GetRight(), rect.GetBottom()));
     }
 
@@ -163,7 +169,12 @@ wxSize wxTreeCtrlBase::DoGetBestSize() const
     if ( !size.x || !size.y )
         size = wxControl::DoGetBestSize();
     else
     if ( !size.x || !size.y )
         size = wxControl::DoGetBestSize();
     else
+    {
+        // Add border size
+        size += GetWindowBorderSize();
+
         CacheBestSize(size);
         CacheBestSize(size);
+    }
 
     return size;
 }
 
     return size;
 }