added ability to disable gridlines in the sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-05-04 19:09:30 +00:00
parent fa3a64d1ad
commit 36ce8f44db
2 changed files with 13 additions and 0 deletions

View File

@@ -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 );

View File

@@ -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,