Don't show selected tree item when using multiple selection

This is appropriate for single selection, where the selected item is
also always the focused one, but not in the multiple selection case.

And wxMSW native version already behaves like this, so this makes the
generic one consistent with it.

Closes #18691.
This commit is contained in:
Anton Triest
2020-03-11 00:01:47 +01:00
committed by Vadim Zeitlin
parent 7c6d816d4a
commit e1dcfc73d1

View File

@@ -2194,7 +2194,8 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
// This can cause idle processing to select the root
// if no item is selected, so it must be after the
// selection is set
EnsureVisible( itemId );
if (is_single)
EnsureVisible( itemId );
event.SetEventType(wxEVT_TREE_SEL_CHANGED);
GetEventHandler()->ProcessEvent( event );