]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextbulletspage.h
add a more readable wrapper for CreateDocument(wxEmptyString, wxDOC_NEW)
[wxWidgets.git] / include / wx / richtext / richtextbulletspage.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextbulletspage.h
3 // Purpose:
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 10/4/2006 10:32:31 AM
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _RICHTEXTBULLETSPAGE_H_
13 #define _RICHTEXTBULLETSPAGE_H_
14
15 /*!
16 * Includes
17 */
18 #include "wx/spinbutt.h" // for wxSpinEvent
19
20 /*!
21 * Forward declarations
22 */
23
24 ////@begin forward declarations
25 class wxSpinCtrl;
26 class wxRichTextCtrl;
27 ////@end forward declarations
28
29 /*!
30 * Control identifiers
31 */
32
33 ////@begin control identifiers
34 #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
35 #define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE _("wxRichTextBulletsPage")
36 #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
37 #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
38 #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
39 ////@end control identifiers
40
41 /*!
42 * wxRichTextBulletsPage class declaration
43 */
44
45 class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage: public wxPanel
46 {
47 DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage )
48 DECLARE_EVENT_TABLE()
49
50 public:
51 /// Constructors
52 wxRichTextBulletsPage( );
53 wxRichTextBulletsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE );
54
55 /// Creation
56 bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE );
57
58 /// Initialise members
59 void Init();
60
61 /// Creates the controls and sizers
62 void CreateControls();
63
64 /// Updates the bullets preview
65 void UpdatePreview();
66
67 /// Transfer data from/to window
68 virtual bool TransferDataFromWindow();
69 virtual bool TransferDataToWindow();
70
71 /// Gets the attributes associated with the main formatting dialog
72 wxTextAttr* GetAttributes();
73
74 /// Update for symbol-related controls
75 void OnSymbolUpdate( wxUpdateUIEvent& event );
76
77 /// Update for number-related controls
78 void OnNumberUpdate( wxUpdateUIEvent& event );
79
80 /// Update for standard bullet-related controls
81 void OnStandardBulletUpdate( wxUpdateUIEvent& event );
82
83 ////@begin wxRichTextBulletsPage event handler declarations
84
85 /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
86 void OnStylelistboxSelected( wxCommandEvent& event );
87
88 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
89 void OnPeriodctrlClick( wxCommandEvent& event );
90
91 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
92 void OnPeriodctrlUpdate( wxUpdateUIEvent& event );
93
94 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
95 void OnParenthesesctrlClick( wxCommandEvent& event );
96
97 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
98 void OnParenthesesctrlUpdate( wxUpdateUIEvent& event );
99
100 /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
101 void OnRightParenthesisCtrlClick( wxCommandEvent& event );
102
103 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
104 void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event );
105
106 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
107 void OnBulletAlignmentCtrlSelected( wxCommandEvent& event );
108
109 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
110 void OnSymbolstaticUpdate( wxUpdateUIEvent& event );
111
112 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
113 void OnSymbolctrlSelected( wxCommandEvent& event );
114
115 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
116 void OnSymbolctrlUpdated( wxCommandEvent& event );
117
118 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
119 void OnSymbolctrlUpdate( wxUpdateUIEvent& event );
120
121 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
122 void OnChooseSymbolClick( wxCommandEvent& event );
123
124 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
125 void OnChooseSymbolUpdate( wxUpdateUIEvent& event );
126
127 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
128 void OnSymbolfontctrlSelected( wxCommandEvent& event );
129
130 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
131 void OnSymbolfontctrlUpdated( wxCommandEvent& event );
132
133 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
134 void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event );
135
136 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
137 void OnNamestaticUpdate( wxUpdateUIEvent& event );
138
139 /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
140 void OnNamectrlSelected( wxCommandEvent& event );
141
142 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
143 void OnNamectrlUpdated( wxCommandEvent& event );
144
145 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
146 void OnNamectrlUIUpdate( wxUpdateUIEvent& event );
147
148 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
149 void OnNumberstaticUpdate( wxUpdateUIEvent& event );
150
151 /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
152 void OnNumberctrlUpdated( wxSpinEvent& event );
153
154 /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
155 void OnNumberctrlUp( wxSpinEvent& event );
156
157 /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
158 void OnNumberctrlDown( wxSpinEvent& event );
159
160 /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
161 void OnNumberctrlTextUpdated( wxCommandEvent& event );
162
163 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
164 void OnNumberctrlUpdate( wxUpdateUIEvent& event );
165
166 ////@end wxRichTextBulletsPage event handler declarations
167
168 ////@begin wxRichTextBulletsPage member function declarations
169
170 /// Retrieves bitmap resources
171 wxBitmap GetBitmapResource( const wxString& name );
172
173 /// Retrieves icon resources
174 wxIcon GetIconResource( const wxString& name );
175 ////@end wxRichTextBulletsPage member function declarations
176
177 /// Should we show tooltips?
178 static bool ShowToolTips();
179
180 ////@begin wxRichTextBulletsPage member variables
181 wxListBox* m_styleListBox;
182 wxCheckBox* m_periodCtrl;
183 wxCheckBox* m_parenthesesCtrl;
184 wxCheckBox* m_rightParenthesisCtrl;
185 wxComboBox* m_bulletAlignmentCtrl;
186 wxComboBox* m_symbolCtrl;
187 wxComboBox* m_symbolFontCtrl;
188 wxComboBox* m_bulletNameCtrl;
189 wxSpinCtrl* m_numberCtrl;
190 wxRichTextCtrl* m_previewCtrl;
191 /// Control identifiers
192 enum {
193 ID_RICHTEXTBULLETSPAGE = 10300,
194 ID_RICHTEXTBULLETSPAGE_STYLELISTBOX = 10305,
195 ID_RICHTEXTBULLETSPAGE_PERIODCTRL = 10313,
196 ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL = 10311,
197 ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL = 10306,
198 ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL = 10315,
199 ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC = 10301,
200 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL = 10307,
201 ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL = 10308,
202 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL = 10309,
203 ID_RICHTEXTBULLETSPAGE_NAMESTATIC = 10303,
204 ID_RICHTEXTBULLETSPAGE_NAMECTRL = 10304,
205 ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC = 10302,
206 ID_RICHTEXTBULLETSPAGE_NUMBERCTRL = 10310,
207 ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL = 10314
208 };
209 ////@end wxRichTextBulletsPage member variables
210
211 bool m_hasBulletStyle;
212 bool m_hasBulletNumber;
213 bool m_hasBulletSymbol;
214 bool m_dontUpdate;
215 };
216
217 #endif
218 // _RICHTEXTBULLETSPAGE_H_