- 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

@@ -92,6 +92,7 @@ BEGIN_EVENT_TABLE( GridFrame, wxFrame )
EVT_MENU( ID_SELCELLS, GridFrame::SelectCells )
EVT_MENU( ID_SELROWS, GridFrame::SelectRows )
EVT_MENU( ID_SELCOLS, GridFrame::SelectCols )
EVT_MENU( ID_SELROWSORCOLS, GridFrame::SelectRowsOrCols )
EVT_MENU( ID_SET_CELL_FG_COLOUR, GridFrame::SetCellFgColour )
EVT_MENU( ID_SET_CELL_BG_COLOUR, GridFrame::SetCellBgColour )
@@ -223,9 +224,10 @@ GridFrame::GridFrame()
selectionMenu,
_T("Change selection mode") );
selectionMenu->Append( ID_SELCELLS, _T("Select &Cells") );
selectionMenu->Append( ID_SELROWS, _T("Select &Rows") );
selectionMenu->Append( ID_SELCOLS, _T("Select C&ols") );
selectionMenu->Append( ID_SELCELLS, _T("Select &cells") );
selectionMenu->Append( ID_SELROWS, _T("Select &rows") );
selectionMenu->Append( ID_SELCOLS, _T("Select col&umns") );
selectionMenu->Append( ID_SELROWSORCOLS, _T("Select rows &or columns") );
wxMenu *autosizeMenu = new wxMenu;
autosizeMenu->Append( ID_SIZE_ROW, _T("Selected &row data") );
@@ -807,6 +809,11 @@ void GridFrame::SelectCols( wxCommandEvent& WXUNUSED(ev) )
grid->SetSelectionMode( wxGrid::wxGridSelectColumns );
}
void GridFrame::SelectRowsOrCols( wxCommandEvent& WXUNUSED(ev) )
{
grid->SetSelectionMode( wxGrid::wxGridSelectRowsOrColumns );
}
void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) )
{
wxColour col = wxGetColourFromUser(this);

View File

@@ -64,6 +64,7 @@ class GridFrame : public wxFrame
void SelectCells( wxCommandEvent& );
void SelectRows( wxCommandEvent& );
void SelectCols( wxCommandEvent& );
void SelectRowsOrCols( wxCommandEvent& );
void DeselectCell(wxCommandEvent& event);
void DeselectCol(wxCommandEvent& event);
@@ -144,6 +145,7 @@ public:
ID_SELCELLS,
ID_SELROWS,
ID_SELCOLS,
ID_SELROWSORCOLS,
ID_SET_CELL_FG_COLOUR,
ID_SET_CELL_BG_COLOUR,
ID_VTABLE,