Keep children of collapsed item selected in wxGenericTreeCtrl
Collapsing a branch shouldn't deselect all the items under it in multi-selection mode: this doesn't seem to be useful or otherwise make sense and makes the generic version gratuitously incompatible with the native MSW one. Closes #10239. Closes https://github.com/wxWidgets/wxWidgets/pull/1581
This commit is contained in:
@@ -1752,7 +1752,10 @@ void wxGenericTreeCtrl::ChildrenClosing(wxGenericTreeItem* item)
|
||||
|
||||
if ( item != m_current && IsDescendantOf(item, m_current) )
|
||||
{
|
||||
m_current->SetHilight( false );
|
||||
// Don't leave the only selected item invisible, but do leave selected
|
||||
// items selected if we can have many of them.
|
||||
if ( !HasFlag(wxTR_MULTIPLE) )
|
||||
m_current->SetHilight( false );
|
||||
m_current = NULL;
|
||||
m_select_me = item;
|
||||
}
|
||||
|
Reference in New Issue
Block a user