Don't reset selection while Ctrl or Shift key is pressed

Don't reset the selection in a generic multi-selection wxListCtrl while
Ctrl or Shift key is pressed to be consistent with wxMSW behaviour.

This commit is best viewed ignoring whitespace-only changes.

Closes #24332.
This commit is contained in:
taler21 2024-02-16 13:29:27 +01:00 committed by Vadim Zeitlin
parent 1bef48229e
commit 85b04c1c24

View file

@ -2548,6 +2548,10 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
GetParent()->GetEventHandler()->ProcessEvent(evtCtx);
}
else if (event.LeftDown())
{
// reset the selection in multi-selection mode only when Ctrl and
// Shift keys are not pressed to mimic MSW behaviour
if ( IsSingleSel() || !(event.ControlDown() || event.ShiftDown()) )
{
// reset the selection and bail out
HighlightAll(false);
@ -2556,6 +2560,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
if ( IsVirtual() && !IsSingleSel() )
SendNotify( m_lineLastClicked, wxEVT_LIST_ITEM_DESELECTED );
}
}
return;
}