implement wxTreeCtrl::GetFocusedItem() for wxMSW too (see #10859)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-06-19 23:48:50 +00:00
parent 48889bca6f
commit 3c01c59511
2 changed files with 6 additions and 0 deletions

View File

@ -127,6 +127,7 @@ public:
virtual wxTreeItemId GetRootItem() const;
virtual wxTreeItemId GetSelection() const;
virtual size_t GetSelections(wxArrayTreeItemIds& selections) const;
virtual wxTreeItemId GetFocusedItem() const;
virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item,

View File

@ -1354,6 +1354,11 @@ wxTreeItemId wxTreeCtrl::GetSelection() const
wxCHECK_MSG( !HasFlag(wxTR_MULTIPLE), wxTreeItemId(),
wxT("this only works with single selection controls") );
return GetFocusedItem();
}
wxTreeItemId wxTreeCtrl::GetFocusedItem() const
{
return wxTreeItemId(TreeView_GetSelection(GetHwnd()));
}