Bugfixes; added selection modes demo to griddemo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2000-03-04 19:56:39 +00:00
parent a56fcaaf46
commit 043d16b225
5 changed files with 63 additions and 19 deletions

View File

@@ -147,9 +147,10 @@ void wxGridSelection::SetSelectionMode(wxGrid::wxGridSelectionModes selmode)
else // selmode == wxGridSelectColumns)
SelectCol( col );
}
while( ( n = m_blockSelectionTopLeft.GetCount() ) > 0)
for (n = 0; n < m_blockSelectionTopLeft.GetCount(); n++)
// Note that m_blockSelectionTopLeft's size may be changing!
{
n--;
wxGridCellCoords& coords = m_blockSelectionTopLeft[n];
int topRow = coords.GetRow();
int leftCol = coords.GetCol();
@@ -177,6 +178,7 @@ void wxGridSelection::SetSelectionMode(wxGrid::wxGridSelectionModes selmode)
}
}
}
m_selectionMode = selmode;
}
}
@@ -457,9 +459,15 @@ void wxGridSelection::SelectBlock( int topRow, int leftCol, int bottomRow, int r
void wxGridSelection::SelectCell( int row, int col)
{
if ( m_selectionMode == wxGrid::wxGridSelectRows )
{
SelectBlock(row, 0, row, m_grid->GetNumberCols() - 1 );
return;
}
else if ( m_selectionMode == wxGrid::wxGridSelectColumns )
{
SelectBlock(0, col, m_grid->GetNumberRows() - 1, col );
return;
}
else if ( IsInSelection ( row, col ) )
return;
m_cellSelection.Add( wxGridCellCoords( row, col ) );