1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextfontpage.h
3 // Purpose: Font page for wxRichTextFormattingDialog
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _RICHTEXTFONTPAGE_H_
12 #define _RICHTEXTFONTPAGE_H_
18 #include "wx/richtext/richtextdialogpage.h"
21 #include "wx/spinbutt.h"
25 * Forward declarations
28 ////@begin forward declarations
31 class wxRichTextFontListBox
;
32 class wxRichTextColourSwatchCtrl
;
33 class wxRichTextFontPreviewCtrl
;
34 ////@end forward declarations
40 ////@begin control identifiers
41 #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL
42 #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxEmptyString
43 #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE
44 #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100)
45 #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition
46 ////@end control identifiers
49 * wxRichTextFontPage class declaration
52 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage
: public wxRichTextDialogPage
54 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage
)
56 DECLARE_HELP_PROVISION()
60 wxRichTextFontPage( );
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
);
63 /// Initialise members
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
);
69 /// Creates the controls and sizers
70 void CreateControls();
72 /// Transfer data from/to window
73 virtual bool TransferDataFromWindow();
74 virtual bool TransferDataToWindow();
76 /// Updates the font preview
79 void OnFaceListBoxSelected( wxCommandEvent
& event
);
80 void OnColourClicked( wxCommandEvent
& event
);
82 /// Gets the attributes associated with the main formatting dialog
83 wxRichTextAttr
* GetAttributes();
85 ////@begin wxRichTextFontPage event handler declarations
87 /// wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
88 void OnIdle( wxIdleEvent
& event
);
90 /// wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
91 void OnFaceTextCtrlUpdated( wxCommandEvent
& event
);
93 /// wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
94 void OnSizeTextCtrlUpdated( wxCommandEvent
& event
);
96 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
97 void OnRichtextfontpageSpinbuttonsUp( wxSpinEvent
& event
);
99 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
100 void OnRichtextfontpageSpinbuttonsDown( wxSpinEvent
& event
);
102 /// wxEVT_CHOICE event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
103 void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent
& event
);
105 /// wxEVT_LISTBOX event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
106 void OnSizeListBoxSelected( wxCommandEvent
& event
);
108 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
109 void OnStyleCtrlSelected( wxCommandEvent
& event
);
111 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
112 void OnWeightCtrlSelected( wxCommandEvent
& event
);
114 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
115 void OnUnderliningCtrlSelected( wxCommandEvent
& event
);
117 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
118 void OnStrikethroughctrlClick( wxCommandEvent
& event
);
120 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
121 void OnCapsctrlClick( wxCommandEvent
& event
);
123 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
124 void OnRichtextfontpageSuperscriptClick( wxCommandEvent
& event
);
126 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
127 void OnRichtextfontpageSubscriptClick( wxCommandEvent
& event
);
129 ////@end wxRichTextFontPage event handler declarations
131 ////@begin wxRichTextFontPage member function declarations
133 /// Retrieves bitmap resources
134 wxBitmap
GetBitmapResource( const wxString
& name
);
136 /// Retrieves icon resources
137 wxIcon
GetIconResource( const wxString
& name
);
138 ////@end wxRichTextFontPage member function declarations
140 /// Should we show tooltips?
141 static bool ShowToolTips();
143 ////@begin wxRichTextFontPage member variables
144 wxTextCtrl
* m_faceTextCtrl
;
145 wxTextCtrl
* m_sizeTextCtrl
;
146 wxSpinButton
* m_fontSizeSpinButtons
;
147 wxChoice
* m_sizeUnitsCtrl
;
148 wxBoxSizer
* m_fontListBoxParent
;
149 wxRichTextFontListBox
* m_faceListBox
;
150 wxListBox
* m_sizeListBox
;
151 wxComboBox
* m_styleCtrl
;
152 wxComboBox
* m_weightCtrl
;
153 wxComboBox
* m_underliningCtrl
;
154 wxCheckBox
* m_textColourLabel
;
155 wxRichTextColourSwatchCtrl
* m_colourCtrl
;
156 wxCheckBox
* m_bgColourLabel
;
157 wxRichTextColourSwatchCtrl
* m_bgColourCtrl
;
158 wxCheckBox
* m_strikethroughCtrl
;
159 wxCheckBox
* m_capitalsCtrl
;
160 wxCheckBox
* m_smallCapitalsCtrl
;
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
= 10002,
169 ID_RICHTEXTFONTPAGE_SPINBUTTONS
= 10003,
170 ID_RICHTEXTFONTPAGE_SIZE_UNITS
= 10004,
171 ID_RICHTEXTFONTPAGE_FACELISTBOX
= 10005,
172 ID_RICHTEXTFONTPAGE_SIZELISTBOX
= 10006,
173 ID_RICHTEXTFONTPAGE_STYLECTRL
= 10007,
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
187 ////@end wxRichTextFontPage member variables
190 bool m_colourPresent
;
191 bool m_bgColourPresent
;
195 // _RICHTEXTFONTPAGE_H_