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