Send SELECTING events while selecting rows/columns too
Generalize the changes of 415f080c80
(Split wxGrid RANGE_SELECT event
into SELECTING and SELECTED, 2020-07-27) to the case when the mouse is
dragged over row or column headers: also send SELECTING events while
dragging and a SELECTED event at the end, whether it's due to releasing
the mouse button or losing mouse capture.
This commit is contained in:
@@ -3678,7 +3678,8 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event, wxGridRowLabelWindo
|
||||
m_selection->ExtendCurrentBlock(
|
||||
wxGridCellCoords(m_currentCellCoords.GetRow(), 0),
|
||||
wxGridCellCoords(row, GetNumberCols() - 1),
|
||||
event);
|
||||
event,
|
||||
wxEVT_GRID_RANGE_SELECTING);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3695,9 +3696,6 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event, wxGridRowLabelWindo
|
||||
if ( m_isDragging && (event.Entering() || event.Leaving()) )
|
||||
return;
|
||||
|
||||
if (m_isDragging)
|
||||
m_isDragging = false;
|
||||
|
||||
// ------------ Entering or leaving the window
|
||||
//
|
||||
if ( event.Entering() || event.Leaving() )
|
||||
@@ -3811,6 +3809,7 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event, wxGridRowLabelWindo
|
||||
|
||||
ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, rowLabelWin);
|
||||
m_dragLastPos = -1;
|
||||
m_isDragging = false;
|
||||
}
|
||||
|
||||
// ------------ Right button down
|
||||
@@ -4021,7 +4020,8 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event, wxGridColLabelWindo
|
||||
m_selection->ExtendCurrentBlock(
|
||||
wxGridCellCoords(0, m_currentCellCoords.GetCol()),
|
||||
wxGridCellCoords(GetNumberRows() - 1, col),
|
||||
event);
|
||||
event,
|
||||
wxEVT_GRID_RANGE_SELECTING);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -4092,9 +4092,6 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event, wxGridColLabelWindo
|
||||
if ( m_isDragging && (event.Entering() || event.Leaving()) )
|
||||
return;
|
||||
|
||||
if (m_isDragging)
|
||||
m_isDragging = false;
|
||||
|
||||
// ------------ Entering or leaving the window
|
||||
//
|
||||
if ( event.Entering() || event.Leaving() )
|
||||
@@ -4264,6 +4261,7 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event, wxGridColLabelWindo
|
||||
|
||||
ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, GetColLabelWindow());
|
||||
m_dragLastPos = -1;
|
||||
m_isDragging = false;
|
||||
}
|
||||
|
||||
// ------------ Right button down
|
||||
|
Reference in New Issue
Block a user