Fix selection on right click in generic wxListCtrl

Right clicking item always selected it, which made it possible to have
multiple selected items even in a single-selection control.

Restore HighlightAll(false) erroneously removed by fedc80eee3 (Improve
selection and focus events generation in wxGenericLisCtrl, 2020-09-06)
to fix this and restore the correct old behaviour.

Note that even in multiple selection mode right clicking a previously
unselected item should still clear the selection, as it does it in the
other GTK programs (and also under MSW).
This commit is contained in:
Vadim Zeitlin
2021-08-23 00:16:32 +02:00
parent 12ddfb45c5
commit 14511a8bec

View File

@@ -2682,6 +2682,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
// Multi-selections should not be cleared if a selected item is clicked.
if (!IsHighlighted(current))
{
HighlightAll(false);
ChangeCurrent(current);
HighlightOnly(m_current);
}