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:
Vadim Zeitlin
2019-10-01 00:06:03 +02:00
parent 239f045a3f
commit 73cab0bd4e
2 changed files with 13 additions and 1 deletions

View File

@@ -244,6 +244,15 @@ void TreeCtrlTestCase::SelectItemMulti()
m_tree->UnselectItem(m_child1);
CPPUNIT_ASSERT( !m_tree->IsSelected(m_child1) );
CPPUNIT_ASSERT( m_tree->IsSelected(m_child2) );
// collapsing a branch with selected items should still leave them selected
m_tree->Expand(m_child1);
m_tree->SelectItem(m_grandchild);
CHECK( m_tree->IsSelected(m_grandchild) );
m_tree->Collapse(m_child1);
CHECK( m_tree->IsSelected(m_grandchild) );
m_tree->Expand(m_child1);
CHECK( m_tree->IsSelected(m_grandchild) );
}
void TreeCtrlTestCase::ItemClick()