]>
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 | ||
97ff49b3 JS |
91 | /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL |
92 | void OnFaceTextCtrlUpdated( wxCommandEvent& event ); | |
93 | ||
94 | /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL | |
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 | ||
103 | /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS | |
104 | void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent& event ); | |
105 | ||
97ff49b3 JS |
106 | /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX |
107 | void OnSizeListBoxSelected( wxCommandEvent& event ); | |
108 | ||
109 | /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL | |
110 | void OnStyleCtrlSelected( wxCommandEvent& event ); | |
111 | ||
112 | /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL | |
113 | void OnWeightCtrlSelected( wxCommandEvent& event ); | |
114 | ||
115 | /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL | |
116 | void OnUnderliningCtrlSelected( wxCommandEvent& event ); | |
117 | ||
42688aea JS |
118 | /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL |
119 | void OnStrikethroughctrlClick( wxCommandEvent& event ); | |
120 | ||
121 | /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL | |
122 | void OnCapsctrlClick( wxCommandEvent& event ); | |
123 | ||
30bf7630 JS |
124 | /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT |
125 | void OnRichtextfontpageSuperscriptClick( wxCommandEvent& event ); | |
126 | ||
127 | /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT | |
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; | |
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, | |
97ff49b3 | 168 | ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10005, |
32423dd8 JS |
169 | ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10018, |
170 | ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10017, | |
171 | ID_RICHTEXTFONTPAGE_FACELISTBOX = 10002, | |
97ff49b3 JS |
172 | ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006, |
173 | ID_RICHTEXTFONTPAGE_STYLECTRL = 10007, | |
174 | ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004, | |
175 | ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10008, | |
3c6cc330 | 176 | ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL = 10015, |
97ff49b3 | 177 | ID_RICHTEXTFONTPAGE_COLOURCTRL = 10009, |
3c6cc330 | 178 | ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL = 10016, |
50283a51 | 179 | ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10014, |
42688aea JS |
180 | ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10010, |
181 | ID_RICHTEXTFONTPAGE_CAPSCTRL = 10011, | |
30bf7630 JS |
182 | ID_RICHTEXTFONTPAGE_SUPERSCRIPT = 10012, |
183 | ID_RICHTEXTFONTPAGE_SUBSCRIPT = 10013, | |
97ff49b3 JS |
184 | ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10003 |
185 | }; | |
186 | ////@end wxRichTextFontPage member variables | |
187 | ||
188 | bool m_dontUpdate; | |
189 | bool m_colourPresent; | |
50283a51 | 190 | bool m_bgColourPresent; |
97ff49b3 JS |
191 | }; |
192 | ||
193 | #endif | |
194 | // _RICHTEXTFONTPAGE_H_ |