]> git.saurik.com Git - wxWidgets.git/blob - src/richtext/richtextliststylepage.cpp
Return NULL from wxWindow::GetCapture() when the capture is being lost.
[wxWidgets.git] / src / richtext / richtextliststylepage.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/richtext/richtextliststylepage.cpp
3 // Purpose:
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 10/18/2006 11:36:37 AM
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #include "wx/richtext/richtextliststylepage.h"
12
13 ////@begin XPM images
14 ////@end XPM images
15
16 /*!
17 * wxRichTextListStylePage type definition
18 */
19
20 IMPLEMENT_DYNAMIC_CLASS( wxRichTextListStylePage, wxRichTextDialogPage )
21
22 /*!
23 * wxRichTextListStylePage event table definition
24 */
25
26 BEGIN_EVENT_TABLE( wxRichTextListStylePage, wxRichTextDialogPage )
27
28 ////@begin wxRichTextListStylePage event table entries
29 EVT_SPINCTRL( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelUpdated )
30 EVT_SPIN_UP( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelUp )
31 EVT_SPIN_DOWN( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelDown )
32 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelTextUpdated )
33 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelUIUpdate )
34
35 EVT_BUTTON( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT, wxRichTextListStylePage::OnChooseFontClick )
36
37 EVT_LISTBOX( ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxRichTextListStylePage::OnStylelistboxSelected )
38
39 EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlClick )
40 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlUpdate )
41
42 EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlClick )
43 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlUpdate )
44
45 EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL, wxRichTextListStylePage::OnRightParenthesisCtrlClick )
46 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL, wxRichTextListStylePage::OnRightParenthesisCtrlUpdate )
47
48 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL, wxRichTextListStylePage::OnBulletAlignmentCtrlSelected )
49
50 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, wxRichTextListStylePage::OnSymbolstaticUpdate )
51
52 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlSelected )
53 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlUpdated )
54 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlUIUpdate )
55
56 EVT_BUTTON( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL, wxRichTextListStylePage::OnChooseSymbolClick )
57 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL, wxRichTextListStylePage::OnChooseSymbolUpdate )
58
59 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlSelected )
60 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlUpdated )
61 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlUIUpdate )
62
63 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC, wxRichTextListStylePage::OnNamestaticUpdate )
64
65 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlSelected )
66 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlUpdated )
67 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlUIUpdate )
68
69 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT, wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected )
70
71 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT, wxRichTextListStylePage::OnRichtextliststylepageAlignrightSelected )
72
73 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED, wxRichTextListStylePage::OnRichtextliststylepageJustifiedSelected )
74
75 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_CENTERED, wxRichTextListStylePage::OnRichtextliststylepageCenteredSelected )
76
77 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE, wxRichTextListStylePage::OnRichtextliststylepageAlignindeterminateSelected )
78
79 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxRichTextListStylePage::OnIndentLeftUpdated )
80
81 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxRichTextListStylePage::OnIndentFirstLineUpdated )
82
83 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxRichTextListStylePage::OnIndentRightUpdated )
84
85 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxRichTextListStylePage::OnSpacingBeforeUpdated )
86
87 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxRichTextListStylePage::OnSpacingAfterUpdated )
88
89 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_LINESPACING, wxRichTextListStylePage::OnLineSpacingSelected )
90
91 ////@end wxRichTextListStylePage event table entries
92
93 END_EVENT_TABLE()
94
95 IMPLEMENT_HELP_PROVISION(wxRichTextListStylePage)
96
97 /*!
98 * wxRichTextListStylePage constructors
99 */
100
101 wxRichTextListStylePage::wxRichTextListStylePage( )
102 {
103 Init();
104 }
105
106 wxRichTextListStylePage::wxRichTextListStylePage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
107 {
108 Init();
109 Create(parent, id, pos, size, style);
110 }
111
112 /*!
113 * wxRichTextListStylePage creator
114 */
115
116 bool wxRichTextListStylePage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
117 {
118 ////@begin wxRichTextListStylePage creation
119 wxRichTextDialogPage::Create( parent, id, pos, size, style );
120
121 CreateControls();
122 if (GetSizer())
123 {
124 GetSizer()->SetSizeHints(this);
125 }
126 Centre();
127 ////@end wxRichTextListStylePage creation
128 return true;
129 }
130
131 /*!
132 * Member initialisation
133 */
134
135 void wxRichTextListStylePage::Init()
136 {
137 m_dontUpdate = false;
138 m_currentLevel = 1;
139
140 ////@begin wxRichTextListStylePage member initialisation
141 m_levelCtrl = NULL;
142 m_styleListBox = NULL;
143 m_periodCtrl = NULL;
144 m_parenthesesCtrl = NULL;
145 m_rightParenthesisCtrl = NULL;
146 m_bulletAlignmentCtrl = NULL;
147 m_symbolCtrl = NULL;
148 m_symbolFontCtrl = NULL;
149 m_bulletNameCtrl = NULL;
150 m_alignmentLeft = NULL;
151 m_alignmentRight = NULL;
152 m_alignmentJustified = NULL;
153 m_alignmentCentred = NULL;
154 m_alignmentIndeterminate = NULL;
155 m_indentLeft = NULL;
156 m_indentLeftFirst = NULL;
157 m_indentRight = NULL;
158 m_spacingBefore = NULL;
159 m_spacingAfter = NULL;
160 m_spacingLine = NULL;
161 m_previewCtrl = NULL;
162 ////@end wxRichTextListStylePage member initialisation
163 }
164
165 /*!
166 * Control creation for wxRichTextListStylePage
167 */
168
169 void wxRichTextListStylePage::CreateControls()
170 {
171 ////@begin wxRichTextListStylePage content construction
172 wxRichTextListStylePage* itemRichTextDialogPage1 = this;
173
174 wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
175 itemRichTextDialogPage1->SetSizer(itemBoxSizer2);
176
177 wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
178 itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
179
180 wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
181 itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL, 5);
182
183 wxStaticText* itemStaticText5 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&List level:"), wxDefaultPosition, wxDefaultSize, 0 );
184 itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
185
186 m_levelCtrl = new wxSpinCtrl( itemRichTextDialogPage1, ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxT("1"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 10, 1 );
187 m_levelCtrl->SetHelpText(_("Selects the list level to edit."));
188 if (wxRichTextListStylePage::ShowToolTips())
189 m_levelCtrl->SetToolTip(_("Selects the list level to edit."));
190 itemBoxSizer4->Add(m_levelCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
191
192 itemBoxSizer4->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
193
194 wxButton* itemButton8 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT, _("&Font for Level..."), wxDefaultPosition, wxDefaultSize, 0 );
195 itemButton8->SetHelpText(_("Click to choose the font for this level."));
196 if (wxRichTextListStylePage::ShowToolTips())
197 itemButton8->SetToolTip(_("Click to choose the font for this level."));
198 itemBoxSizer4->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
199
200 wxNotebook* itemNotebook9 = new wxNotebook( itemRichTextDialogPage1, ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT|wxBK_TOP );
201
202 wxPanel* itemPanel10 = new wxPanel( itemNotebook9, ID_RICHTEXTLISTSTYLEPAGE_BULLETS, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
203 wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
204 itemPanel10->SetSizer(itemBoxSizer11);
205
206 wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
207 itemBoxSizer11->Add(itemBoxSizer12, 1, wxGROW, 5);
208 wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
209 itemBoxSizer12->Add(itemBoxSizer13, 0, wxGROW, 5);
210 wxStaticText* itemStaticText14 = new wxStaticText( itemPanel10, wxID_STATIC, _("&Bullet style:"), wxDefaultPosition, wxDefaultSize, 0 );
211 itemBoxSizer13->Add(itemStaticText14, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
212
213 wxArrayString m_styleListBoxStrings;
214 m_styleListBox = new wxListBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 80), m_styleListBoxStrings, wxLB_SINGLE );
215 m_styleListBox->SetHelpText(_("The available bullet styles."));
216 if (wxRichTextListStylePage::ShowToolTips())
217 m_styleListBox->SetToolTip(_("The available bullet styles."));
218 itemBoxSizer13->Add(m_styleListBox, 1, wxGROW|wxALL, 5);
219
220 wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL);
221 itemBoxSizer13->Add(itemBoxSizer16, 0, wxGROW, 5);
222 m_periodCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 );
223 m_periodCtrl->SetValue(false);
224 m_periodCtrl->SetHelpText(_("Check to add a period after the bullet."));
225 if (wxRichTextListStylePage::ShowToolTips())
226 m_periodCtrl->SetToolTip(_("Check to add a period after the bullet."));
227 itemBoxSizer16->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
228
229 m_parenthesesCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, _("(*)"), wxDefaultPosition, wxDefaultSize, 0 );
230 m_parenthesesCtrl->SetValue(false);
231 m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses."));
232 if (wxRichTextListStylePage::ShowToolTips())
233 m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses."));
234 itemBoxSizer16->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
235
236 m_rightParenthesisCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL, _("*)"), wxDefaultPosition, wxDefaultSize, 0 );
237 m_rightParenthesisCtrl->SetValue(false);
238 m_rightParenthesisCtrl->SetHelpText(_("Check to add a right parenthesis."));
239 if (wxRichTextListStylePage::ShowToolTips())
240 m_rightParenthesisCtrl->SetToolTip(_("Check to add a right parenthesis."));
241 itemBoxSizer16->Add(m_rightParenthesisCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
242
243 itemBoxSizer13->Add(2, 1, 0, wxALIGN_CENTER_HORIZONTAL, 5);
244
245 wxStaticText* itemStaticText21 = new wxStaticText( itemPanel10, wxID_STATIC, _("Bullet &Alignment:"), wxDefaultPosition, wxDefaultSize, 0 );
246 itemBoxSizer13->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
247
248 wxArrayString m_bulletAlignmentCtrlStrings;
249 m_bulletAlignmentCtrlStrings.Add(_("Left"));
250 m_bulletAlignmentCtrlStrings.Add(_("Centre"));
251 m_bulletAlignmentCtrlStrings.Add(_("Right"));
252 m_bulletAlignmentCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL, _("Left"), wxDefaultPosition, wxSize(60, -1), m_bulletAlignmentCtrlStrings, wxCB_READONLY );
253 m_bulletAlignmentCtrl->SetStringSelection(_("Left"));
254 m_bulletAlignmentCtrl->SetHelpText(_("The bullet character."));
255 if (wxRichTextListStylePage::ShowToolTips())
256 m_bulletAlignmentCtrl->SetToolTip(_("The bullet character."));
257 itemBoxSizer13->Add(m_bulletAlignmentCtrl, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
258
259 itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
260
261 wxStaticLine* itemStaticLine24 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
262 itemBoxSizer12->Add(itemStaticLine24, 0, wxGROW|wxALL, 5);
263
264 itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
265
266 wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
267 itemBoxSizer12->Add(itemBoxSizer26, 0, wxGROW, 5);
268 wxStaticText* itemStaticText27 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
269 itemBoxSizer26->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
270
271 wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
272 itemBoxSizer26->Add(itemBoxSizer28, 0, wxGROW, 5);
273 wxArrayString m_symbolCtrlStrings;
274 m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxEmptyString, wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
275 m_symbolCtrl->SetHelpText(_("The bullet character."));
276 if (wxRichTextListStylePage::ShowToolTips())
277 m_symbolCtrl->SetToolTip(_("The bullet character."));
278 itemBoxSizer28->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
279
280 wxButton* itemButton30 = new wxButton( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 );
281 itemButton30->SetHelpText(_("Click to browse for a symbol."));
282 if (wxRichTextListStylePage::ShowToolTips())
283 itemButton30->SetToolTip(_("Click to browse for a symbol."));
284 itemBoxSizer28->Add(itemButton30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
285
286 itemBoxSizer26->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
287
288 wxStaticText* itemStaticText32 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 );
289 itemBoxSizer26->Add(itemStaticText32, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
290
291 wxArrayString m_symbolFontCtrlStrings;
292 m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
293 if (wxRichTextListStylePage::ShowToolTips())
294 m_symbolFontCtrl->SetToolTip(_("Available fonts."));
295 itemBoxSizer26->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
296
297 itemBoxSizer26->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5);
298
299 wxStaticText* itemStaticText35 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 );
300 itemBoxSizer26->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
301
302 wxArrayString m_bulletNameCtrlStrings;
303 m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
304 m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
305 if (wxRichTextListStylePage::ShowToolTips())
306 m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
307 itemBoxSizer26->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5);
308
309 itemNotebook9->AddPage(itemPanel10, _("Bullet style"));
310
311 wxPanel* itemPanel37 = new wxPanel( itemNotebook9, ID_RICHTEXTLISTSTYLEPAGE_SPACING, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
312 wxBoxSizer* itemBoxSizer38 = new wxBoxSizer(wxVERTICAL);
313 itemPanel37->SetSizer(itemBoxSizer38);
314
315 wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL);
316 itemBoxSizer38->Add(itemBoxSizer39, 0, wxGROW, 5);
317 wxBoxSizer* itemBoxSizer40 = new wxBoxSizer(wxVERTICAL);
318 itemBoxSizer39->Add(itemBoxSizer40, 0, wxGROW, 5);
319 wxStaticText* itemStaticText41 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Alignment"), wxDefaultPosition, wxDefaultSize, 0 );
320 itemBoxSizer40->Add(itemStaticText41, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
321
322 wxBoxSizer* itemBoxSizer42 = new wxBoxSizer(wxHORIZONTAL);
323 itemBoxSizer40->Add(itemBoxSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
324 itemBoxSizer42->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5);
325
326 wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxVERTICAL);
327 itemBoxSizer42->Add(itemBoxSizer44, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5);
328 m_alignmentLeft = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT, _("&Left"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
329 m_alignmentLeft->SetValue(false);
330 m_alignmentLeft->SetHelpText(_("Left-align text."));
331 if (wxRichTextListStylePage::ShowToolTips())
332 m_alignmentLeft->SetToolTip(_("Left-align text."));
333 itemBoxSizer44->Add(m_alignmentLeft, 0, wxALIGN_LEFT|wxALL, 5);
334
335 m_alignmentRight = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT, _("&Right"), wxDefaultPosition, wxDefaultSize, 0 );
336 m_alignmentRight->SetValue(false);
337 m_alignmentRight->SetHelpText(_("Right-align text."));
338 if (wxRichTextListStylePage::ShowToolTips())
339 m_alignmentRight->SetToolTip(_("Right-align text."));
340 itemBoxSizer44->Add(m_alignmentRight, 0, wxALIGN_LEFT|wxALL, 5);
341
342 m_alignmentJustified = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED, _("&Justified"), wxDefaultPosition, wxDefaultSize, 0 );
343 m_alignmentJustified->SetValue(false);
344 m_alignmentJustified->SetHelpText(_("Justify text left and right."));
345 if (wxRichTextListStylePage::ShowToolTips())
346 m_alignmentJustified->SetToolTip(_("Justify text left and right."));
347 itemBoxSizer44->Add(m_alignmentJustified, 0, wxALIGN_LEFT|wxALL, 5);
348
349 m_alignmentCentred = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_CENTERED, _("Cen&tred"), wxDefaultPosition, wxDefaultSize, 0 );
350 m_alignmentCentred->SetValue(false);
351 m_alignmentCentred->SetHelpText(_("Centre text."));
352 if (wxRichTextListStylePage::ShowToolTips())
353 m_alignmentCentred->SetToolTip(_("Centre text."));
354 itemBoxSizer44->Add(m_alignmentCentred, 0, wxALIGN_LEFT|wxALL, 5);
355
356 m_alignmentIndeterminate = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE, _("&Indeterminate"), wxDefaultPosition, wxDefaultSize, 0 );
357 m_alignmentIndeterminate->SetValue(false);
358 m_alignmentIndeterminate->SetHelpText(_("Use the current alignment setting."));
359 if (wxRichTextListStylePage::ShowToolTips())
360 m_alignmentIndeterminate->SetToolTip(_("Use the current alignment setting."));
361 itemBoxSizer44->Add(m_alignmentIndeterminate, 0, wxALIGN_LEFT|wxALL, 5);
362
363 itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
364
365 wxStaticLine* itemStaticLine51 = new wxStaticLine( itemPanel37, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
366 itemBoxSizer39->Add(itemStaticLine51, 0, wxGROW|wxLEFT|wxBOTTOM, 5);
367
368 itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
369
370 wxBoxSizer* itemBoxSizer53 = new wxBoxSizer(wxVERTICAL);
371 itemBoxSizer39->Add(itemBoxSizer53, 0, wxGROW, 5);
372 wxStaticText* itemStaticText54 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Indentation (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 );
373 itemBoxSizer53->Add(itemStaticText54, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
374
375 wxBoxSizer* itemBoxSizer55 = new wxBoxSizer(wxHORIZONTAL);
376 itemBoxSizer53->Add(itemBoxSizer55, 0, wxALIGN_LEFT|wxALL, 5);
377 itemBoxSizer55->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5);
378
379 wxFlexGridSizer* itemFlexGridSizer57 = new wxFlexGridSizer(0, 2, 0, 0);
380 itemBoxSizer55->Add(itemFlexGridSizer57, 0, wxALIGN_CENTER_VERTICAL, 5);
381 wxStaticText* itemStaticText58 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 );
382 itemFlexGridSizer57->Add(itemStaticText58, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
383
384 m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
385 m_indentLeft->SetHelpText(_("The left indent."));
386 if (wxRichTextListStylePage::ShowToolTips())
387 m_indentLeft->SetToolTip(_("The left indent."));
388 itemFlexGridSizer57->Add(m_indentLeft, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
389
390 wxStaticText* itemStaticText60 = new wxStaticText( itemPanel37, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 );
391 itemFlexGridSizer57->Add(itemStaticText60, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
392
393 m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
394 m_indentLeftFirst->SetHelpText(_("The first line indent."));
395 if (wxRichTextListStylePage::ShowToolTips())
396 m_indentLeftFirst->SetToolTip(_("The first line indent."));
397 itemFlexGridSizer57->Add(m_indentLeftFirst, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
398
399 wxStaticText* itemStaticText62 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 );
400 itemFlexGridSizer57->Add(itemStaticText62, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
401
402 m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
403 m_indentRight->SetHelpText(_("The right indent."));
404 if (wxRichTextListStylePage::ShowToolTips())
405 m_indentRight->SetToolTip(_("The right indent."));
406 itemFlexGridSizer57->Add(m_indentRight, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
407
408 itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
409
410 wxStaticLine* itemStaticLine65 = new wxStaticLine( itemPanel37, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
411 itemBoxSizer39->Add(itemStaticLine65, 0, wxGROW|wxTOP|wxBOTTOM, 5);
412
413 itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
414
415 wxBoxSizer* itemBoxSizer67 = new wxBoxSizer(wxVERTICAL);
416 itemBoxSizer39->Add(itemBoxSizer67, 0, wxGROW, 5);
417 wxStaticText* itemStaticText68 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 );
418 itemBoxSizer67->Add(itemStaticText68, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
419
420 wxBoxSizer* itemBoxSizer69 = new wxBoxSizer(wxHORIZONTAL);
421 itemBoxSizer67->Add(itemBoxSizer69, 0, wxALIGN_LEFT|wxALL, 5);
422 itemBoxSizer69->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5);
423
424 wxFlexGridSizer* itemFlexGridSizer71 = new wxFlexGridSizer(0, 2, 0, 0);
425 itemBoxSizer69->Add(itemFlexGridSizer71, 0, wxALIGN_CENTER_VERTICAL, 5);
426 wxStaticText* itemStaticText72 = new wxStaticText( itemPanel37, wxID_STATIC, _("Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 );
427 itemFlexGridSizer71->Add(itemStaticText72, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
428
429 m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
430 m_spacingBefore->SetHelpText(_("The spacing before the paragraph."));
431 if (wxRichTextListStylePage::ShowToolTips())
432 m_spacingBefore->SetToolTip(_("The spacing before the paragraph."));
433 itemFlexGridSizer71->Add(m_spacingBefore, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
434
435 wxStaticText* itemStaticText74 = new wxStaticText( itemPanel37, wxID_STATIC, _("After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 );
436 itemFlexGridSizer71->Add(itemStaticText74, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
437
438 m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 );
439 m_spacingAfter->SetHelpText(_("The spacing after the paragraph."));
440 if (wxRichTextListStylePage::ShowToolTips())
441 m_spacingAfter->SetToolTip(_("The spacing after the paragraph."));
442 itemFlexGridSizer71->Add(m_spacingAfter, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
443
444 wxStaticText* itemStaticText76 = new wxStaticText( itemPanel37, wxID_STATIC, _("Line spacing:"), wxDefaultPosition, wxDefaultSize, 0 );
445 itemFlexGridSizer71->Add(itemStaticText76, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
446
447 wxArrayString m_spacingLineStrings;
448 m_spacingLineStrings.Add(_("(none)"));
449 m_spacingLineStrings.Add(_("Single"));
450 m_spacingLineStrings.Add(_("1.1"));
451 m_spacingLineStrings.Add(_("1.2"));
452 m_spacingLineStrings.Add(_("1.3"));
453 m_spacingLineStrings.Add(_("1.4"));
454 m_spacingLineStrings.Add(_("1.5"));
455 m_spacingLineStrings.Add(_("1.6"));
456 m_spacingLineStrings.Add(_("1.7"));
457 m_spacingLineStrings.Add(_("1.8"));
458 m_spacingLineStrings.Add(_("1.9"));
459 m_spacingLineStrings.Add(_("2"));
460 m_spacingLine = new wxComboBox( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_LINESPACING, _("(none)"), wxDefaultPosition, wxSize(85, -1), m_spacingLineStrings, wxCB_READONLY );
461 m_spacingLine->SetStringSelection(_("(none)"));
462 m_spacingLine->SetHelpText(_("The line spacing."));
463 if (wxRichTextListStylePage::ShowToolTips())
464 m_spacingLine->SetToolTip(_("The line spacing."));
465 itemFlexGridSizer71->Add(m_spacingLine, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
466
467 itemNotebook9->AddPage(itemPanel37, _("Spacing"));
468
469 itemBoxSizer3->Add(itemNotebook9, 0, wxGROW|wxALL, 5);
470
471 m_previewCtrl = new wxRichTextCtrl( itemRichTextDialogPage1, ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 140), wxBORDER_THEME|wxVSCROLL|wxTE_READONLY );
472 m_previewCtrl->SetHelpText(_("Shows a preview of the bullet settings."));
473 if (wxRichTextListStylePage::ShowToolTips())
474 m_previewCtrl->SetToolTip(_("Shows a preview of the bullet settings."));
475 itemBoxSizer3->Add(m_previewCtrl, 0, wxGROW|wxALL, 5);
476
477 ////@end wxRichTextListStylePage content construction
478
479 m_dontUpdate = true;
480
481 m_styleListBox->Append(_("(None)"));
482 m_styleListBox->Append(_("Arabic"));
483 m_styleListBox->Append(_("Upper case letters"));
484 m_styleListBox->Append(_("Lower case letters"));
485 m_styleListBox->Append(_("Upper case roman numerals"));
486 m_styleListBox->Append(_("Lower case roman numerals"));
487 m_styleListBox->Append(_("Numbered outline"));
488 m_styleListBox->Append(_("Symbol"));
489 m_styleListBox->Append(_("Bitmap"));
490 m_styleListBox->Append(_("Standard"));
491
492 m_symbolCtrl->Append(_("*"));
493 m_symbolCtrl->Append(_("-"));
494 m_symbolCtrl->Append(_(">"));
495 m_symbolCtrl->Append(_("+"));
496 m_symbolCtrl->Append(_("~"));
497
498 wxArrayString standardBulletNames;
499 if (wxRichTextBuffer::GetRenderer())
500 wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames);
501
502 m_bulletNameCtrl->Append(standardBulletNames);
503 wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames();
504 facenames.Sort();
505
506 m_symbolFontCtrl->Append(facenames);
507
508 m_levelCtrl->SetValue(m_currentLevel);
509
510 m_dontUpdate = false;
511 }
512
513 /// Updates the font preview
514 void wxRichTextListStylePage::UpdatePreview()
515 {
516 static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \
517 Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n");
518
519 static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Nullam vitae justo id mauris lobortis interdum.\n");
520
521 static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \
522 iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");
523
524 wxRichTextListStyleDefinition* def = wxDynamicCast(wxRichTextFormattingDialog::GetDialogStyleDefinition(this),
525 wxRichTextListStyleDefinition);
526
527 wxRichTextStyleSheet* styleSheet = wxRichTextFormattingDialog::GetDialog(this)->GetStyleSheet();
528
529 wxRichTextAttr attr((const wxRichTextAttr &)(styleSheet ? def->GetStyle() : def->GetStyleMergedWithBase(styleSheet)));
530
531 attr.SetFlags(attr.GetFlags() &
532 (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|
533 wxTEXT_ATTR_LINE_SPACING|
534 wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT));
535
536 wxFont font(m_previewCtrl->GetFont());
537 font.SetPointSize(9);
538 m_previewCtrl->SetFont(font);
539
540 wxRichTextAttr normalParaAttr;
541 normalParaAttr.SetFont(font);
542 normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY")));
543
544 m_previewCtrl->Freeze();
545 m_previewCtrl->Clear();
546
547 m_previewCtrl->BeginStyle(normalParaAttr);
548 m_previewCtrl->WriteText(s_para1);
549 m_previewCtrl->EndStyle();
550
551 m_previewCtrl->BeginStyle(attr);
552 long listStart = m_previewCtrl->GetInsertionPoint() + 1;
553
554 int i;
555 for (i = 0; i < 10; i++)
556 {
557 wxRichTextAttr levelAttr = * def->GetLevelAttributes(i);
558 levelAttr.SetBulletNumber(1);
559 m_previewCtrl->BeginStyle(levelAttr);
560 m_previewCtrl->WriteText(wxString::Format(wxT("List level %d. "), i+1) + s_para2);
561 m_previewCtrl->EndStyle();
562 }
563 m_previewCtrl->EndStyle();
564 long listEnd = m_previewCtrl->GetInsertionPoint();
565
566 m_previewCtrl->BeginStyle(normalParaAttr);
567 m_previewCtrl->WriteText(s_para3);
568 m_previewCtrl->EndStyle();
569
570 m_previewCtrl->NumberList(wxRichTextRange(listStart, listEnd), def);
571
572 m_previewCtrl->Thaw();
573 }
574
575 /// Transfer data from/to window
576 bool wxRichTextListStylePage::TransferDataFromWindow()
577 {
578 wxPanel::TransferDataFromWindow();
579
580 m_currentLevel = m_levelCtrl->GetValue();
581
582 wxRichTextAttr* attr = GetAttributesForSelection();
583
584 if (m_alignmentLeft->GetValue())
585 attr->SetAlignment(wxTEXT_ALIGNMENT_LEFT);
586 else if (m_alignmentCentred->GetValue())
587 attr->SetAlignment(wxTEXT_ALIGNMENT_CENTRE);
588 else if (m_alignmentRight->GetValue())
589 attr->SetAlignment(wxTEXT_ALIGNMENT_RIGHT);
590 else if (m_alignmentJustified->GetValue())
591 attr->SetAlignment(wxTEXT_ALIGNMENT_JUSTIFIED);
592 else
593 {
594 attr->SetAlignment(wxTEXT_ALIGNMENT_DEFAULT);
595 attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_ALIGNMENT));
596 }
597
598 wxString leftIndent(m_indentLeft->GetValue());
599 wxString leftFirstIndent(m_indentLeftFirst->GetValue());
600 if (!leftIndent.empty())
601 {
602 int visualLeftIndent = wxAtoi(leftIndent);
603 int visualLeftFirstIndent = wxAtoi(leftFirstIndent);
604 int actualLeftIndent = visualLeftFirstIndent;
605 int actualLeftSubIndent = visualLeftIndent - visualLeftFirstIndent;
606
607 attr->SetLeftIndent(actualLeftIndent, actualLeftSubIndent);
608 }
609 else
610 attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LEFT_INDENT));
611
612 wxString rightIndent(m_indentRight->GetValue());
613 if (!rightIndent.empty())
614 attr->SetRightIndent(wxAtoi(rightIndent));
615 else
616 attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_RIGHT_INDENT));
617
618 wxString spacingAfter(m_spacingAfter->GetValue());
619 if (!spacingAfter.empty())
620 attr->SetParagraphSpacingAfter(wxAtoi(spacingAfter));
621 else
622 attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_AFTER));
623
624 wxString spacingBefore(m_spacingBefore->GetValue());
625 if (!spacingBefore.empty())
626 attr->SetParagraphSpacingBefore(wxAtoi(spacingBefore));
627 else
628 attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE));
629
630 int spacingIndex = m_spacingLine->GetSelection() - 1;
631 int lineSpacing = 0;
632 if (spacingIndex > -1)
633 lineSpacing = 10 + spacingIndex;
634
635 if (lineSpacing == 0)
636 attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LINE_SPACING));
637 else
638 attr->SetLineSpacing(lineSpacing);
639
640 /// BULLETS
641 // if (m_hasBulletStyle)
642 {
643 long bulletStyle = 0;
644
645 int index = m_styleListBox->GetSelection();
646 if (index == wxRICHTEXT_BULLETINDEX_ARABIC)
647 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ARABIC;
648
649 else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE)
650 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER;
651
652 else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE)
653 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER;
654
655 else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN)
656 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER;
657
658 else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN)
659 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER;
660
661 else if (index == wxRICHTEXT_BULLETINDEX_OUTLINE)
662 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_OUTLINE;
663
664 else if (index == wxRICHTEXT_BULLETINDEX_SYMBOL)
665 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL;
666
667 else if (index == wxRICHTEXT_BULLETINDEX_BITMAP)
668 {
669 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP;
670 if (m_bulletNameCtrl->GetValue().IsEmpty())
671 attr->SetFlags(attr->GetFlags() & ~wxTEXT_ATTR_BULLET_NAME);
672 else
673 attr->SetBulletName(m_bulletNameCtrl->GetValue());
674 }
675
676 else if (index == wxRICHTEXT_BULLETINDEX_STANDARD)
677 {
678 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD;
679 attr->SetBulletName(m_bulletNameCtrl->GetValue());
680 }
681
682 if (m_parenthesesCtrl->GetValue())
683 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
684 if (m_rightParenthesisCtrl->GetValue())
685 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS;
686 if (m_periodCtrl->GetValue())
687 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PERIOD;
688
689 if (m_bulletAlignmentCtrl->GetSelection() == 1)
690 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE;
691 else if (m_bulletAlignmentCtrl->GetSelection() == 2)
692 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT;
693 // Left is implied
694
695 attr->SetBulletStyle(bulletStyle);
696 }
697
698 // if (m_hasBulletSymbol)
699 {
700 attr->SetBulletText(m_symbolCtrl->GetValue());
701 attr->SetBulletFont(m_symbolFontCtrl->GetValue());
702 }
703
704 return true;
705 }
706
707 bool wxRichTextListStylePage::TransferDataToWindow()
708 {
709 DoTransferDataToWindow();
710 UpdatePreview();
711
712 return true;
713 }
714
715 /// Just transfer to the window
716 void wxRichTextListStylePage::DoTransferDataToWindow()
717 {
718 m_dontUpdate = true;
719
720 wxPanel::TransferDataToWindow();
721
722 wxRichTextAttr* attr = GetAttributesForSelection();
723
724 if (attr->HasAlignment())
725 {
726 if (attr->GetAlignment() == wxTEXT_ALIGNMENT_LEFT)
727 m_alignmentLeft->SetValue(true);
728 else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_RIGHT)
729 m_alignmentRight->SetValue(true);
730 else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
731 m_alignmentCentred->SetValue(true);
732 else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED)
733 m_alignmentJustified->SetValue(true);
734 else
735 m_alignmentIndeterminate->SetValue(true);
736 }
737 else
738 m_alignmentIndeterminate->SetValue(true);
739
740 if (attr->HasLeftIndent())
741 {
742 wxString leftIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent() + attr->GetLeftSubIndent()));
743 wxString leftFirstIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent()));
744
745 m_indentLeft->SetValue(leftIndent);
746 m_indentLeftFirst->SetValue(leftFirstIndent);
747 }
748 else
749 {
750 m_indentLeft->SetValue(wxEmptyString);
751 m_indentLeftFirst->SetValue(wxEmptyString);
752 }
753
754 if (attr->HasRightIndent())
755 {
756 wxString rightIndent(wxString::Format(wxT("%ld"), attr->GetRightIndent()));
757
758 m_indentRight->SetValue(rightIndent);
759 }
760 else
761 m_indentRight->SetValue(wxEmptyString);
762
763 if (attr->HasParagraphSpacingAfter())
764 {
765 wxString spacingAfter(wxString::Format(wxT("%d"), attr->GetParagraphSpacingAfter()));
766
767 m_spacingAfter->SetValue(spacingAfter);
768 }
769 else
770 m_spacingAfter->SetValue(wxEmptyString);
771
772 if (attr->HasParagraphSpacingBefore())
773 {
774 wxString spacingBefore(wxString::Format(wxT("%d"), attr->GetParagraphSpacingBefore()));
775
776 m_spacingBefore->SetValue(spacingBefore);
777 }
778 else
779 m_spacingBefore->SetValue(wxEmptyString);
780
781 if (attr->HasLineSpacing())
782 {
783 int index = 0;
784
785 int lineSpacing = attr->GetLineSpacing();
786 if (lineSpacing >= 10 && lineSpacing <= 20)
787 index = (lineSpacing - 10) + 1;
788 else
789 index = 0;
790
791 m_spacingLine->SetSelection(index);
792 }
793 else
794 m_spacingLine->SetSelection(0);
795
796 /// BULLETS
797 if (attr->HasBulletStyle())
798 {
799 int index = 0;
800 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC)
801 index = wxRICHTEXT_BULLETINDEX_ARABIC;
802
803 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER)
804 index = wxRICHTEXT_BULLETINDEX_UPPER_CASE;
805
806 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER)
807 index = wxRICHTEXT_BULLETINDEX_LOWER_CASE;
808
809 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER)
810 index = wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN;
811
812 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER)
813 index = wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN;
814
815 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE)
816 index = wxRICHTEXT_BULLETINDEX_OUTLINE;
817
818 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
819 index = wxRICHTEXT_BULLETINDEX_SYMBOL;
820
821 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP)
822 index = wxRICHTEXT_BULLETINDEX_BITMAP;
823
824 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD)
825 index = wxRICHTEXT_BULLETINDEX_STANDARD;
826
827 m_styleListBox->SetSelection(index);
828
829 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES)
830 m_parenthesesCtrl->SetValue(true);
831 else
832 m_parenthesesCtrl->SetValue(false);
833
834 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS)
835 m_rightParenthesisCtrl->SetValue(true);
836 else
837 m_rightParenthesisCtrl->SetValue(false);
838
839 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD)
840 m_periodCtrl->SetValue(true);
841 else
842 m_periodCtrl->SetValue(false);
843
844 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE)
845 m_bulletAlignmentCtrl->SetSelection(1);
846 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT)
847 m_bulletAlignmentCtrl->SetSelection(2);
848 else
849 m_bulletAlignmentCtrl->SetSelection(0);
850 }
851 else
852 {
853 m_styleListBox->SetSelection(-1);
854 m_bulletAlignmentCtrl->SetSelection(-1);
855 }
856
857 if (attr->HasBulletText())
858 {
859 m_symbolCtrl->SetValue(attr->GetBulletText());
860 m_symbolFontCtrl->SetValue(attr->GetBulletFont());
861 }
862 else
863 m_symbolCtrl->SetValue(wxEmptyString);
864
865 if (attr->HasBulletName())
866 m_bulletNameCtrl->SetValue(attr->GetBulletName());
867 else
868 m_bulletNameCtrl->SetValue(wxEmptyString);
869
870 m_dontUpdate = false;
871 }
872
873 /// Get attributes for selected level
874 wxRichTextAttr* wxRichTextListStylePage::GetAttributesForSelection()
875 {
876 wxRichTextListStyleDefinition* def = wxDynamicCast(wxRichTextFormattingDialog::GetDialogStyleDefinition(this),
877 wxRichTextListStyleDefinition);
878
879 int value = m_levelCtrl->GetValue();
880
881 if (def)
882 return def->GetLevelAttributes(value-1);
883 else
884 return NULL;
885 }
886
887 /// Just transfer from the window and update the preview
888 void wxRichTextListStylePage::TransferAndPreview()
889 {
890 if (!m_dontUpdate)
891 {
892 TransferDataFromWindow();
893 UpdatePreview();
894 }
895 }
896
897
898 /*!
899 * wxEVT_SPINCTRL event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
900 */
901
902 void wxRichTextListStylePage::OnLevelUpdated( wxSpinEvent& WXUNUSED(event) )
903 {
904 if (!m_dontUpdate)
905 {
906 m_currentLevel = m_levelCtrl->GetValue();
907 TransferDataToWindow();
908 }
909 }
910
911 /*!
912 * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
913 */
914
915 void wxRichTextListStylePage::OnLevelUp( wxSpinEvent& event )
916 {
917 if (!m_dontUpdate)
918 {
919 m_currentLevel = event.GetPosition();
920 TransferDataToWindow();
921 }
922 }
923
924 /*!
925 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
926 */
927
928 void wxRichTextListStylePage::OnLevelDown( wxSpinEvent& event )
929 {
930 if (!m_dontUpdate)
931 {
932 m_currentLevel = event.GetPosition();
933 TransferDataToWindow();
934 }
935 }
936
937 /*!
938 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
939 */
940
941 void wxRichTextListStylePage::OnLevelTextUpdated( wxCommandEvent& WXUNUSED(event) )
942 {
943 // Can cause problems
944 #if 0
945 if (!m_dontUpdate)
946 {
947 m_currentLevel = event.GetInt();
948 TransferDataToWindow();
949 }
950 #endif
951 }
952
953 /*!
954 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
955 */
956
957 void wxRichTextListStylePage::OnLevelUIUpdate( wxUpdateUIEvent& event )
958 {
959 ////@begin wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL in wxRichTextListStylePage.
960 // Before editing this code, remove the block markers.
961 event.Skip();
962 ////@end wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL in wxRichTextListStylePage.
963 }
964
965 /*!
966 * wxEVT_LISTBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
967 */
968
969 void wxRichTextListStylePage::OnStylelistboxSelected( wxCommandEvent& WXUNUSED(event) )
970 {
971 TransferAndPreview();
972 }
973
974 /*!
975 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
976 */
977
978 void wxRichTextListStylePage::OnSymbolstaticUpdate( wxUpdateUIEvent& event )
979 {
980 OnSymbolUpdate(event);
981 }
982
983 /*!
984 * wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
985 */
986
987 void wxRichTextListStylePage::OnSymbolctrlSelected( wxCommandEvent& WXUNUSED(event) )
988 {
989 TransferAndPreview();
990 }
991
992 /*!
993 * wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
994 */
995
996 void wxRichTextListStylePage::OnSymbolctrlUpdated( wxCommandEvent& WXUNUSED(event) )
997 {
998 TransferAndPreview();
999 }
1000
1001 /*!
1002 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
1003 */
1004
1005 void wxRichTextListStylePage::OnSymbolctrlUIUpdate( wxUpdateUIEvent& event )
1006 {
1007 OnSymbolUpdate(event);
1008 }
1009
1010 /*!
1011 * wxEVT_BUTTON event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
1012 */
1013
1014 void wxRichTextListStylePage::OnChooseSymbolClick( wxCommandEvent& WXUNUSED(event) )
1015 {
1016 int sel = m_styleListBox->GetSelection();
1017 if (sel == wxRICHTEXT_BULLETINDEX_SYMBOL)
1018 {
1019 wxString symbol = m_symbolCtrl->GetValue();
1020 wxString fontName = m_symbolFontCtrl->GetValue();
1021 wxSymbolPickerDialog dlg(symbol, fontName, fontName, this);
1022
1023 if (dlg.ShowModal() == wxID_OK)
1024 {
1025 m_dontUpdate = true;
1026
1027 m_symbolCtrl->SetValue(dlg.GetSymbol());
1028 m_symbolFontCtrl->SetValue(dlg.GetFontName());
1029
1030 TransferAndPreview();
1031
1032 m_dontUpdate = false;
1033 }
1034 }
1035 }
1036
1037 /*!
1038 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
1039 */
1040
1041 void wxRichTextListStylePage::OnChooseSymbolUpdate( wxUpdateUIEvent& event )
1042 {
1043 OnSymbolUpdate(event);
1044 }
1045
1046 /*!
1047 * wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
1048 */
1049
1050 void wxRichTextListStylePage::OnSymbolfontctrlSelected( wxCommandEvent& WXUNUSED(event) )
1051 {
1052 TransferAndPreview();
1053 }
1054
1055 /*!
1056 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
1057 */
1058
1059 void wxRichTextListStylePage::OnSymbolfontctrlUpdated( wxCommandEvent& WXUNUSED(event) )
1060 {
1061 TransferAndPreview();
1062 }
1063
1064 /*!
1065 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
1066 */
1067
1068 void wxRichTextListStylePage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event )
1069 {
1070 OnSymbolUpdate(event);
1071 }
1072
1073 /*!
1074 * wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL
1075 */
1076
1077 void wxRichTextListStylePage::OnParenthesesctrlClick( wxCommandEvent& WXUNUSED(event) )
1078 {
1079 TransferAndPreview();
1080 }
1081
1082 /*!
1083 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL
1084 */
1085
1086 void wxRichTextListStylePage::OnParenthesesctrlUpdate( wxUpdateUIEvent& event )
1087 {
1088 int sel = m_styleListBox->GetSelection();
1089 event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
1090 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
1091 sel != wxRICHTEXT_BULLETINDEX_NONE));
1092 }
1093
1094 /*!
1095 * wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
1096 */
1097
1098 void wxRichTextListStylePage::OnPeriodctrlClick( wxCommandEvent& WXUNUSED(event) )
1099 {
1100 TransferAndPreview();
1101 }
1102
1103 /*!
1104 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
1105 */
1106
1107 void wxRichTextListStylePage::OnPeriodctrlUpdate( wxUpdateUIEvent& event )
1108 {
1109 int sel = m_styleListBox->GetSelection();
1110 event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
1111 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
1112 sel != wxRICHTEXT_BULLETINDEX_NONE));
1113 }
1114
1115 /*!
1116 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
1117 */
1118
1119 void wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected( wxCommandEvent& WXUNUSED(event) )
1120 {
1121 TransferAndPreview();
1122 }
1123
1124 /*!
1125 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
1126 */
1127
1128 void wxRichTextListStylePage::OnRichtextliststylepageAlignrightSelected( wxCommandEvent& WXUNUSED(event) )
1129 {
1130 TransferAndPreview();
1131 }
1132
1133 /*!
1134 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
1135 */
1136
1137 void wxRichTextListStylePage::OnRichtextliststylepageJustifiedSelected( wxCommandEvent& WXUNUSED(event) )
1138 {
1139 TransferAndPreview();
1140 }
1141
1142 /*!
1143 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED
1144 */
1145
1146 void wxRichTextListStylePage::OnRichtextliststylepageCenteredSelected( wxCommandEvent& WXUNUSED(event) )
1147 {
1148 TransferAndPreview();
1149 }
1150
1151 /*!
1152 * wxEVT_RADIOBUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
1153 */
1154
1155 void wxRichTextListStylePage::OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent& WXUNUSED(event) )
1156 {
1157 TransferAndPreview();
1158 }
1159
1160 /*!
1161 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
1162 */
1163
1164 void wxRichTextListStylePage::OnIndentLeftUpdated( wxCommandEvent& WXUNUSED(event) )
1165 {
1166 TransferAndPreview();
1167 }
1168
1169 /*!
1170 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
1171 */
1172
1173 void wxRichTextListStylePage::OnIndentFirstLineUpdated( wxCommandEvent& WXUNUSED(event) )
1174 {
1175 TransferAndPreview();
1176 }
1177
1178 /*!
1179 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
1180 */
1181
1182 void wxRichTextListStylePage::OnIndentRightUpdated( wxCommandEvent& WXUNUSED(event) )
1183 {
1184 TransferAndPreview();
1185 }
1186
1187 /*!
1188 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
1189 */
1190
1191 void wxRichTextListStylePage::OnSpacingBeforeUpdated( wxCommandEvent& WXUNUSED(event) )
1192 {
1193 TransferAndPreview();
1194 }
1195
1196 /*!
1197 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
1198 */
1199
1200 void wxRichTextListStylePage::OnSpacingAfterUpdated( wxCommandEvent& WXUNUSED(event) )
1201 {
1202 TransferAndPreview();
1203 }
1204
1205 /*!
1206 * wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
1207 */
1208
1209 void wxRichTextListStylePage::OnLineSpacingSelected( wxCommandEvent& WXUNUSED(event) )
1210 {
1211 TransferAndPreview();
1212 }
1213
1214 /*!
1215 * Should we show tooltips?
1216 */
1217
1218 bool wxRichTextListStylePage::ShowToolTips()
1219 {
1220 return wxRichTextFormattingDialog::ShowToolTips();
1221 }
1222
1223 /*!
1224 * Get bitmap resources
1225 */
1226
1227 wxBitmap wxRichTextListStylePage::GetBitmapResource( const wxString& name )
1228 {
1229 // Bitmap retrieval
1230 ////@begin wxRichTextListStylePage bitmap retrieval
1231 wxUnusedVar(name);
1232 return wxNullBitmap;
1233 ////@end wxRichTextListStylePage bitmap retrieval
1234 }
1235
1236 /*!
1237 * Get icon resources
1238 */
1239
1240 wxIcon wxRichTextListStylePage::GetIconResource( const wxString& name )
1241 {
1242 // Icon retrieval
1243 ////@begin wxRichTextListStylePage icon retrieval
1244 wxUnusedVar(name);
1245 return wxNullIcon;
1246 ////@end wxRichTextListStylePage icon retrieval
1247 }
1248
1249 /// Update for symbol-related controls
1250 void wxRichTextListStylePage::OnSymbolUpdate( wxUpdateUIEvent& event )
1251 {
1252 int sel = m_styleListBox->GetSelection();
1253 event.Enable(sel == wxRICHTEXT_BULLETINDEX_SYMBOL);
1254 }
1255
1256 /// Update for number-related controls
1257 void wxRichTextListStylePage::OnNumberUpdate( wxUpdateUIEvent& event )
1258 {
1259 int sel = m_styleListBox->GetSelection();
1260 event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
1261 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
1262 sel != wxRICHTEXT_BULLETINDEX_STANDARD &&
1263 sel != wxRICHTEXT_BULLETINDEX_NONE));
1264 }
1265
1266 /// Update for standard bullet-related controls
1267 void wxRichTextListStylePage::OnStandardBulletUpdate( wxUpdateUIEvent& event )
1268 {
1269 int sel = m_styleListBox->GetSelection();
1270 event.Enable( sel == wxRICHTEXT_BULLETINDEX_STANDARD || sel == wxRICHTEXT_BULLETINDEX_BITMAP );
1271 }
1272
1273 /*!
1274 * wxEVT_BUTTON event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
1275 */
1276
1277 void wxRichTextListStylePage::OnChooseFontClick( wxCommandEvent& WXUNUSED(event) )
1278 {
1279 wxRichTextAttr* attr = GetAttributesForSelection();
1280
1281 int pages = wxRICHTEXT_FORMAT_FONT;
1282 wxRichTextFormattingDialog formatDlg;
1283 formatDlg.SetStyle(*attr, false);
1284 formatDlg.Create(pages, this);
1285
1286 if (formatDlg.ShowModal() == wxID_OK)
1287 {
1288 (*attr) = formatDlg.GetAttributes();
1289 TransferAndPreview();
1290 }
1291 }
1292 /*!
1293 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC
1294 */
1295
1296 void wxRichTextListStylePage::OnNamestaticUpdate( wxUpdateUIEvent& event )
1297 {
1298 OnStandardBulletUpdate(event);
1299 }
1300
1301 /*!
1302 * wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
1303 */
1304
1305 void wxRichTextListStylePage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) )
1306 {
1307 TransferAndPreview();
1308 }
1309
1310 /*!
1311 * wxEVT_TEXT event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
1312 */
1313
1314 void wxRichTextListStylePage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) )
1315 {
1316 TransferAndPreview();
1317 }
1318
1319 /*!
1320 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL
1321 */
1322
1323 void wxRichTextListStylePage::OnNamectrlUIUpdate( wxUpdateUIEvent& event )
1324 {
1325 OnStandardBulletUpdate(event);
1326 }
1327 /*!
1328 * wxEVT_CHECKBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
1329 */
1330
1331 void wxRichTextListStylePage::OnRightParenthesisCtrlClick( wxCommandEvent& WXUNUSED(event) )
1332 {
1333 TransferAndPreview();
1334 }
1335
1336 /*!
1337 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL
1338 */
1339
1340 void wxRichTextListStylePage::OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event )
1341 {
1342 int sel = m_styleListBox->GetSelection();
1343 event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
1344 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
1345 sel != wxRICHTEXT_BULLETINDEX_NONE));
1346 }
1347
1348 /*!
1349 * wxEVT_COMBOBOX event handler for ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL
1350 */
1351
1352 void wxRichTextListStylePage::OnBulletAlignmentCtrlSelected( wxCommandEvent& WXUNUSED(event) )
1353 {
1354 TransferAndPreview();
1355 }