📄 chmfontdialog.h
字号:
/* Copyright (C) 2003 Razvan Cojocaru <razvanco@gmx.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef __CHMFONTDIALOG_H#define __CHMFONTDIALOG_H#include <wx/html/htmlwin.h>#include <wx/spinctrl.h>#include <wx/dialog.h>#include <wx/combobox.h>/*! \class wxDialog \brief wxWidgets generic dialog class.*///! Custom font chooser dialog class.class CHMFontDialog : public wxDialog{public: /*! \brief Constructs a CHMFontDialog. \param parent The parent window. \param normalFonts Array of strings denoting all the normal font faces' names available on the system. Managed by the caller. \param fixedFonts Array of strings denoting all the fixes fonts faces' names available on the system. Managed by the caller. \param normalFont The normal font currently in use by the caller. \param fixedFont The fixed font currently in use by the caller. \param fontSize The size of the font currently selected. */ CHMFontDialog(wxWindow *parent, wxArrayString *normalFonts, wxArrayString *fixedFonts, const wxString& normalFont, const wxString& fixedFont, const int fontSize); //! Returns the fixed font face name. const wxString& FixedFont() const { return _fixedFont; } //! Returns the normal font face name. const wxString& NormalFont() const { return _normalFont; } //! Return the selected font size. int* Sizes() { return _sizes; }protected: //! This is called when a font is selected from the combo box. void OnUpdate(wxCommandEvent& event); //! This is called when you click on the font size spin control. void OnUpdateSpin(wxSpinEvent& event);private: //! Helper. Updates the font preview window. void UpdatePreview(); //! Helper. Initializes the dialog with the passed data. void InitDialog(wxArrayString *normalFonts, wxArrayString *fixedFonts); private: wxHtmlWindow *_test; wxSpinCtrl *_fontSizeControl; wxComboBox *_normalFControl; wxComboBox *_fixedFControl; wxString _normalFont; wxString _fixedFont; int _sizes[7]; int _fontSize;private: DECLARE_EVENT_TABLE();};#endif // __CHMFONTDIALOG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -