Fix selection after inserting items in wxListBox in wxOSX

We need to adjust the indices of the currently selected items as we need
to keep the same items, not the same indices, selected after new items
insertion.

Closes #18902.
This commit is contained in:
Andreas Falkenhahn
2020-12-05 22:45:13 +01:00
committed by Vadim Zeitlin
parent f7d50ed18c
commit 8bf53a7782
2 changed files with 51 additions and 3 deletions

View File

@@ -170,6 +170,8 @@ protected:
wxArrayPtrVoid m_itemsClientData;
private:
// Mostly the same as DoSetSelection() but doesn't call EnsureVisible().
void DoSetSelectionWithoutEnsureVisible(int n, bool select);
wxDECLARE_DYNAMIC_CLASS(wxListBox);
wxDECLARE_EVENT_TABLE();