From 89e78831f70026c40a46a5fd109bc870d05680eb Mon Sep 17 00:00:00 2001 From: Bill Su Date: Thu, 11 Jan 2024 00:47:04 -0500 Subject: [PATCH] wxVListBox: add GetCurrent()/SetCurrent() accessors --- include/wx/vlbox.h | 6 ++++++ interface/wx/vlbox.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/wx/vlbox.h b/include/wx/vlbox.h index e4e1e0d7fc..ce65ec9252 100644 --- a/include/wx/vlbox.h +++ b/include/wx/vlbox.h @@ -95,6 +95,12 @@ public: bool IsCurrent() const { return wxVScrolledWindow::IsCurrent(); } #endif + // get current item + int GetCurrent() const { return m_current; } + + // set current item + void SetCurrent(int current) { DoSetCurrent(current); } + // is this item selected? bool IsSelected(size_t item) const; diff --git a/interface/wx/vlbox.h b/interface/wx/vlbox.h index 3ec265b884..f673b069b4 100644 --- a/interface/wx/vlbox.h +++ b/interface/wx/vlbox.h @@ -183,6 +183,23 @@ public: */ bool IsCurrent(size_t item) const; + /** + Get the current item or @c wxNOT_FOUND if there is no + current item. + + @since 3.2.5 + */ + int GetCurrent() const; + + /** + Set the specified item as the current item, if it is wxNOT_FOUND + the current item is unset. The current item will be automatically + scrolled into view if it isn't currently visible. + + @since 3.2.5 + */ + void SetCurrent(int current); + /** Returns @true if this item is selected, @false otherwise. */