- return m_anchor->HitTest( wxPoint(x, y), this, flags);
+ if (m_anchor)
+ return m_anchor->HitTest( wxPoint(x, y), this, flags);
+ else
+ return wxTreeItemId();
+}
+
+// get the bounding rectangle of the item (or of its label only)
+bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
+ wxRect& rect,
+ bool WXUNUSED(textOnly)) const
+{
+ wxCHECK_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() - startY*PIXELS_PER_UNIT;
+ rect.width = i->GetWidth();
+ //rect.height = i->GetHeight();
+ rect.height = GetLineHeight(i);
+
+ return TRUE;