]>
Commit | Line | Data |
---|---|---|
97ff49b3 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/richtext/richtextfontpage.h |
97ff49b3 JS |
3 | // Purpose: Font page for wxRichTextFormattingDialog |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 2006-10-02 | |
97ff49b3 JS |
7 | // Copyright: (c) Julian Smart |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _RICHTEXTFONTPAGE_H_ | |
12 | #define _RICHTEXTFONTPAGE_H_ | |
13 | ||
14 | /*! | |
15 | * Includes | |
16 | */ | |
17 | ||
603f702b JS |
18 | #include "wx/richtext/richtextdialogpage.h" |
19 | ||
97ff49b3 | 20 | ////@begin includes |
32423dd8 | 21 | #include "wx/spinbutt.h" |
97ff49b3 JS |
22 | ////@end includes |
23 | ||
24 | /*! | |
25 | * Forward declarations | |
26 | */ | |
27 | ||
28 | ////@begin forward declarations | |
32423dd8 JS |
29 | class wxSpinButton; |
30 | class wxBoxSizer; | |
97ff49b3 JS |
31 | class wxRichTextFontListBox; |
32 | class wxRichTextColourSwatchCtrl; | |
33 | class wxRichTextFontPreviewCtrl; | |
34 | ////@end forward declarations | |
35 | ||
36 | /*! | |
37 | * Control identifiers | |
38 | */ | |
39 | ||
40 | ////@begin control identifiers | |
2fce6547 | 41 | #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL |
603f702b | 42 | #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxEmptyString |
97ff49b3 | 43 | #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE |
2fce6547 | 44 | #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100) |
97ff49b3 JS |
45 | #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition |
46 | ////@end control identifiers | |
47 | ||
48 | /*! | |
49 | * wxRichTextFontPage class declaration | |
50 | */ | |
51 | ||
603f702b | 52 | class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage: public wxRichTextDialogPage |
97ff49b3 JS |
53 | { |
54 | DECLARE_DYNAMIC_CLASS( wxRichTextFontPage ) | |
55 | DECLARE_EVENT_TABLE() | |
603f702b | 56 | DECLARE_HELP_PROVISION() |
97ff49b3 JS |
57 | |
58 | public: | |
59 | /// Constructors | |
60 | wxRichTextFontPage( ); | |
8871035d | 61 | wxRichTextFontPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTFONTPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTFONTPAGE_SIZE, long style = SYMBOL_WXRICHTEXTFONTPAGE_STYLE ); |
97ff49b3 JS |
62 | |
63 | /// Initialise members | |
64 | void Init(); | |
65 | ||
66 | /// Creation | |
8871035d | 67 | bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTFONTPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTFONTPAGE_SIZE, long style = SYMBOL_WXRICHTEXTFONTPAGE_STYLE ); |
97ff49b3 JS |
68 | |
69 | /// Creates the controls and sizers | |
70 | void CreateControls(); | |
71 | ||
72 | /// Transfer data from/to window | |
73 | virtual bool TransferDataFromWindow(); | |
74 | virtual bool TransferDataToWindow(); | |
75 | ||
76 | /// Updates the font preview | |
77 | void UpdatePreview(); | |
78 | ||
79 | void OnFaceListBoxSelected( wxCommandEvent& event ); | |
80 | void OnColourClicked( wxCommandEvent& event ); | |
81 | ||
82 | /// Gets the attributes associated with the main formatting dialog | |
24777478 | 83 | wxRichTextAttr* GetAttributes(); |
97ff49b3 JS |
84 | |
85 | ////@begin wxRichTextFontPage event handler declarations | |
86 | ||
32423dd8 JS |
87 | /// wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE |
88 | void OnIdle( wxIdleEvent& event ); | |
89 | ||
ce7fe42e | 90 | /// wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL |
97ff49b3 JS |
91 | void OnFaceTextCtrlUpdated( wxCommandEvent& event ); |
92 | ||
ce7fe42e | 93 | /// wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL |
97ff49b3 JS |
94 | void OnSizeTextCtrlUpdated( wxCommandEvent& event ); |
95 | ||
32423dd8 JS |
96 | /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS |
97 | void OnRichtextfontpageSpinbuttonsUp( wxSpinEvent& event ); | |
98 | ||
99 | /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS | |
100 | void OnRichtextfontpageSpinbuttonsDown( wxSpinEvent& event ); | |
101 | ||
ce7fe42e | 102 | /// wxEVT_CHOICE event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS |
32423dd8 JS |
103 | void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent& event ); |
104 | ||
ce7fe42e | 105 | /// wxEVT_LISTBOX event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX |
97ff49b3 JS |
106 | void OnSizeListBoxSelected( wxCommandEvent& event ); |
107 | ||
ce7fe42e | 108 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_STYLECTRL |
97ff49b3 JS |
109 | void OnStyleCtrlSelected( wxCommandEvent& event ); |
110 | ||
ce7fe42e | 111 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL |
97ff49b3 JS |
112 | void OnWeightCtrlSelected( wxCommandEvent& event ); |
113 | ||
ce7fe42e | 114 | /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL |
97ff49b3 JS |
115 | void OnUnderliningCtrlSelected( wxCommandEvent& event ); |
116 | ||
ce7fe42e | 117 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL |
42688aea JS |
118 | void OnStrikethroughctrlClick( wxCommandEvent& event ); |
119 | ||
ce7fe42e | 120 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL |
42688aea JS |
121 | void OnCapsctrlClick( wxCommandEvent& event ); |
122 | ||
ce7fe42e | 123 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT |
30bf7630 JS |
124 | void OnRichtextfontpageSuperscriptClick( wxCommandEvent& event ); |
125 | ||
ce7fe42e | 126 | /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT |
30bf7630 JS |
127 | void OnRichtextfontpageSubscriptClick( wxCommandEvent& event ); |
128 | ||
97ff49b3 JS |
129 | ////@end wxRichTextFontPage event handler declarations |
130 | ||
131 | ////@begin wxRichTextFontPage member function declarations | |
132 | ||
133 | /// Retrieves bitmap resources | |
134 | wxBitmap GetBitmapResource( const wxString& name ); | |
135 | ||
136 | /// Retrieves icon resources | |
137 | wxIcon GetIconResource( const wxString& name ); | |
138 | ////@end wxRichTextFontPage member function declarations | |
139 | ||
140 | /// Should we show tooltips? | |
141 | static bool ShowToolTips(); | |
142 | ||
143 | ////@begin wxRichTextFontPage member variables | |
144 | wxTextCtrl* m_faceTextCtrl; | |
97ff49b3 | 145 | wxTextCtrl* m_sizeTextCtrl; |
32423dd8 JS |
146 | wxSpinButton* m_fontSizeSpinButtons; |
147 | wxChoice* m_sizeUnitsCtrl; | |
148 | wxBoxSizer* m_fontListBoxParent; | |
149 | wxRichTextFontListBox* m_faceListBox; | |
97ff49b3 JS |
150 | wxListBox* m_sizeListBox; |
151 | wxComboBox* m_styleCtrl; | |
152 | wxComboBox* m_weightCtrl; | |
153 | wxComboBox* m_underliningCtrl; | |
3c6cc330 | 154 | wxCheckBox* m_textColourLabel; |
97ff49b3 | 155 | wxRichTextColourSwatchCtrl* m_colourCtrl; |
3c6cc330 | 156 | wxCheckBox* m_bgColourLabel; |
50283a51 | 157 | wxRichTextColourSwatchCtrl* m_bgColourCtrl; |
42688aea JS |
158 | wxCheckBox* m_strikethroughCtrl; |
159 | wxCheckBox* m_capitalsCtrl; | |
d07f2e19 | 160 | wxCheckBox* m_smallCapitalsCtrl; |
30bf7630 JS |
161 | wxCheckBox* m_superscriptCtrl; |
162 | wxCheckBox* m_subscriptCtrl; | |
97ff49b3 JS |
163 | wxRichTextFontPreviewCtrl* m_previewCtrl; |
164 | /// Control identifiers | |
165 | enum { | |
166 | ID_RICHTEXTFONTPAGE = 10000, | |
167 | ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001, | |
d07f2e19 JS |
168 | ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10002, |
169 | ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10003, | |
170 | ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10004, | |
171 | ID_RICHTEXTFONTPAGE_FACELISTBOX = 10005, | |
97ff49b3 JS |
172 | ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006, |
173 | ID_RICHTEXTFONTPAGE_STYLECTRL = 10007, | |
d07f2e19 JS |
174 | ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10008, |
175 | ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10009, | |
176 | ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL = 10010, | |
177 | ID_RICHTEXTFONTPAGE_COLOURCTRL = 10011, | |
178 | ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL = 10012, | |
179 | ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10013, | |
180 | ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10014, | |
181 | ID_RICHTEXTFONTPAGE_CAPSCTRL = 10015, | |
182 | ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL = 10016, | |
183 | ID_RICHTEXTFONTPAGE_SUPERSCRIPT = 10017, | |
184 | ID_RICHTEXTFONTPAGE_SUBSCRIPT = 10018, | |
185 | ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10019 | |
97ff49b3 JS |
186 | }; |
187 | ////@end wxRichTextFontPage member variables | |
188 | ||
189 | bool m_dontUpdate; | |
190 | bool m_colourPresent; | |
50283a51 | 191 | bool m_bgColourPresent; |
97ff49b3 JS |
192 | }; |
193 | ||
194 | #endif | |
195 | // _RICHTEXTFONTPAGE_H_ |