EVT_MENU( ID_VTABLE, GridFrame::OnVTable)
EVT_MENU( ID_BUGS_TABLE, GridFrame::OnBugsTable)
+ EVT_MENU( ID_DESELECT_CELL, GridFrame::DeselectCell)
+ EVT_MENU( ID_DESELECT_COL, GridFrame::DeselectCol)
+ EVT_MENU( ID_DESELECT_ROW, GridFrame::DeselectRow)
+ EVT_MENU( ID_DESELECT_ALL, GridFrame::DeselectAll)
+ EVT_MENU( ID_SELECT_CELL, GridFrame::SelectCell)
+ EVT_MENU( ID_SELECT_COL, GridFrame::SelectCol)
+ EVT_MENU( ID_SELECT_ROW, GridFrame::SelectRow)
+ EVT_MENU( ID_SELECT_ALL, GridFrame::SelectAll)
+
EVT_GRID_LABEL_LEFT_CLICK( GridFrame::OnLabelLeftClick )
EVT_GRID_CELL_LEFT_CLICK( GridFrame::OnCellLeftClick )
EVT_GRID_ROW_SIZE( GridFrame::OnRowSize )
editMenu->Append( ID_DELETECOL, "Delete selected co&ls" );
editMenu->Append( ID_CLEARGRID, "Cl&ear grid cell contents" );
+ wxMenu *selectMenu = new wxMenu;
+ selectMenu->Append( ID_SELECT_ALL, "Select all");
+ selectMenu->Append( ID_SELECT_ROW, "Select row 2");
+ selectMenu->Append( ID_SELECT_COL, "Select col 2");
+ selectMenu->Append( ID_SELECT_CELL, "Select cell (3, 1)");
+ selectMenu->Append( ID_DESELECT_ALL, "Deselect all");
+ selectMenu->Append( ID_DESELECT_ROW, "Deselect row 2");
+ selectMenu->Append( ID_DESELECT_COL, "Deselect col 2");
+ selectMenu->Append( ID_DESELECT_CELL, "Deselect cell (3, 1)");
wxMenu *selectionMenu = new wxMenu;
-
- editMenu->Append( ID_CHANGESEL, "Change &selection mode",
+ selectMenu->Append( ID_CHANGESEL, "Change &selection mode",
selectionMenu,
"Change selection mode" );
selectionMenu->Append( ID_SELROWS, "Select &Rows" );
selectionMenu->Append( ID_SELCOLS, "Select C&ols" );
+
wxMenu *helpMenu = new wxMenu;
helpMenu->Append( ID_ABOUT, "&About wxGrid demo" );
menuBar->Append( viewMenu, "&View" );
menuBar->Append( colMenu, "&Colours" );
menuBar->Append( editMenu, "&Edit" );
+ menuBar->Append( selectMenu, "&Select" );
menuBar->Append( helpMenu, "&Help" );
SetMenuBar( menuBar );
}
}
+void GridFrame::DeselectCell(wxCommandEvent& WXUNUSED(event))
+{
+ grid->DeselectCell(3, 1);
+}
+
+void GridFrame::DeselectCol(wxCommandEvent& WXUNUSED(event))
+{
+ grid->DeselectCol(2);
+}
+
+void GridFrame::DeselectRow(wxCommandEvent& WXUNUSED(event))
+{
+ grid->DeselectRow(2);
+}
+
+void GridFrame::DeselectAll(wxCommandEvent& WXUNUSED(event))
+{
+ grid->ClearSelection();
+}
+
+void GridFrame::SelectCell(wxCommandEvent& WXUNUSED(event))
+{
+ grid->SelectBlock(3, 1, 3, 1);
+}
+
+void GridFrame::SelectCol(wxCommandEvent& WXUNUSED(event))
+{
+ grid->SelectCol(2, TRUE);
+}
+
+void GridFrame::SelectRow(wxCommandEvent& WXUNUSED(event))
+{
+ grid->SelectRow(2, TRUE);
+}
+
+void GridFrame::SelectAll(wxCommandEvent& WXUNUSED(event))
+{
+ grid->SelectAll();
+}
+
void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
{
logBuf = "";
void SelectRows( wxCommandEvent& );
void SelectCols( wxCommandEvent& );
+ void DeselectCell(wxCommandEvent& event);
+ void DeselectCol(wxCommandEvent& event);
+ void DeselectRow(wxCommandEvent& event);
+ void DeselectAll(wxCommandEvent& event);
+ void SelectCell(wxCommandEvent& event);
+ void SelectCol(wxCommandEvent& event);
+ void SelectRow(wxCommandEvent& event);
+ void SelectAll(wxCommandEvent& event);
+
void OnLabelLeftClick( wxGridEvent& );
void OnCellLeftClick( wxGridEvent& );
void OnRowSize( wxGridSizeEvent& );
ID_ABOUT,
ID_VTABLE,
ID_BUGS_TABLE,
+ ID_SELECT_ALL,
+ ID_SELECT_ROW,
+ ID_SELECT_COL,
+ ID_SELECT_CELL,
+ ID_DESELECT_ALL,
+ ID_DESELECT_ROW,
+ ID_DESELECT_COL,
+ ID_DESELECT_CELL,
ID_TESTFUNC
};