]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
Added chapter on collection and container classes to contents
[wxWidgets.git] / src / generic / treectlg.cpp
index 3e1dcb049b2114cf476bf5411b6e605d1e36fcfd..76bf9030ab17a773e8f93d39a57c6b91817ca2dc 100644 (file)
@@ -84,7 +84,7 @@ public:
                     const wxString &value = wxEmptyString,
                     const wxPoint &pos = wxDefaultPosition,
                     const wxSize &size = wxDefaultSize,
-                    int style = 0,
+                    int style = wxSIMPLE_BORDER,
                     const wxValidator& validator = wxDefaultValidator,
                     const wxString &name = wxTextCtrlNameStr );
 
@@ -2109,6 +2109,27 @@ wxTreeItemId wxGenericTreeCtrl::HitTest(const wxPoint& point, int& flags)
     return m_anchor->HitTest( wxPoint(x, y), this, flags);
 }
 
+// get the bounding rectangle of the item (or of its label only)
+bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
+                         wxRect& rect,
+                         bool textOnly) const
+{
+    wxCHECK2_MSG( item.IsOk(), FALSE, _T("invalid item in wxGenericTreeCtrl::GetBoundingRect") );
+
+    wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem;
+
+    int startX, startY;
+    GetViewStart(& startX, & startY);
+
+    rect.x = i->GetX() - startX*PIXELS_PER_UNIT; rect.y = i->GetY()*PIXELS_PER_UNIT;
+    rect.width = i->GetWidth(); rect.height = i->GetHeight();
+
+    return TRUE;
+
+    // wxFAIL_MSG(wxT("GetBoundingRect unimplemented"));
+    // return FALSE;
+}
+
 /* **** */
 
 void wxGenericTreeCtrl::Edit( const wxTreeItemId& item )