]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextfontpage.h
Fix compilation under dll builds. Wrap source files in wxUSE_WEB checks to allow...
[wxWidgets.git] / include / wx / richtext / richtextfontpage.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextfontpage.h
3 // Purpose: Font page for wxRichTextFormattingDialog
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2006-10-02
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _RICHTEXTFONTPAGE_H_
13 #define _RICHTEXTFONTPAGE_H_
14
15 /*!
16 * Includes
17 */
18
19 #include "wx/richtext/richtextdialogpage.h"
20
21 ////@begin includes
22 ////@end includes
23
24 /*!
25 * Forward declarations
26 */
27
28 ////@begin forward declarations
29 class wxRichTextFontListBox;
30 class wxRichTextColourSwatchCtrl;
31 class wxRichTextFontPreviewCtrl;
32 ////@end forward declarations
33
34 /*!
35 * Control identifiers
36 */
37
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
45
46 /*!
47 * wxRichTextFontPage class declaration
48 */
49
50 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage: public wxRichTextDialogPage
51 {
52 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage )
53 DECLARE_EVENT_TABLE()
54 DECLARE_HELP_PROVISION()
55
56 public:
57 /// Constructors
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 );
60
61 /// Initialise members
62 void Init();
63
64 /// Creation
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 );
66
67 /// Creates the controls and sizers
68 void CreateControls();
69
70 /// Transfer data from/to window
71 virtual bool TransferDataFromWindow();
72 virtual bool TransferDataToWindow();
73
74 /// Updates the font preview
75 void UpdatePreview();
76
77 void OnFaceListBoxSelected( wxCommandEvent& event );
78 void OnColourClicked( wxCommandEvent& event );
79
80 /// Gets the attributes associated with the main formatting dialog
81 wxRichTextAttr* GetAttributes();
82
83 ////@begin wxRichTextFontPage event handler declarations
84
85 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
86 void OnFaceTextCtrlUpdated( wxCommandEvent& event );
87
88 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
89 void OnSizeTextCtrlUpdated( wxCommandEvent& event );
90
91 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
92 void OnSizeListBoxSelected( wxCommandEvent& event );
93
94 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
95 void OnStyleCtrlSelected( wxCommandEvent& event );
96
97 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
98 void OnWeightCtrlSelected( wxCommandEvent& event );
99
100 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
101 void OnUnderliningCtrlSelected( wxCommandEvent& event );
102
103 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
104 void OnStrikethroughctrlClick( wxCommandEvent& event );
105
106 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
107 void OnCapsctrlClick( wxCommandEvent& event );
108
109 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
110 void OnRichtextfontpageSuperscriptClick( wxCommandEvent& event );
111
112 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
113 void OnRichtextfontpageSubscriptClick( wxCommandEvent& event );
114
115 ////@end wxRichTextFontPage event handler declarations
116
117 ////@begin wxRichTextFontPage member function declarations
118
119 /// Retrieves bitmap resources
120 wxBitmap GetBitmapResource( const wxString& name );
121
122 /// Retrieves icon resources
123 wxIcon GetIconResource( const wxString& name );
124 ////@end wxRichTextFontPage member function declarations
125
126 /// Should we show tooltips?
127 static bool ShowToolTips();
128
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
145 enum {
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
161 };
162 ////@end wxRichTextFontPage member variables
163
164 bool m_dontUpdate;
165 bool m_colourPresent;
166 bool m_bgColourPresent;
167 };
168
169 #endif
170 // _RICHTEXTFONTPAGE_H_