- Main change is the addition of wxGridSelectRowsOrColumns selection mode

(which is still probably buggy, wxGridSelection needs to be reviewed)
- Add XYToCell() overloads returning wxGridCellCoords (instead of modifying the
  argument passed by reference -- where did this come from?) and document them.
- Added GoToCell() which does make the new current cell visible unlike
  SetGridCursor() (which was documented as doing it, but wasn't)
- Changed SetCurrentCell() to only not change the cell if wxEVT_GRID_SELECT_CELL
  it generates is vetoed, not just processed as this seems to make more sense
- Split jumbo (~400 lines) ProcessGridCellMouseEvent() function into chunks
- Add many more comments to make reading this code seem less like puzzle
  solving for the next unfortunate soul to do it


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-19 23:33:04 +00:00
parent 0e0977894a
commit 8a3e536cd5
8 changed files with 717 additions and 502 deletions

View File

@@ -385,15 +385,30 @@ void wxGridSelection::SelectBlock( int topRow, int leftCol,
bool sendEvent )
{
// Fix the coordinates of the block if needed.
if ( m_selectionMode == wxGrid::wxGridSelectRows )
switch ( m_selectionMode )
{
leftCol = 0;
rightCol = m_grid->GetNumberCols() - 1;
}
else if ( m_selectionMode == wxGrid::wxGridSelectColumns )
{
topRow = 0;
bottomRow = m_grid->GetNumberRows() - 1;
default:
wxFAIL_MSG( "unknown selection mode" );
// fall through
case wxGrid::wxGridSelectCells:
// nothing to do -- in this mode arbitrary blocks can be selected
break;
case wxGrid::wxGridSelectRows:
leftCol = 0;
rightCol = m_grid->GetNumberCols() - 1;
break;
case wxGrid::wxGridSelectColumns:
topRow = 0;
bottomRow = m_grid->GetNumberRows() - 1;
break;
case wxGrid::wxGridSelectRowsOrColumns:
// block selection doesn't make sense for this mode, we could only
// select the entire grid but this wouldn't be useful
return;
}
if ( topRow > bottomRow )