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