1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextfontpage.h
3 // Purpose: Font page for wxRichTextFormattingDialog
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _RICHTEXTFONTPAGE_H_
13 #define _RICHTEXTFONTPAGE_H_
19 #include "wx/richtext/richtextdialogpage.h"
22 #include "wx/spinbutt.h"
26 * Forward declarations
29 ////@begin forward declarations
32 class wxRichTextFontListBox
;
33 class wxRichTextColourSwatchCtrl
;
34 class wxRichTextFontPreviewCtrl
;
35 ////@end forward declarations
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
50 * wxRichTextFontPage class declaration
53 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage
: public wxRichTextDialogPage
55 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage
)
57 DECLARE_HELP_PROVISION()
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
);
64 /// Initialise members
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
);
70 /// Creates the controls and sizers
71 void CreateControls();
73 /// Transfer data from/to window
74 virtual bool TransferDataFromWindow();
75 virtual bool TransferDataToWindow();
77 /// Updates the font preview
80 void OnFaceListBoxSelected( wxCommandEvent
& event
);
81 void OnColourClicked( wxCommandEvent
& event
);
83 /// Gets the attributes associated with the main formatting dialog
84 wxRichTextAttr
* GetAttributes();
86 ////@begin wxRichTextFontPage event handler declarations
88 /// wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
89 void OnIdle( wxIdleEvent
& event
);
91 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
92 void OnFaceTextCtrlUpdated( wxCommandEvent
& event
);
94 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
95 void OnSizeTextCtrlUpdated( wxCommandEvent
& event
);
97 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
98 void OnRichtextfontpageSpinbuttonsUp( wxSpinEvent
& event
);
100 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
101 void OnRichtextfontpageSpinbuttonsDown( wxSpinEvent
& event
);
103 /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
104 void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent
& event
);
106 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
107 void OnSizeListBoxSelected( wxCommandEvent
& event
);
109 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
110 void OnStyleCtrlSelected( wxCommandEvent
& event
);
112 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
113 void OnWeightCtrlSelected( wxCommandEvent
& event
);
115 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
116 void OnUnderliningCtrlSelected( wxCommandEvent
& event
);
118 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
119 void OnStrikethroughctrlClick( wxCommandEvent
& event
);
121 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
122 void OnCapsctrlClick( wxCommandEvent
& event
);
124 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
125 void OnRichtextfontpageSuperscriptClick( wxCommandEvent
& event
);
127 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
128 void OnRichtextfontpageSubscriptClick( wxCommandEvent
& event
);
130 ////@end wxRichTextFontPage event handler declarations
132 ////@begin wxRichTextFontPage member function declarations
134 /// Retrieves bitmap resources
135 wxBitmap
GetBitmapResource( const wxString
& name
);
137 /// Retrieves icon resources
138 wxIcon
GetIconResource( const wxString
& name
);
139 ////@end wxRichTextFontPage member function declarations
141 /// Should we show tooltips?
142 static bool ShowToolTips();
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_superscriptCtrl
;
162 wxCheckBox
* m_subscriptCtrl
;
163 wxRichTextFontPreviewCtrl
* m_previewCtrl
;
164 /// Control identifiers
166 ID_RICHTEXTFONTPAGE
= 10000,
167 ID_RICHTEXTFONTPAGE_FACETEXTCTRL
= 10001,
168 ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
= 10005,
169 ID_RICHTEXTFONTPAGE_SPINBUTTONS
= 10018,
170 ID_RICHTEXTFONTPAGE_SIZE_UNITS
= 10017,
171 ID_RICHTEXTFONTPAGE_FACELISTBOX
= 10002,
172 ID_RICHTEXTFONTPAGE_SIZELISTBOX
= 10006,
173 ID_RICHTEXTFONTPAGE_STYLECTRL
= 10007,
174 ID_RICHTEXTFONTPAGE_WEIGHTCTRL
= 10004,
175 ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
= 10008,
176 ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL
= 10015,
177 ID_RICHTEXTFONTPAGE_COLOURCTRL
= 10009,
178 ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL
= 10016,
179 ID_RICHTEXTFONTPAGE_BGCOLOURCTRL
= 10014,
180 ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
= 10010,
181 ID_RICHTEXTFONTPAGE_CAPSCTRL
= 10011,
182 ID_RICHTEXTFONTPAGE_SUPERSCRIPT
= 10012,
183 ID_RICHTEXTFONTPAGE_SUBSCRIPT
= 10013,
184 ID_RICHTEXTFONTPAGE_PREVIEWCTRL
= 10003
186 ////@end wxRichTextFontPage member variables
189 bool m_colourPresent
;
190 bool m_bgColourPresent
;
194 // _RICHTEXTFONTPAGE_H_