]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextfontpage.h
OS X compilation fix
[wxWidgets.git] / include / wx / richtext / richtextfontpage.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richeditfontpage.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 ////@begin includes
20 ////@end includes
21
22 /*!
23 * Forward declarations
24 */
25
26 ////@begin forward declarations
27 class wxRichTextFontListBox;
28 class wxRichTextColourSwatchCtrl;
29 class wxRichTextFontPreviewCtrl;
30 ////@end forward declarations
31
32 /*!
33 * Control identifiers
34 */
35
36 ////@begin control identifiers
37 #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
38 #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE _("wxRichTextFontPage")
39 #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE
40 #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(400, 300)
41 #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition
42 ////@end control identifiers
43
44 /*!
45 * wxRichTextFontPage class declaration
46 */
47
48 class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage: public wxPanel
49 {
50 DECLARE_DYNAMIC_CLASS( wxRichTextFontPage )
51 DECLARE_EVENT_TABLE()
52
53 public:
54 /// Constructors
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 );
57
58 /// Initialise members
59 void Init();
60
61 /// Creation
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 );
63
64 /// Creates the controls and sizers
65 void CreateControls();
66
67 /// Transfer data from/to window
68 virtual bool TransferDataFromWindow();
69 virtual bool TransferDataToWindow();
70
71 /// Updates the font preview
72 void UpdatePreview();
73
74 void OnFaceListBoxSelected( wxCommandEvent& event );
75 void OnColourClicked( wxCommandEvent& event );
76
77 /// Gets the attributes associated with the main formatting dialog
78 wxTextAttrEx* GetAttributes();
79
80 ////@begin wxRichTextFontPage event handler declarations
81
82 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
83 void OnFaceTextCtrlUpdated( wxCommandEvent& event );
84
85 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
86 void OnSizeTextCtrlUpdated( wxCommandEvent& event );
87
88 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
89 void OnSizeListBoxSelected( wxCommandEvent& event );
90
91 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
92 void OnStyleCtrlSelected( wxCommandEvent& event );
93
94 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
95 void OnWeightCtrlSelected( wxCommandEvent& event );
96
97 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
98 void OnUnderliningCtrlSelected( wxCommandEvent& event );
99
100 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
101 void OnStrikethroughctrlClick( wxCommandEvent& event );
102
103 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
104 void OnCapsctrlClick( wxCommandEvent& event );
105
106 ////@end wxRichTextFontPage event handler declarations
107
108 ////@begin wxRichTextFontPage member function declarations
109
110 /// Retrieves bitmap resources
111 wxBitmap GetBitmapResource( const wxString& name );
112
113 /// Retrieves icon resources
114 wxIcon GetIconResource( const wxString& name );
115 ////@end wxRichTextFontPage member function declarations
116
117 /// Should we show tooltips?
118 static bool ShowToolTips();
119
120 ////@begin wxRichTextFontPage member variables
121 wxTextCtrl* m_faceTextCtrl;
122 wxRichTextFontListBox* m_faceListBox;
123 wxTextCtrl* m_sizeTextCtrl;
124 wxListBox* m_sizeListBox;
125 wxComboBox* m_styleCtrl;
126 wxComboBox* m_weightCtrl;
127 wxComboBox* m_underliningCtrl;
128 wxRichTextColourSwatchCtrl* m_colourCtrl;
129 wxCheckBox* m_strikethroughCtrl;
130 wxCheckBox* m_capitalsCtrl;
131 wxRichTextFontPreviewCtrl* m_previewCtrl;
132 /// Control identifiers
133 enum {
134 ID_RICHTEXTFONTPAGE = 10000,
135 ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001,
136 ID_RICHTEXTFONTPAGE_FACELISTBOX = 10002,
137 ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10005,
138 ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006,
139 ID_RICHTEXTFONTPAGE_STYLECTRL = 10007,
140 ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004,
141 ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10008,
142 ID_RICHTEXTFONTPAGE_COLOURCTRL = 10009,
143 ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10010,
144 ID_RICHTEXTFONTPAGE_CAPSCTRL = 10011,
145 ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10003
146 };
147 ////@end wxRichTextFontPage member variables
148
149 bool m_dontUpdate;
150 bool m_colourPresent;
151 };
152
153 #endif
154 // _RICHTEXTFONTPAGE_H_