xCHM  1.23
chmfontdialog.h
1 /*
2 
3  Copyright (C) 2003 - 2013 Razvan Cojocaru <rzvncj@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  MA 02110-1301, USA.
19 
20 */
21 
22 
23 #ifndef __CHMFONTDIALOG_H
24 #define __CHMFONTDIALOG_H
25 
26 
27 #include <wx/html/htmlwin.h>
28 #include <wx/spinctrl.h>
29 #include <wx/dialog.h>
30 #include <wx/combobox.h>
31 
32 
39 class CHMFontDialog : public wxDialog
41 {
42 public:
54  CHMFontDialog(wxWindow *parent, wxArrayString *normalFonts,
55  wxArrayString *fixedFonts, const wxString& normalFont,
56  const wxString& fixedFont, const int fontSize);
57 
59  const wxString& FixedFont() const { return _fixedFont; }
60 
62  const wxString& NormalFont() const { return _normalFont; }
63 
65  int* Sizes() { return _sizes; }
66 
67 protected:
69  void OnUpdate(wxCommandEvent& event);
70 
72  void OnUpdateSpin(wxSpinEvent& event);
73 
74 private:
76  void UpdatePreview();
77 
79  void InitDialog(wxArrayString *normalFonts, wxArrayString *fixedFonts);
80 
81 private:
82  wxHtmlWindow *_test;
83  wxSpinCtrl *_fontSizeControl;
84  wxComboBox *_normalFControl;
85  wxComboBox *_fixedFControl;
86 
87  wxString _normalFont;
88  wxString _fixedFont;
89  int _sizes[7];
90  int _fontSize;
91 
92 private:
93  DECLARE_EVENT_TABLE();
94 };
95 
96 
97 #endif // __CHMFONTDIALOG_H
98 
99 
100 /*
101  Local Variables:
102  mode: c++
103  c-basic-offset: 8
104  tab-width: 8
105  c-indent-comments-syntactically-p: t
106  c-tab-always-indent: t
107  indent-tabs-mode: t
108  End:
109 */
110 
111 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
112 
wxWidgets HTML widget class.
Definition: chmhtmlwindow.h:49
wxWidgets generic dialog class.
void InitDialog(wxArrayString *normalFonts, wxArrayString *fixedFonts)
Helper. Initializes the dialog with the passed data.
Definition: chmfontdialog.cpp:138
Custom font chooser dialog class.
Definition: chmfontdialog.h:40
void OnUpdate(wxCommandEvent &event)
This is called when a font is selected from the combo box.
Definition: chmfontdialog.cpp:126
const wxString & FixedFont() const
Returns the fixed font face name.
Definition: chmfontdialog.h:59
void UpdatePreview()
Helper. Updates the font preview window.
Definition: chmfontdialog.cpp:105
CHMFontDialog(wxWindow *parent, wxArrayString *normalFonts, wxArrayString *fixedFonts, const wxString &normalFont, const wxString &fixedFont, const int fontSize)
Constructs a CHMFontDialog.
Definition: chmfontdialog.cpp:49
int * Sizes()
Return the selected font size.
Definition: chmfontdialog.h:65
void OnUpdateSpin(wxSpinEvent &event)
This is called when you click on the font size spin control.
Definition: chmfontdialog.cpp:132
const wxString & NormalFont() const
Returns the normal font face name.
Definition: chmfontdialog.h:62