Fix deselecting items on branch toggle in wxTR_MULTIPLE control
Don't deselect all the other items when an item is collapsed or expanded
in wxGenericTreeCtrl with wxTR_MULTIPLE style, this was completely
unexpected and seems to have been accidentally introduced back in
35cf1ec63c
Closes #18680.
This commit is contained in:
committed by
Vadim Zeitlin
parent
8bc830337c
commit
0c6d6e6472
@@ -3789,13 +3789,19 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
||||
GetEventHandler()->ProcessEvent(nevent);
|
||||
}
|
||||
|
||||
// this facilitates multiple-item drag-and-drop
|
||||
if ( HasFlag(wxTR_MULTIPLE) && !(event.CmdDown() || event.ShiftDown()) )
|
||||
// Don't deselect anything if we're just collapsing or expanding
|
||||
// the item.
|
||||
if ( !(flags & wxTREE_HITTEST_ONITEMBUTTON) )
|
||||
{
|
||||
wxArrayTreeItemIds selections;
|
||||
if ( GetSelections(selections) > 1 )
|
||||
// this facilitates multiple-item drag-and-drop
|
||||
if ( HasFlag(wxTR_MULTIPLE) &&
|
||||
!(event.CmdDown() || event.ShiftDown()) )
|
||||
{
|
||||
DoSelectItem(item, true, false);
|
||||
wxArrayTreeItemIds selections;
|
||||
if ( GetSelections(selections) > 1 )
|
||||
{
|
||||
DoSelectItem(item, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user