From d1f3be58465d45cf881ab5b066c51e2b3008e9a5 Mon Sep 17 00:00:00 2001 From: Knut Petter Lehre Date: Sat, 9 May 2015 18:03:06 +0200 Subject: [PATCH] Fix adding blocks to existing selection in wxGrid by Ctrl-drag. Allow using Ctrl-dragging to add more blocks to the existing selection, similarly to how spreadsheets work. Closes #14141. --- docs/changes.txt | 1 + src/generic/grid.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 6e9efe73f7..7d08f574dc 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -585,6 +585,7 @@ Unix: All (GUI): - Fix hang when deleting columns from wxTreeListCtrl. +- Allow using Ctrl-dragging to add to selection in wxGrid (Knut Petter Lehre). - Fix several floating point rounding bugs in wxPropertyGrid (Artur Wieczorek). - Restore support for wxFD_OVERWRITE_PROMPT and wxFD_FILE_MUST_EXIST in wxGenericFileDialog which was accidentally lost some time ago (Carl Godkin). diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 720db75ed4..b9f4f1a2a7 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -3953,7 +3953,9 @@ wxGrid::DoGridCellDrag(wxMouseEvent& event, case wxMOD_CONTROL: if ( m_selectedBlockCorner == wxGridNoCellCoords) m_selectedBlockCorner = coords; - UpdateBlockBeingSelected(m_selectedBlockCorner, coords); + if ( isFirstDrag ) + SetGridCursor(coords); + UpdateBlockBeingSelected(m_currentCellCoords, coords); break; case wxMOD_NONE: