Added Auto-size cols option to the View menu

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Michael Bedward
2000-05-16 03:25:16 +00:00
parent 015e85cdf7
commit 5b0d059b3e
2 changed files with 11 additions and 1 deletions

View File

@@ -72,6 +72,7 @@ BEGIN_EVENT_TABLE( GridFrame, wxFrame )
EVT_MENU( ID_TOGGLECOLSIZING, GridFrame::ToggleColSizing )
EVT_MENU( ID_TOGGLEGRIDSIZING, GridFrame::ToggleGridSizing )
EVT_MENU( ID_TOGGLEGRIDLINES, GridFrame::ToggleGridLines )
EVT_MENU( ID_AUTOSIZECOLS, GridFrame::AutoSizeCols )
EVT_MENU( ID_SETLABELCOLOUR, GridFrame::SetLabelColour )
EVT_MENU( ID_SETLABELTEXTCOLOUR, GridFrame::SetLabelTextColour )
EVT_MENU( ID_ROWLABELHORIZALIGN, GridFrame::SetRowLabelHorizAlignment )
@@ -131,7 +132,7 @@ GridFrame::GridFrame()
viewMenu->Append( ID_TOGGLECOLSIZING, "C&ol drag-resize", "", TRUE );
viewMenu->Append( ID_TOGGLEGRIDSIZING, "&Grid drag-resize", "", TRUE );
viewMenu->Append( ID_TOGGLEGRIDLINES, "&Grid Lines", "", TRUE );
viewMenu->Append( ID_AUTOSIZECOLS, "&Auto-size cols" );
wxMenu *rowLabelMenu = new wxMenu;
@@ -355,6 +356,13 @@ void GridFrame::ToggleGridLines( wxCommandEvent& WXUNUSED(ev) )
}
void GridFrame::AutoSizeCols( wxCommandEvent& WXUNUSED(ev) )
{
grid->AutoSizeColumns();
grid->Refresh();
}
void GridFrame::SetLabelColour( wxCommandEvent& WXUNUSED(ev) )
{
wxColourDialog dlg( NULL );