X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5e97a17b1afb7cea4c03def51e830b5cd6d92d6..ed0dd9c1f0e9a79b5110d59b903a5f1fd9ee6c42:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 7ca5c3cdd9..315fbda05d 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -3812,6 +3812,29 @@ wxGrid::DoGridCellLeftDown(wxMouseEvent& event, } else { + if ( m_selection ) + { + // In row or column selection mode just clicking on the cell + // should select the row or column containing it: this is more + // convenient for the kinds of controls that use such selection + // mode and is compatible with 2.8 behaviour (see #12062). + switch ( m_selection->GetSelectionMode() ) + { + case wxGridSelectCells: + case wxGridSelectRowsOrColumns: + // nothing to do in these cases + break; + + case wxGridSelectRows: + m_selection->SelectRow(coords.GetRow()); + break; + + case wxGridSelectColumns: + m_selection->SelectCol(coords.GetCol()); + break; + } + } + m_waitForSlowClick = m_currentCellCoords == coords && coords != wxGridNoCellCoords; SetCurrentCell( coords );