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_TEXT event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
92 void OnFaceTextCtrlUpdated( wxCommandEvent
& event
);
94 /// wxEVT_TEXT 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_CHOICE event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
104 void OnRichtextfontpageSizeUnitsSelected( wxCommandEvent
& event
);
106 /// wxEVT_LISTBOX event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
107 void OnSizeListBoxSelected( wxCommandEvent
& event
);
109 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
110 void OnStyleCtrlSelected( wxCommandEvent
& event
);
112 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
113 void OnWeightCtrlSelected( wxCommandEvent
& event
);
115 /// wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
116 void OnUnderliningCtrlSelected( wxCommandEvent
& event
);
118 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
119 void OnStrikethroughctrlClick( wxCommandEvent
& event
);
121 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
122 void OnCapsctrlClick( wxCommandEvent
& event
);
124 /// wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
125 void OnRichtextfontpageSuperscriptClick( wxCommandEvent
& event
);
127 /// wxEVT_CHECKBOX 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_smallCapitalsCtrl
;
162 wxCheckBox
* m_superscriptCtrl
;
163 wxCheckBox
* m_subscriptCtrl
;
164 wxRichTextFontPreviewCtrl
* m_previewCtrl
;
165 /// Control identifiers
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
188 ////@end wxRichTextFontPage member variables
191 bool m_colourPresent
;
192 bool m_bgColourPresent
;
196 // _RICHTEXTFONTPAGE_H_