EnsureVisible() also expands the parent items

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-03-23 13:50:29 +00:00
parent 882eefb1f7
commit f65635b5c9
3 changed files with 63 additions and 33 deletions

View File

@@ -65,6 +65,7 @@ public:
void DoSortChildren(const wxTreeItemId& item, bool reverse = FALSE)
{ m_reverseSort = reverse; wxTreeCtrl::SortChildren(item); }
void DoEnsureVisible() { EnsureVisible(m_lastItem); }
protected:
virtual int OnCompareItems(const wxTreeItemId& item1,
@@ -78,6 +79,7 @@ private:
wxImageList *m_imageListNormal;
bool m_reverseSort; // flag for OnCompareItems
wxTreeItemId m_lastItem; // for OnEnsureVisible()
// NB: due to an ugly wxMSW hack you _must_ use DECLARE_DYNAMIC_CLASS()
// if you want your overloaded OnCompareItems() to be called.
@@ -107,6 +109,8 @@ public:
void OnSetBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(TRUE); }
void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(FALSE); }
void OnEnsureVisible(wxCommandEvent& event);
void OnRename(wxCommandEvent& event);
void OnSort(wxCommandEvent& event) { DoSort(); }
void OnSortRev(wxCommandEvent& event) { DoSort(TRUE); }
@@ -136,5 +140,6 @@ enum
TreeTest_DeleteChildren,
TreeTest_DeleteAll,
TreeTest_Recreate,
TreeTest_EnsureVisible,
TreeTest_Ctrl = 100
};
};