+ return wxTreeItemId((WXHTREEITEM) hitTestInfo.hItem);
+}
+
+bool wxTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
+ wxRect& rect,
+ bool textOnly) const
+{
+ RECT rc;
+ if ( TreeView_GetItemRect(wxhWnd, (HTREEITEM)(WXHTREEITEM)item,
+ &rc, textOnly) )
+ {
+ rect = wxRect(wxPoint(rc.left, rc.top), wxPoint(rc.right, rc.bottom));
+
+ return TRUE;
+ }
+ else
+ {
+ // couldn't retrieve rect: for example, item isn't visible
+ return FALSE;
+ }
+}
+
+// ----------------------------------------------------------------------------
+// sorting stuff
+// ----------------------------------------------------------------------------
+
+static int CALLBACK TreeView_CompareCallback(wxTreeItemData *pItem1,
+ wxTreeItemData *pItem2,
+ wxTreeCtrl *tree)
+{
+ return tree->OnCompareItems(pItem1->GetId(), pItem2->GetId());
+}
+
+int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
+ const wxTreeItemId& item2)
+{
+ return strcmp(GetItemText(item1), GetItemText(item2));