X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2165ad93a2fc73d74d933570e095191281b9045f..50ef256ed3e52defe91655da5e3f6a9e913c9e2a:/src/msw/treectrl.cpp?ds=sidebyside diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index f174a3d021..11547d87e6 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -40,6 +40,10 @@ #include "wx/msw/private.h" +#ifdef __GNUWIN32__ +#include "wx/msw/gnuwin32/extra.h" +#endif + #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) #include #endif @@ -806,9 +810,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)