#include "wx/datetime.h"
#include "wx/numdlg.h"
+#include "wx/fontdlg.h"
#ifndef __WXMSW__
#include "../sample.xpm"
void OnResetFieldsWidth(wxCommandEvent& event);
void OnSetStatusFields(wxCommandEvent& event);
void OnSetStatusTexts(wxCommandEvent& event);
+ void OnSetStatusFont(wxCommandEvent& event);
void OnRecreateStatusBar(wxCommandEvent& event);
void OnSetStyleNormal(wxCommandEvent& event);
void OnSetStyleFlat(wxCommandEvent& event);
StatusBar_SetFields,
StatusBar_SetTexts,
+ StatusBar_SetFont,
StatusBar_ResetFieldsWidth,
StatusBar_Recreate,
EVT_MENU(StatusBar_Quit, MyFrame::OnQuit)
EVT_MENU(StatusBar_SetFields, MyFrame::OnSetStatusFields)
EVT_MENU(StatusBar_SetTexts, MyFrame::OnSetStatusTexts)
+ EVT_MENU(StatusBar_SetFont, MyFrame::OnSetStatusFont)
EVT_MENU(StatusBar_ResetFieldsWidth, MyFrame::OnResetFieldsWidth)
EVT_MENU(StatusBar_Recreate, MyFrame::OnRecreateStatusBar)
EVT_MENU(StatusBar_About, MyFrame::OnAbout)
_T("Set the number of status bar fields"));
statbarMenu->Append(StatusBar_SetTexts, _T("&Set field text\tCtrl-T"),
_T("Set the text to display for each status bar field"));
+ statbarMenu->Append(StatusBar_SetFont, _T("&Set field font\tCtrl-F"),
+ _T("Set the font to use for rendering status bar fields"));
wxMenu *statbarStyleMenu = new wxMenu;
statbarStyleMenu->Append(StatusBar_SetStyleNormal, _T("&Normal"), _T("Sets the style of the first field to normal (sunken) look"), true);
}
}
+void MyFrame::OnSetStatusFont(wxCommandEvent& WXUNUSED(event))
+{
+ wxStatusBar *sb = GetStatusBar();
+
+ wxFont fnt = wxGetFontFromUser(this, sb->GetFont(), "Choose statusbar font");
+ if (fnt.IsOk())
+ {
+ sb->SetFont(fnt);
+ sb->SetSize(sb->GetBestSize());
+ }
+}
+
void MyFrame::OnSetStatusFields(wxCommandEvent& WXUNUSED(event))
{
wxStatusBar *sb = GetStatusBar();