+
+ for (n = 0; n < m_blockSelectionTopLeft.GetCount(); n++)
+ // Note that m_blockSelectionTopLeft's size may be changing!
+ {
+ wxGridCellCoords& coords = m_blockSelectionTopLeft[n];
+ int topRow = coords.GetRow();
+ int leftCol = coords.GetCol();
+ coords = m_blockSelectionBottomRight[n];
+ int bottomRow = coords.GetRow();
+ int rightCol = coords.GetCol();
+ if (selmode == wxGrid::wxGridSelectRows)
+ {
+ if (leftCol != 0 || rightCol != m_grid->GetNumberCols() - 1 )
+ {
+ m_blockSelectionTopLeft.RemoveAt(n);
+ m_blockSelectionBottomRight.RemoveAt(n);
+ SelectBlock( topRow, 0,
+ bottomRow, m_grid->GetNumberCols() - 1,
+ FALSE, FALSE, FALSE, FALSE, FALSE );
+ }
+ }
+ else // selmode == wxGridSelectColumns)
+ {
+ if (topRow != 0 || bottomRow != m_grid->GetNumberRows() - 1 )
+ {
+ m_blockSelectionTopLeft.RemoveAt(n);
+ m_blockSelectionBottomRight.RemoveAt(n);
+ SelectBlock( 0, leftCol,
+ m_grid->GetNumberRows() - 1, rightCol,
+ FALSE, FALSE, FALSE, FALSE, FALSE );
+ }
+ }
+ }
+ m_selectionMode = selmode;