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:
@@ -410,8 +410,7 @@ public:
|
|||||||
wxTreeItemId HitTest(const wxPoint& point, int& flags);
|
wxTreeItemId HitTest(const wxPoint& point, int& flags);
|
||||||
|
|
||||||
// get the bounding rectangle of the item (or of its label only)
|
// get the bounding rectangle of the item (or of its label only)
|
||||||
// @@@ do we really need to expose this functions to the application?
|
bool GetBoundingRect(const wxTreeItemId& item,
|
||||||
void GetBoundingRect(const wxTreeItemId& item,
|
|
||||||
wxRect& rect,
|
wxRect& rect,
|
||||||
bool textOnly = FALSE) const;
|
bool textOnly = FALSE) const;
|
||||||
|
|
||||||
|
@@ -806,9 +806,29 @@ wxTreeItemId wxTreeCtrl::HitTest(const wxPoint& point, int& flags)
|
|||||||
return wxTreeItemId((WXHTREEITEM) hitTestInfo.hItem);
|
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
|
// sorting stuff
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static int CALLBACK TreeView_CompareCallback(wxTreeItemData *pItem1,
|
static int CALLBACK TreeView_CompareCallback(wxTreeItemData *pItem1,
|
||||||
wxTreeItemData *pItem2,
|
wxTreeItemData *pItem2,
|
||||||
wxTreeCtrl *tree)
|
wxTreeCtrl *tree)
|
||||||
|
Reference in New Issue
Block a user