From abd9aaa4313822009adc2652b3822fc1b230b60a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 13 Apr 2020 17:52:43 +0200 Subject: [PATCH] Stop setting current cell on first Ctrl-drag event This is not necessary any longer as the current cell is changed on Ctrl-click since the previous commit. This commit is best viewed ignoring whitespace. --- src/generic/grid.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 69de77cada..40bbaf678e 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4483,26 +4483,19 @@ wxGrid::DoGridCellDrag(wxMouseEvent& event, SaveEditControlValue(); } - switch ( event.GetModifiers() ) + if ( !event.HasAnyModifiers() ) { - case wxMOD_CONTROL: + if ( CanDragCell() ) + { if ( isFirstDrag ) - SetGridCursor(coords); - break; - - case wxMOD_NONE: - if ( CanDragCell() ) { - if ( isFirstDrag ) - { - // if event is handled by user code, no further processing - if ( SendEvent(wxEVT_GRID_CELL_BEGIN_DRAG, coords, event) != 0 ) - performDefault = false; + // if event is handled by user code, no further processing + if ( SendEvent(wxEVT_GRID_CELL_BEGIN_DRAG, coords, event) != 0 ) + performDefault = false; - return performDefault; - } + return performDefault; } - break; + } } // Edit the current selection block independently of the modifiers state.