Remove the selecting mode flag from wxGridSelection
Remove m_isSelecting and StartSelecting() from wxGridSelection to avoid inconsistency of wxGridSelection selecting mode state with wxGrid state, as wxGrid already has m_isDragging field which tells it if the selection state is final or not. Instead, just allow wxGrid to specify the event to send from ExtendCurrentBlock(). We still need a separate EndSelecting() for sending the final wxEVT_GRID_RANGE_SELECTED event, but send it only for the last selection block, and not all the selected blocks, as this makes more sense (there should be one SELECTED event for each block and it was already sent for the other blocks before) and is consistent with the events generated when performing the same actions from keyboard.
This commit is contained in:
committed by
Vadim Zeitlin
parent
decc255846
commit
0a2c62fc5c
@@ -4384,7 +4384,7 @@ void wxGrid::DoAfterDraggingEnd()
|
||||
m_cursorMode = WXGRID_CURSOR_SELECT_CELL;
|
||||
m_winCapture->SetCursor( *wxSTANDARD_CURSOR );
|
||||
m_winCapture = NULL;
|
||||
|
||||
|
||||
m_selection->EndSelecting();
|
||||
}
|
||||
|
||||
@@ -4514,11 +4514,10 @@ wxGrid::DoGridCellDrag(wxMouseEvent& event,
|
||||
// of the modifier keys matters.
|
||||
if ( m_selection )
|
||||
{
|
||||
if (isFirstDrag)
|
||||
{
|
||||
m_selection->StartSelecting();
|
||||
}
|
||||
m_selection->ExtendCurrentBlock(m_currentCellCoords, coords, event);
|
||||
m_selection->ExtendCurrentBlock(m_currentCellCoords,
|
||||
coords,
|
||||
event,
|
||||
wxEVT_GRID_RANGE_SELECTING);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -4823,7 +4822,6 @@ void wxGrid::ProcessGridCellMouseEvent(wxMouseEvent& event, wxGridWindow *eventG
|
||||
m_winCapture->CaptureMouse();
|
||||
|
||||
m_isDragging = true;
|
||||
m_selection->StartSelecting();
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user