]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextfontpage.h
0b1bb45aaeddeb588cfe4d26cece223828516586
[wxWidgets.git] / include / wx / richtext / richtextfontpage.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextfontpage.h
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
19 #include "wx/richtext/richtextdialogpage.h"
20
21 ////@begin includes
22 #include "wx/spinbutt.h"
23 ////@end includes
24
25 /*!
26 * Forward declarations
27 */
28
29 ////@begin forward declarations
30 class wxSpinButton;
31 class wxBoxSizer;
32 class wxRichTextFontListBox;
33 class wxRichTextColourSwatchCtrl;
34 class wxRichTextFontPreviewCtrl;
35 ////@end forward declarations
36
37 /*!
38 * Control identifiers
39 */
40
41 ////@begin control identifiers
42 #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL
43 #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxEmptyString
44 #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE
45 #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100)
46 #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition
47 ////@end control identifiers
48
49 /*!
50 * wxRichTextFontPage class declaration
51 */
52
53 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage: public wxRichTextDialogPage
54 {
55 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage )
56 DECLARE_EVENT_TABLE()
57 DECLARE_HELP_PROVISION()
58
59 public:
60 /// Constructors
61 wxRichTextFontPage( );
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 );
63
64 /// Initialise members
65 void Init();
66
67 /// Creation
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 );
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
84 wxRichTextAttr* GetAttributes();
85
86 ////@begin wxRichTextFontPage event handler declarations
87
88 /// wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
89 void OnIdle( wxIdleEvent& event );
90
91 /// wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
92 void OnFaceTextCtrlUpdated( wxCommandEvent& event );
93
94 /// wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
95 void OnSizeTextCtrlUpdated( wxCommandEvent& event );
96
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_CHOICE event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
104 void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent& event );
105
106 /// wxEVT_LISTBOX event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
107 void OnSizeListBoxSelected( wxCommandEvent& event );
108
109 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
110 void OnStyleCtrlSelected( wxCommandEvent& event );
111
112 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
113 void OnWeightCtrlSelected( wxCommandEvent& event );
114
115 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
116 void OnUnderliningCtrlSelected( wxCommandEvent& event );
117
118 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
119 void OnStrikethroughctrlClick( wxCommandEvent& event );
120
121 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
122 void OnCapsctrlClick( wxCommandEvent& event );
123
124 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
125 void OnRichtextfontpageSuperscriptClick( wxCommandEvent& event );
126
127 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
128 void OnRichtextfontpageSubscriptClick( wxCommandEvent& event );
129
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;
146 wxTextCtrl* m_sizeTextCtrl;
147 wxSpinButton* m_fontSizeSpinButtons;
148 wxChoice* m_sizeUnitsCtrl;
149 wxBoxSizer* m_fontListBoxParent;
150 wxRichTextFontListBox* m_faceListBox;
151 wxListBox* m_sizeListBox;
152 wxComboBox* m_styleCtrl;
153 wxComboBox* m_weightCtrl;
154 wxComboBox* m_underliningCtrl;
155 wxCheckBox* m_textColourLabel;
156 wxRichTextColourSwatchCtrl* m_colourCtrl;
157 wxCheckBox* m_bgColourLabel;
158 wxRichTextColourSwatchCtrl* m_bgColourCtrl;
159 wxCheckBox* m_strikethroughCtrl;
160 wxCheckBox* m_capitalsCtrl;
161 wxCheckBox* m_smallCapitalsCtrl;
162 wxCheckBox* m_superscriptCtrl;
163 wxCheckBox* m_subscriptCtrl;
164 wxRichTextFontPreviewCtrl* m_previewCtrl;
165 /// Control identifiers
166 enum {
167 ID_RICHTEXTFONTPAGE = 10000,
168 ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001,
169 ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10002,
170 ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10003,
171 ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10004,
172 ID_RICHTEXTFONTPAGE_FACELISTBOX = 10005,
173 ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006,
174 ID_RICHTEXTFONTPAGE_STYLECTRL = 10007,
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
187 };
188 ////@end wxRichTextFontPage member variables
189
190 bool m_dontUpdate;
191 bool m_colourPresent;
192 bool m_bgColourPresent;
193 };
194
195 #endif
196 // _RICHTEXTFONTPAGE_H_