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:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user