From: Vadim Zeitlin Date: Tue, 19 Mar 2002 15:01:44 +0000 (+0000) Subject: show the standard wxWin fonts (modified patch 530698) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/818503a1826c8d32340234318afe6de35f756c2f show the standard wxWin fonts (modified patch 530698) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/font/font.cpp b/samples/font/font.cpp index b46a5d2ffb..6c9dff7a50 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -17,7 +17,7 @@ #endif // for all others, include the necessary headers (this file is usually all you -// need because it includes almost all Append(Font_Italic, "&Oblique\tCtrl-O", "Toggle italic state", TRUE); menuFont->Append(Font_Underlined, "&Underlined\tCtrl-U", "Toggle underlined state", TRUE); + menuFont->AppendSeparator(); menuFont->Append(Font_CheckNativeToFromString, "Check Native Font Info To/From String"); @@ -240,6 +254,14 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) wxMenu *menuSelect = new wxMenu; menuSelect->Append(Font_Choose, "&Select font...\tCtrl-S", "Select a standard font"); + + wxMenu *menuStdFonts = new wxMenu; + menuStdFonts->Append(Font_wxNORMAL_FONT, "wxNORMAL_FONT", "Normal font used by wxWindows"); + menuStdFonts->Append(Font_wxSMALL_FONT, "wxSMALL_FONT", "Small font used by wxWindows"); + menuStdFonts->Append(Font_wxITALIC_FONT, "wxITALIC_FONT", "Italic font used by wxWindows"); + menuStdFonts->Append(Font_wxSWISS_FONT, "wxSWISS_FONT", "Swiss font used by wxWindows"); + menuSelect->Append(-2, "Standar&d fonts", menuStdFonts); + menuSelect->AppendSeparator(); menuSelect->Append(Font_EnumFamilies, "Enumerate font &families\tCtrl-F"); menuSelect->Append(Font_EnumFixedFamilies, @@ -484,6 +506,26 @@ void MyFrame::OnUnderline(wxCommandEvent& event) DoChangeFont(font); } +void MyFrame::OnwxPointerFont(wxCommandEvent& event) +{ + wxFont font; + + switch (event.GetId()) + { + case Font_wxNORMAL_FONT : font = wxFont(*wxNORMAL_FONT); break; + case Font_wxSMALL_FONT : font = wxFont(*wxSMALL_FONT); break; + case Font_wxITALIC_FONT : font = wxFont(*wxITALIC_FONT); break; + case Font_wxSWISS_FONT : font = wxFont(*wxSWISS_FONT); break; + default : font = wxFont(*wxNORMAL_FONT); break; + } + + GetMenuBar()->Check(Font_Bold, FALSE); + GetMenuBar()->Check(Font_Italic, FALSE); + GetMenuBar()->Check(Font_Underlined, FALSE); + + DoChangeFont(font); +} + void MyFrame::DoChangeFont(const wxFont& font, const wxColour& col) { m_canvas->SetTextFont(font);