- case wxGrid::wxGridSelectCells:
- r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, col ),
- wxGridCellCoords( row, col ) );
- break;
- case wxGrid::wxGridSelectRows:
- r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ),
- wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) );
- break;
- case wxGrid::wxGridSelectColumns:
- r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ),
- wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) );
- break;
+ case wxGrid::wxGridSelectCells:
+ {
+ if ( !m_grid->GetBatchCount() )
+ {
+ r = m_grid->BlockToDeviceRect(
+ wxGridCellCoords( row, col ),
+ wxGridCellCoords( row, col ) );
+ ((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 );
+ }
+ 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, 0 ),
+ wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ),
+ false,
+ kbd );
+ m_grid->GetEventHandler()->ProcessEvent( gridEvt );
+ }
+ break;
+
+ case wxGrid::wxGridSelectColumns:
+ {
+ if ( !m_grid->GetBatchCount() )
+ {
+ r = m_grid->BlockToDeviceRect(
+ wxGridCellCoords( 0, col ),
+ wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) );
+ ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
+ }
+
+ wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
+ wxEVT_GRID_RANGE_SELECT,
+ m_grid,
+ wxGridCellCoords( 0, col ),
+ wxGridCellCoords( m_grid->GetNumberRows() - 1, col ),
+ false,
+ kbd );
+ m_grid->GetEventHandler()->ProcessEvent( gridEvt );
+ }
+ break;
+
+ default:
+ break;