- // If a block containing the selection is already selected, return,
- // if a block contained in the selection is found, remove it.
+ // add the newly selected rows:
+ for ( int row = topRow; row <= bottomRow; row++ )
+ {
+ if ( alreadyselected[ row - topRow ] == 0 )
+ {
+ m_rowSelection.Add( row );
+ }
+ }
+ }
+ else if ( m_selectionMode == wxGrid::wxGridSelectColumns )
+ {
+ // find out which columns are already selected:
+ wxArrayInt alreadyselected;
+ alreadyselected.Add(0,rightCol-leftCol+1);
+ for( n = 0; n < m_colSelection.GetCount(); n++)
+ {
+ int col = m_colSelection[n];
+ if( (col >= leftCol) && (col <= rightCol) )
+ {
+ alreadyselected[ col - leftCol ]=1;
+ }
+ }