added SetLabelFont() test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-01-21 18:11:15 +00:00
parent bf31fa26c7
commit bf9adb3a20
2 changed files with 20 additions and 8 deletions

View File

@ -29,11 +29,11 @@
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#include "wx/wx.h"
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
#endif
#include "wx/colordlg.h"
#include "wx/grid.h"
#include "wx/generic/gridctrl.h"
@ -76,6 +76,7 @@ BEGIN_EVENT_TABLE( GridFrame, wxFrame )
EVT_MENU( ID_AUTOSIZECOLS, GridFrame::AutoSizeCols )
EVT_MENU( ID_SETLABELCOLOUR, GridFrame::SetLabelColour )
EVT_MENU( ID_SETLABELTEXTCOLOUR, GridFrame::SetLabelTextColour )
EVT_MENU( ID_SETLABEL_FONT, GridFrame::SetLabelFont )
EVT_MENU( ID_ROWLABELHORIZALIGN, GridFrame::SetRowLabelHorizAlignment )
EVT_MENU( ID_ROWLABELVERTALIGN, GridFrame::SetRowLabelVertAlignment )
EVT_MENU( ID_COLLABELHORIZALIGN, GridFrame::SetColLabelHorizAlignment )
@ -169,11 +170,12 @@ GridFrame::GridFrame()
colLabelMenu->Append( ID_COLLABELVERTALIGN, "&Vertical" );
wxMenu *colMenu = new wxMenu;
colMenu->Append( ID_SETLABELCOLOUR, "Set &label colour" );
colMenu->Append( ID_SETLABELTEXTCOLOUR, "Set label &text colour" );
colMenu->Append( ID_GRIDLINECOLOUR, "&Grid line colour" );
colMenu->Append( ID_SET_CELL_FG_COLOUR, "Set cell &foreground colour" );
colMenu->Append( ID_SET_CELL_BG_COLOUR, "Set cell &background colour" );
colMenu->Append( ID_SETLABELCOLOUR, "Set &label colour..." );
colMenu->Append( ID_SETLABELTEXTCOLOUR, "Set label &text colour..." );
colMenu->Append( ID_SETLABEL_FONT, "Set label fo&nt..." );
colMenu->Append( ID_GRIDLINECOLOUR, "&Grid line colour..." );
colMenu->Append( ID_SET_CELL_FG_COLOUR, "Set cell &foreground colour..." );
colMenu->Append( ID_SET_CELL_BG_COLOUR, "Set cell &background colour..." );
wxMenu *editMenu = new wxMenu;
editMenu->Append( ID_INSERTROW, "Insert &row" );
@ -459,6 +461,14 @@ void GridFrame::SetLabelTextColour( wxCommandEvent& WXUNUSED(ev) )
}
}
void GridFrame::SetLabelFont( wxCommandEvent& WXUNUSED(ev) )
{
wxFont font = wxGetFontFromUser(this);
if ( font.Ok() )
{
grid->SetLabelFont(font);
}
}
void GridFrame::SetRowLabelHorizAlignment( wxCommandEvent& WXUNUSED(ev) )
{

View File

@ -44,6 +44,7 @@ class GridFrame : public wxFrame
void AutoSizeCols( wxCommandEvent& );
void SetLabelColour( wxCommandEvent& );
void SetLabelTextColour( wxCommandEvent& );
void SetLabelFont(wxCommandEvent &);
void SetRowLabelHorizAlignment( wxCommandEvent& );
void SetRowLabelVertAlignment( wxCommandEvent& );
void SetColLabelHorizAlignment( wxCommandEvent& );
@ -107,6 +108,7 @@ public:
ID_AUTOSIZECOLS,
ID_SETLABELCOLOUR,
ID_SETLABELTEXTCOLOUR,
ID_SETLABEL_FONT,
ID_ROWLABELALIGN,
ID_ROWLABELHORIZALIGN,
ID_ROWLABELVERTALIGN,