1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richeditfontpage.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_
23 * Forward declarations
26 ////@begin forward declarations
27 class wxRichTextFontListBox
;
28 class wxRichTextColourSwatchCtrl
;
29 class wxRichTextFontPreviewCtrl
;
30 ////@end forward declarations
36 ////@begin control identifiers
37 #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL
38 #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE _T("")
39 #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE
40 #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100)
41 #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition
42 ////@end control identifiers
45 * wxRichTextFontPage class declaration
48 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage
: public wxPanel
50 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage
)
55 wxRichTextFontPage( );
56 wxRichTextFontPage( wxWindow
* parent
, wxWindowID id
= wxID_ANY
, const wxPoint
& pos
= SYMBOL_WXRICHTEXTFONTPAGE_POSITION
, const wxSize
& size
= SYMBOL_WXRICHTEXTFONTPAGE_SIZE
, long style
= SYMBOL_WXRICHTEXTFONTPAGE_STYLE
);
58 /// Initialise members
62 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
);
64 /// Creates the controls and sizers
65 void CreateControls();
67 /// Transfer data from/to window
68 virtual bool TransferDataFromWindow();
69 virtual bool TransferDataToWindow();
71 /// Updates the font preview
74 void OnFaceListBoxSelected( wxCommandEvent
& event
);
75 void OnColourClicked( wxCommandEvent
& event
);
77 /// Gets the attributes associated with the main formatting dialog
78 wxTextAttr
* GetAttributes();
80 ////@begin wxRichTextFontPage event handler declarations
82 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
83 void OnFaceTextCtrlUpdated( wxCommandEvent
& event
);
85 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
86 void OnSizeTextCtrlUpdated( wxCommandEvent
& event
);
88 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
89 void OnSizeListBoxSelected( wxCommandEvent
& event
);
91 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
92 void OnStyleCtrlSelected( wxCommandEvent
& event
);
94 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
95 void OnWeightCtrlSelected( wxCommandEvent
& event
);
97 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
98 void OnUnderliningCtrlSelected( wxCommandEvent
& event
);
100 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
101 void OnStrikethroughctrlClick( wxCommandEvent
& event
);
103 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
104 void OnCapsctrlClick( wxCommandEvent
& event
);
106 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
107 void OnRichtextfontpageSuperscriptClick( wxCommandEvent
& event
);
109 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
110 void OnRichtextfontpageSubscriptClick( wxCommandEvent
& event
);
112 ////@end wxRichTextFontPage event handler declarations
114 ////@begin wxRichTextFontPage member function declarations
116 /// Retrieves bitmap resources
117 wxBitmap
GetBitmapResource( const wxString
& name
);
119 /// Retrieves icon resources
120 wxIcon
GetIconResource( const wxString
& name
);
121 ////@end wxRichTextFontPage member function declarations
123 /// Should we show tooltips?
124 static bool ShowToolTips();
126 ////@begin wxRichTextFontPage member variables
127 wxTextCtrl
* m_faceTextCtrl
;
128 wxRichTextFontListBox
* m_faceListBox
;
129 wxTextCtrl
* m_sizeTextCtrl
;
130 wxListBox
* m_sizeListBox
;
131 wxComboBox
* m_styleCtrl
;
132 wxComboBox
* m_weightCtrl
;
133 wxComboBox
* m_underliningCtrl
;
134 wxRichTextColourSwatchCtrl
* m_colourCtrl
;
135 wxCheckBox
* m_strikethroughCtrl
;
136 wxCheckBox
* m_capitalsCtrl
;
137 wxCheckBox
* m_superscriptCtrl
;
138 wxCheckBox
* m_subscriptCtrl
;
139 wxRichTextFontPreviewCtrl
* m_previewCtrl
;
140 /// Control identifiers
142 ID_RICHTEXTFONTPAGE
= 10000,
143 ID_RICHTEXTFONTPAGE_FACETEXTCTRL
= 10001,
144 ID_RICHTEXTFONTPAGE_FACELISTBOX
= 10002,
145 ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
= 10005,
146 ID_RICHTEXTFONTPAGE_SIZELISTBOX
= 10006,
147 ID_RICHTEXTFONTPAGE_STYLECTRL
= 10007,
148 ID_RICHTEXTFONTPAGE_WEIGHTCTRL
= 10004,
149 ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
= 10008,
150 ID_RICHTEXTFONTPAGE_COLOURCTRL
= 10009,
151 ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
= 10010,
152 ID_RICHTEXTFONTPAGE_CAPSCTRL
= 10011,
153 ID_RICHTEXTFONTPAGE_SUPERSCRIPT
= 10012,
154 ID_RICHTEXTFONTPAGE_SUBSCRIPT
= 10013,
155 ID_RICHTEXTFONTPAGE_PREVIEWCTRL
= 10003
157 ////@end wxRichTextFontPage member variables
160 bool m_colourPresent
;
164 // _RICHTEXTFONTPAGE_H_