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"
25 * Forward declarations
28 ////@begin forward declarations
29 class wxRichTextFontListBox
;
30 class wxRichTextColourSwatchCtrl
;
31 class wxRichTextFontPreviewCtrl
;
32 ////@end forward declarations
38 ////@begin control identifiers
39 #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL
40 #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxEmptyString
41 #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE
42 #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100)
43 #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition
44 ////@end control identifiers
47 * wxRichTextFontPage class declaration
50 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage
: public wxRichTextDialogPage
52 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage
)
54 DECLARE_HELP_PROVISION()
58 wxRichTextFontPage( );
59 wxRichTextFontPage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTFONTPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTFONTPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTFONTPAGE_STYLE
);
61 /// Initialise members
65 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
);
67 /// Creates the controls and sizers
68 void CreateControls();
70 /// Transfer data from/to window
71 virtual bool TransferDataFromWindow();
72 virtual bool TransferDataToWindow();
74 /// Updates the font preview
77 void OnFaceListBoxSelected( wxCommandEvent
& event
);
78 void OnColourClicked( wxCommandEvent
& event
);
80 /// Gets the attributes associated with the main formatting dialog
81 wxRichTextAttr
* GetAttributes();
83 ////@begin wxRichTextFontPage event handler declarations
85 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
86 void OnFaceTextCtrlUpdated( wxCommandEvent
& event
);
88 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
89 void OnSizeTextCtrlUpdated( wxCommandEvent
& event
);
91 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
92 void OnSizeListBoxSelected( wxCommandEvent
& event
);
94 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
95 void OnStyleCtrlSelected( wxCommandEvent
& event
);
97 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
98 void OnWeightCtrlSelected( wxCommandEvent
& event
);
100 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
101 void OnUnderliningCtrlSelected( wxCommandEvent
& event
);
103 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
104 void OnStrikethroughctrlClick( wxCommandEvent
& event
);
106 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
107 void OnCapsctrlClick( wxCommandEvent
& event
);
109 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
110 void OnRichtextfontpageSuperscriptClick( wxCommandEvent
& event
);
112 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
113 void OnRichtextfontpageSubscriptClick( wxCommandEvent
& event
);
115 ////@end wxRichTextFontPage event handler declarations
117 ////@begin wxRichTextFontPage member function declarations
119 /// Retrieves bitmap resources
120 wxBitmap
GetBitmapResource( const wxString
& name
);
122 /// Retrieves icon resources
123 wxIcon
GetIconResource( const wxString
& name
);
124 ////@end wxRichTextFontPage member function declarations
126 /// Should we show tooltips?
127 static bool ShowToolTips();
129 ////@begin wxRichTextFontPage member variables
130 wxTextCtrl
* m_faceTextCtrl
;
131 wxRichTextFontListBox
* m_faceListBox
;
132 wxTextCtrl
* m_sizeTextCtrl
;
133 wxListBox
* m_sizeListBox
;
134 wxComboBox
* m_styleCtrl
;
135 wxComboBox
* m_weightCtrl
;
136 wxComboBox
* m_underliningCtrl
;
137 wxRichTextColourSwatchCtrl
* m_colourCtrl
;
138 wxRichTextColourSwatchCtrl
* m_bgColourCtrl
;
139 wxCheckBox
* m_strikethroughCtrl
;
140 wxCheckBox
* m_capitalsCtrl
;
141 wxCheckBox
* m_superscriptCtrl
;
142 wxCheckBox
* m_subscriptCtrl
;
143 wxRichTextFontPreviewCtrl
* m_previewCtrl
;
144 /// Control identifiers
146 ID_RICHTEXTFONTPAGE
= 10000,
147 ID_RICHTEXTFONTPAGE_FACETEXTCTRL
= 10001,
148 ID_RICHTEXTFONTPAGE_FACELISTBOX
= 10002,
149 ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
= 10005,
150 ID_RICHTEXTFONTPAGE_SIZELISTBOX
= 10006,
151 ID_RICHTEXTFONTPAGE_STYLECTRL
= 10007,
152 ID_RICHTEXTFONTPAGE_WEIGHTCTRL
= 10004,
153 ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
= 10008,
154 ID_RICHTEXTFONTPAGE_COLOURCTRL
= 10009,
155 ID_RICHTEXTFONTPAGE_BGCOLOURCTRL
= 10014,
156 ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
= 10010,
157 ID_RICHTEXTFONTPAGE_CAPSCTRL
= 10011,
158 ID_RICHTEXTFONTPAGE_SUPERSCRIPT
= 10012,
159 ID_RICHTEXTFONTPAGE_SUBSCRIPT
= 10013,
160 ID_RICHTEXTFONTPAGE_PREVIEWCTRL
= 10003
162 ////@end wxRichTextFontPage member variables
165 bool m_colourPresent
;
166 bool m_bgColourPresent
;
170 // _RICHTEXTFONTPAGE_H_