diff --git a/samples/newgrid/griddemo.cpp b/samples/newgrid/griddemo.cpp index 6384a4ab41..660bca93b4 100644 --- a/samples/newgrid/griddemo.cpp +++ b/samples/newgrid/griddemo.cpp @@ -71,6 +71,7 @@ BEGIN_EVENT_TABLE( GridFrame, wxFrame ) EVT_MENU( ID_TOGGLEROWSIZING, GridFrame::ToggleRowSizing ) EVT_MENU( ID_TOGGLECOLSIZING, GridFrame::ToggleColSizing ) EVT_MENU( ID_TOGGLEGRIDSIZING, GridFrame::ToggleGridSizing ) + EVT_MENU( ID_TOGGLEGRIDLINES, GridFrame::ToggleGridLines ) EVT_MENU( ID_SETLABELCOLOUR, GridFrame::SetLabelColour ) EVT_MENU( ID_SETLABELTEXTCOLOUR, GridFrame::SetLabelTextColour ) EVT_MENU( ID_ROWLABELHORIZALIGN, GridFrame::SetRowLabelHorizAlignment ) @@ -129,6 +130,8 @@ GridFrame::GridFrame() viewMenu->Append( ID_TOGGLEROWSIZING, "Ro&w drag-resize", "", TRUE ); viewMenu->Append( ID_TOGGLECOLSIZING, "C&ol drag-resize", "", TRUE ); viewMenu->Append( ID_TOGGLEGRIDSIZING, "&Grid drag-resize", "", TRUE ); + viewMenu->Append( ID_TOGGLEGRIDLINES, "&Grid Lines", "", TRUE ); + wxMenu *rowLabelMenu = new wxMenu; @@ -288,6 +291,7 @@ void GridFrame::SetDefaults() GetMenuBar()->Check( ID_TOGGLEROWSIZING, TRUE ); GetMenuBar()->Check( ID_TOGGLECOLSIZING, TRUE ); GetMenuBar()->Check( ID_TOGGLEGRIDSIZING, TRUE ); + GetMenuBar()->Check( ID_TOGGLEGRIDLINES, TRUE ); } @@ -344,6 +348,13 @@ void GridFrame::ToggleGridSizing( wxCommandEvent& WXUNUSED(ev) ) } +void GridFrame::ToggleGridLines( wxCommandEvent& WXUNUSED(ev) ) +{ + grid->EnableGridLines( + GetMenuBar()->IsChecked( ID_TOGGLEGRIDLINES ) ); +} + + void GridFrame::SetLabelColour( wxCommandEvent& WXUNUSED(ev) ) { wxColourDialog dlg( NULL ); diff --git a/samples/newgrid/griddemo.h b/samples/newgrid/griddemo.h index 5140bfbbb4..ca9a53294c 100644 --- a/samples/newgrid/griddemo.h +++ b/samples/newgrid/griddemo.h @@ -40,6 +40,7 @@ class GridFrame : public wxFrame void ToggleRowSizing( wxCommandEvent& ); void ToggleColSizing( wxCommandEvent& ); void ToggleGridSizing( wxCommandEvent& ); + void ToggleGridLines( wxCommandEvent& ); void SetLabelColour( wxCommandEvent& ); void SetLabelTextColour( wxCommandEvent& ); void SetRowLabelHorizAlignment( wxCommandEvent& ); @@ -88,6 +89,7 @@ public: ID_TOGGLEROWSIZING, ID_TOGGLECOLSIZING, ID_TOGGLEGRIDSIZING, + ID_TOGGLEGRIDLINES, ID_SETLABELCOLOUR, ID_SETLABELTEXTCOLOUR, ID_ROWLABELALIGN,