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

@ -2549,12 +2549,17 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
}
else if (event.LeftDown())
{
// reset the selection and bail out
HighlightAll(false);
// generate a DESELECTED event for
// virtual multi-selection lists
if ( IsVirtual() && !IsSingleSel() )
SendNotify( m_lineLastClicked, wxEVT_LIST_ITEM_DESELECTED );
// 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);
// generate a DESELECTED event for
// virtual multi-selection lists
if ( IsVirtual() && !IsSingleSel() )
SendNotify( m_lineLastClicked, wxEVT_LIST_ITEM_DESELECTED );
}
}
return;