wxTreeCtrl::GetBoundRect() implemented

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-02-27 14:38:46 +00:00
parent 0a54c4a8cd
commit f7c832a786
2 changed files with 21 additions and 2 deletions

View File

@@ -410,8 +410,7 @@ public:
wxTreeItemId HitTest(const wxPoint& point, int& flags);
// get the bounding rectangle of the item (or of its label only)
// @@@ do we really need to expose this functions to the application?
void GetBoundingRect(const wxTreeItemId& item,
bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
bool textOnly = FALSE) const;

View File

@@ -806,9 +806,29 @@ wxTreeItemId wxTreeCtrl::HitTest(const wxPoint& point, int& flags)
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)