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.
This commit is contained in:
Vadim Zeitlin
2015-10-17 17:25:37 +02:00
parent 5e29b26d9e
commit cff9316e57

View File

@@ -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();
}