- wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
- wxEVT_GRID_RANGE_SELECT,
- m_grid,
- wxGridCellCoords( row, col ),
- wxGridCellCoords( row, col ),
- false,
- ControlDown, ShiftDown,
- AltDown, MetaDown );
- m_grid->GetEventHandler()->ProcessEvent(gridEvt);
- break;
- }
- case wxGrid::wxGridSelectRows:
- {
- if ( !m_grid->GetBatchCount() )
- {
- r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ),
- wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) );
- ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
- }
+ wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
+ wxEVT_GRID_RANGE_SELECT,
+ m_grid,
+ wxGridCellCoords( row, col ),
+ wxGridCellCoords( row, col ),
+ false,
+ kbd );
+ m_grid->GetEventHandler()->ProcessEvent( gridEvt );
+ }
+ else // rows/columns selection mode
+ {
+ if ( m_selectionMode != wxGrid::wxGridSelectColumns &&
+ rowSelectionWasChanged )
+ {
+ int numCols = m_grid->GetNumberCols();
+ for ( int colFrom = 0, colTo = 0; colTo <= numCols; ++colTo )
+ {
+ if ( m_colSelection.Index(colTo) >= 0 || colTo == numCols )
+ {
+ if ( colFrom < colTo )
+ {
+ if ( !m_grid->GetBatchCount() )
+ {
+ r = m_grid->BlockToDeviceRect(
+ wxGridCellCoords( row, colFrom ),
+ wxGridCellCoords( row, colTo-1 ) );
+ ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
+ }
+
+ wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
+ wxEVT_GRID_RANGE_SELECT,
+ m_grid,
+ wxGridCellCoords( row, colFrom ),
+ wxGridCellCoords( row, colTo - 1 ),
+ false,
+ kbd );
+ m_grid->GetEventHandler()->ProcessEvent( gridEvt );
+ }