X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98e956503de9035a6c4ef529da7e377b74d59b69..ed0dd9c1f0e9a79b5110d59b903a5f1fd9ee6c42:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index d0675c4d8a..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 ); @@ -5572,6 +5595,11 @@ void wxGrid::DrawColLabel(wxDC& dc, int col) } else { + // It is reported that we need to erase the background to avoid display + // artefacts, see #12055. + wxDCBrushChanger setBrush(dc, m_colWindow->GetBackgroundColour()); + dc.DrawRectangle(rect); + rend.DrawBorder(*this, dc, rect); }