From 2349bce2c440da37915acaad58f96c0ad853df21 Mon Sep 17 00:00:00 2001 From: kkrev Date: Tue, 31 Mar 2015 14:31:14 -0400 Subject: [PATCH] Add wxTreeListCtrl::EnsureVisible(). Just forward this to the wxDataViewCtrl method with the same name. Closes #16937. --- include/wx/treelist.h | 1 + interface/wx/treelist.h | 7 +++++++ src/generic/treelist.cpp | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/include/wx/treelist.h b/include/wx/treelist.h index 65208cb0a1..9782903ef4 100644 --- a/include/wx/treelist.h +++ b/include/wx/treelist.h @@ -313,6 +313,7 @@ public: void SelectAll(); void UnselectAll(); + void EnsureVisible(wxTreeListItem item); // Checkbox handling // ----------------- diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index 6928a2d91d..e2e468f7f4 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -710,6 +710,13 @@ public: */ void UnselectAll(); + /** + Call this to ensure that the given item is visible. + + @since 3.1.0 + */ + void EnsureVisible(wxTreeListItem item); + //@} diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index fbcf393f9c..635ceef643 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -1400,6 +1400,14 @@ void wxTreeListCtrl::UnselectAll() m_view->UnselectAll(); } +void wxTreeListCtrl::EnsureVisible(wxTreeListItem item) +{ + wxCHECK_RET( m_view, "Must create first" ); + + m_view->EnsureVisible(m_model->ToDVI(item)); +} + + // ---------------------------------------------------------------------------- // Checkbox handling // ----------------------------------------------------------------------------