From cff9316e5707ca3ba5320891c0b0f8389ea53802 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Oct 2015 17:25:37 +0200 Subject: [PATCH] Ensure that the selected item is fully visible in wxListbook Call EnsureVisible() after re-arranging the items as otherwise the current item could be only partly visible, at least with wxMSW wxListCtrl. --- src/generic/listbkg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index 9f29e7423b..220a6cc025 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -165,8 +165,14 @@ void wxListbook::OnSize(wxSizeEvent& event) // the other one is not accounted for in client size computations) wxListView * const list = GetListView(); if ( list ) + { list->Arrange(); + const int sel = GetSelection(); + if ( sel != wxNOT_FOUND ) + list->EnsureVisible(sel); + } + event.Skip(); }