]> git.saurik.com Git - wxWidgets.git/blame - src/richtext/richtextbulletspage.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / richtext / richtextbulletspage.cpp
CommitLineData
97ff49b3 1/////////////////////////////////////////////////////////////////////////////
b68603d5 2// Name: src/richtext/richtextbulletspage.cpp
97ff49b3
JS
3// Purpose:
4// Author: Julian Smart
5// Modified by:
6// Created: 10/4/2006 10:32:31 AM
b68603d5 7// RCS-ID: $Id$
97ff49b3 8// Copyright: (c) Julian Smart
b68603d5 9// Licence: wxWindows licence
97ff49b3
JS
10/////////////////////////////////////////////////////////////////////////////
11
b68603d5
WS
12#if wxUSE_RICHTEXT
13
14#include "wx/richtext/richtextbulletspage.h"
15
97ff49b3 16#include "wx/richtext/richtextsymboldlg.h"
97ff49b3 17
97ff49b3
JS
18/*!
19 * wxRichTextBulletsPage type definition
20 */
21
22IMPLEMENT_DYNAMIC_CLASS( wxRichTextBulletsPage, wxPanel )
23
24/*!
25 * wxRichTextBulletsPage event table definition
26 */
27
28BEGIN_EVENT_TABLE( wxRichTextBulletsPage, wxPanel )
29
30////@begin wxRichTextBulletsPage event table entries
31 EVT_LISTBOX( ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxRichTextBulletsPage::OnStylelistboxSelected )
32
f089713f
JS
33 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlClick )
34 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlUpdate )
35
36 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlClick )
37 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlUpdate )
38
d2d0adc7
JS
39 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, wxRichTextBulletsPage::OnRightParenthesisCtrlClick )
40 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, wxRichTextBulletsPage::OnRightParenthesisCtrlUpdate )
f089713f 41
d2d0adc7 42 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL, wxRichTextBulletsPage::OnBulletAlignmentCtrlSelected )
f089713f 43
97ff49b3
JS
44 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, wxRichTextBulletsPage::OnSymbolstaticUpdate )
45
46 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlSelected )
47 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlUpdated )
48 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlUpdate )
49
50 EVT_BUTTON( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, wxRichTextBulletsPage::OnChooseSymbolClick )
51 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, wxRichTextBulletsPage::OnChooseSymbolUpdate )
52
53 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlSelected )
54 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlUpdated )
55 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate )
56
f089713f 57 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NAMESTATIC, wxRichTextBulletsPage::OnNamestaticUpdate )
97ff49b3 58
f089713f
JS
59 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlSelected )
60 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlUpdated )
61 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlUIUpdate )
97ff49b3 62
d2d0adc7
JS
63 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, wxRichTextBulletsPage::OnNumberstaticUpdate )
64
65 EVT_SPINCTRL( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdated )
66 EVT_SPIN_UP( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUp )
67 EVT_SPIN_DOWN( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlDown )
68 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlTextUpdated )
69 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdate )
70
97ff49b3
JS
71////@end wxRichTextBulletsPage event table entries
72
73END_EVENT_TABLE()
74
75/*!
76 * wxRichTextBulletsPage constructors
77 */
78
79wxRichTextBulletsPage::wxRichTextBulletsPage( )
80{
81 Init();
82}
83
84wxRichTextBulletsPage::wxRichTextBulletsPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
85{
86 Init();
87 Create(parent, id, pos, size, style);
88}
89
90/*!
91 * Initialise members
92 */
5778b3c8 93
97ff49b3
JS
94void wxRichTextBulletsPage::Init()
95{
96 m_hasBulletStyle = false;
97 m_hasBulletNumber = false;
98 m_hasBulletSymbol = false;
99 m_dontUpdate = false;
100
101////@begin wxRichTextBulletsPage member initialisation
102 m_styleListBox = NULL;
f089713f
JS
103 m_periodCtrl = NULL;
104 m_parenthesesCtrl = NULL;
d2d0adc7
JS
105 m_rightParenthesisCtrl = NULL;
106 m_bulletAlignmentCtrl = NULL;
97ff49b3
JS
107 m_symbolCtrl = NULL;
108 m_symbolFontCtrl = NULL;
f089713f 109 m_bulletNameCtrl = NULL;
d2d0adc7 110 m_numberCtrl = NULL;
97ff49b3
JS
111 m_previewCtrl = NULL;
112////@end wxRichTextBulletsPage member initialisation
113}
114
115/*!
116 * wxRichTextBulletsPage creator
117 */
118
119bool wxRichTextBulletsPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
120{
121////@begin wxRichTextBulletsPage creation
122 wxPanel::Create( parent, id, pos, size, style );
123
124 CreateControls();
125 if (GetSizer())
126 {
127 GetSizer()->SetSizeHints(this);
128 }
129 Centre();
130////@end wxRichTextBulletsPage creation
131 return true;
132}
133
134/*!
135 * Control creation for wxRichTextBulletsPage
136 */
137
138void wxRichTextBulletsPage::CreateControls()
139{
140////@begin wxRichTextBulletsPage content construction
141 wxRichTextBulletsPage* itemPanel1 = this;
142
143 wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
144 itemPanel1->SetSizer(itemBoxSizer2);
145
146 wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
147 itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
148
149 wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
150 itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5);
151
152 wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
153 itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5);
154
155 wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Bullet style:"), wxDefaultPosition, wxDefaultSize, 0 );
69ce77e2 156 itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
97ff49b3 157
6103234e 158 wxArrayString m_styleListBoxStrings;
2fce6547 159 m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 90), m_styleListBoxStrings, wxLB_SINGLE );
dadd4f55 160 m_styleListBox->SetHelpText(_("The available bullet styles."));
6103234e 161 if (wxRichTextBulletsPage::ShowToolTips())
dadd4f55 162 m_styleListBox->SetToolTip(_("The available bullet styles."));
f089713f
JS
163 itemBoxSizer5->Add(m_styleListBox, 1, wxGROW|wxALL, 5);
164
165 wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
166 itemBoxSizer5->Add(itemBoxSizer8, 0, wxGROW, 5);
167
168 m_periodCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 );
169 m_periodCtrl->SetValue(false);
170 m_periodCtrl->SetHelpText(_("Check to add a period after the bullet."));
6103234e 171 if (wxRichTextBulletsPage::ShowToolTips())
f089713f
JS
172 m_periodCtrl->SetToolTip(_("Check to add a period after the bullet."));
173 itemBoxSizer8->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
174
d2d0adc7 175 m_parenthesesCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, _("(*)"), wxDefaultPosition, wxDefaultSize, 0 );
f089713f
JS
176 m_parenthesesCtrl->SetValue(false);
177 m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses."));
6103234e 178 if (wxRichTextBulletsPage::ShowToolTips())
f089713f
JS
179 m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses."));
180 itemBoxSizer8->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
181
d2d0adc7
JS
182 m_rightParenthesisCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, _("*)"), wxDefaultPosition, wxDefaultSize, 0 );
183 m_rightParenthesisCtrl->SetValue(false);
184 m_rightParenthesisCtrl->SetHelpText(_("Check to add a right parenthesis."));
6103234e 185 if (wxRichTextBulletsPage::ShowToolTips())
d2d0adc7
JS
186 m_rightParenthesisCtrl->SetToolTip(_("Check to add a right parenthesis."));
187 itemBoxSizer8->Add(m_rightParenthesisCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
f089713f 188
d2d0adc7 189 itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
f089713f 190
d2d0adc7 191 wxStaticText* itemStaticText13 = new wxStaticText( itemPanel1, wxID_STATIC, _("Bullet &Alignment:"), wxDefaultPosition, wxDefaultSize, 0 );
69ce77e2 192 itemBoxSizer5->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
d2d0adc7 193
6103234e
JS
194 wxArrayString m_bulletAlignmentCtrlStrings;
195 m_bulletAlignmentCtrlStrings.Add(_("Left"));
196 m_bulletAlignmentCtrlStrings.Add(_("Centre"));
197 m_bulletAlignmentCtrlStrings.Add(_("Right"));
198 m_bulletAlignmentCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL, _("Left"), wxDefaultPosition, wxSize(60, -1), m_bulletAlignmentCtrlStrings, wxCB_READONLY );
d2d0adc7
JS
199 m_bulletAlignmentCtrl->SetStringSelection(_("Left"));
200 m_bulletAlignmentCtrl->SetHelpText(_("The bullet character."));
6103234e 201 if (wxRichTextBulletsPage::ShowToolTips())
d2d0adc7
JS
202 m_bulletAlignmentCtrl->SetToolTip(_("The bullet character."));
203 itemBoxSizer5->Add(m_bulletAlignmentCtrl, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
97ff49b3
JS
204
205 itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
206
d2d0adc7
JS
207 wxStaticLine* itemStaticLine16 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
208 itemBoxSizer4->Add(itemStaticLine16, 0, wxGROW|wxLEFT|wxRIGHT, 5);
97ff49b3
JS
209
210 itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
211
d2d0adc7
JS
212 wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL);
213 itemBoxSizer4->Add(itemBoxSizer18, 0, wxGROW, 5);
97ff49b3 214
d2d0adc7 215 wxStaticText* itemStaticText19 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
69ce77e2 216 itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
97ff49b3 217
d2d0adc7
JS
218 wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
219 itemBoxSizer18->Add(itemBoxSizer20, 0, wxGROW, 5);
97ff49b3 220
6103234e
JS
221 wxArrayString m_symbolCtrlStrings;
222 m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
dadd4f55 223 m_symbolCtrl->SetHelpText(_("The bullet character."));
6103234e 224 if (wxRichTextBulletsPage::ShowToolTips())
dadd4f55 225 m_symbolCtrl->SetToolTip(_("The bullet character."));
d2d0adc7 226 itemBoxSizer20->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);
97ff49b3 227
d2d0adc7
JS
228 wxButton* itemButton22 = new wxButton( itemPanel1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 );
229 itemButton22->SetHelpText(_("Click to browse for a symbol."));
6103234e 230 if (wxRichTextBulletsPage::ShowToolTips())
d2d0adc7
JS
231 itemButton22->SetToolTip(_("Click to browse for a symbol."));
232 itemBoxSizer20->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
97ff49b3 233
d2d0adc7 234 itemBoxSizer18->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
97ff49b3 235
d2d0adc7 236 wxStaticText* itemStaticText24 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 );
69ce77e2 237 itemBoxSizer18->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
97ff49b3 238
6103234e
JS
239 wxArrayString m_symbolFontCtrlStrings;
240 m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
dadd4f55 241 m_symbolFontCtrl->SetHelpText(_("Available fonts."));
6103234e 242 if (wxRichTextBulletsPage::ShowToolTips())
dadd4f55 243 m_symbolFontCtrl->SetToolTip(_("Available fonts."));
d2d0adc7 244 itemBoxSizer18->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
97ff49b3 245
2fce6547 246 itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5);
97ff49b3 247
d2d0adc7 248 wxStaticText* itemStaticText27 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 );
69ce77e2 249 itemBoxSizer18->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
97ff49b3 250
6103234e
JS
251 wxArrayString m_bulletNameCtrlStrings;
252 m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
f089713f 253 m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
6103234e 254 if (wxRichTextBulletsPage::ShowToolTips())
f089713f 255 m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
d2d0adc7
JS
256 itemBoxSizer18->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5);
257
2fce6547 258 itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5);
d2d0adc7
JS
259
260 wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 );
69ce77e2 261 itemBoxSizer18->Add(itemStaticText30, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
d2d0adc7
JS
262
263 m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
264 m_numberCtrl->SetHelpText(_("The list item number."));
6103234e 265 if (wxRichTextBulletsPage::ShowToolTips())
d2d0adc7
JS
266 m_numberCtrl->SetToolTip(_("The list item number."));
267 itemBoxSizer18->Add(m_numberCtrl, 0, wxGROW|wxALL, 5);
97ff49b3 268
2fce6547 269 itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5);
97ff49b3 270
2fce6547 271 m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY );
97ff49b3 272 m_previewCtrl->SetHelpText(_("Shows a preview of the bullet settings."));
6103234e 273 if (wxRichTextBulletsPage::ShowToolTips())
97ff49b3 274 m_previewCtrl->SetToolTip(_("Shows a preview of the bullet settings."));
2fce6547 275 itemBoxSizer3->Add(m_previewCtrl, 1, wxGROW|wxALL, 5);
97ff49b3
JS
276
277////@end wxRichTextBulletsPage content construction
278
279 m_styleListBox->Append(_("(None)"));
280 m_styleListBox->Append(_("Arabic"));
281 m_styleListBox->Append(_("Upper case letters"));
282 m_styleListBox->Append(_("Lower case letters"));
283 m_styleListBox->Append(_("Upper case roman numerals"));
284 m_styleListBox->Append(_("Lower case roman numerals"));
d2d0adc7 285 m_styleListBox->Append(_("Numbered outline"));
97ff49b3
JS
286 m_styleListBox->Append(_("Symbol"));
287 m_styleListBox->Append(_("Bitmap"));
f089713f 288 m_styleListBox->Append(_("Standard"));
69ce77e2 289
97ff49b3
JS
290 m_symbolCtrl->Append(_("*"));
291 m_symbolCtrl->Append(_("-"));
292 m_symbolCtrl->Append(_(">"));
293 m_symbolCtrl->Append(_("+"));
294 m_symbolCtrl->Append(_("~"));
69ce77e2 295
d2d0adc7
JS
296 wxArrayString standardBulletNames;
297 if (wxRichTextBuffer::GetRenderer())
298 wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames);
299
300 m_bulletNameCtrl->Append(standardBulletNames);
5778b3c8 301
dadd4f55 302 wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames();
97ff49b3 303 facenames.Sort();
5778b3c8 304
97ff49b3
JS
305 m_symbolFontCtrl->Append(facenames);
306}
307
308/// Transfer data from/to window
309bool wxRichTextBulletsPage::TransferDataFromWindow()
310{
311 wxPanel::TransferDataFromWindow();
312
44cc96a8 313 wxTextAttr* attr = GetAttributes();
97ff49b3
JS
314
315 if (m_hasBulletStyle)
316 {
d2d0adc7 317 long bulletStyle = wxRICHTEXT_BULLETINDEX_NONE;
97ff49b3
JS
318
319 int index = m_styleListBox->GetSelection();
d2d0adc7 320 if (index == wxRICHTEXT_BULLETINDEX_ARABIC)
97ff49b3 321 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ARABIC;
d2d0adc7
JS
322
323 else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE)
97ff49b3 324 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER;
d2d0adc7
JS
325
326 else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE)
97ff49b3 327 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER;
d2d0adc7
JS
328
329 else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN)
97ff49b3 330 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER;
d2d0adc7
JS
331
332 else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN)
97ff49b3 333 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER;
d2d0adc7
JS
334
335 else if (index == wxRICHTEXT_BULLETINDEX_OUTLINE)
336 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_OUTLINE;
337
338 else if (index == wxRICHTEXT_BULLETINDEX_SYMBOL)
97ff49b3 339 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL;
d2d0adc7
JS
340
341 else if (index == wxRICHTEXT_BULLETINDEX_BITMAP)
97ff49b3 342 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP;
d2d0adc7
JS
343
344 else if (index == wxRICHTEXT_BULLETINDEX_STANDARD)
f089713f
JS
345 {
346 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD;
347 attr->SetBulletName(m_bulletNameCtrl->GetValue());
348 }
97ff49b3
JS
349
350 if (m_parenthesesCtrl->GetValue())
351 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES;
d2d0adc7
JS
352 if (m_rightParenthesisCtrl->GetValue())
353 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS;
97ff49b3
JS
354 if (m_periodCtrl->GetValue())
355 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PERIOD;
69ce77e2 356
d2d0adc7
JS
357 if (m_bulletAlignmentCtrl->GetSelection() == 1)
358 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE;
359 else if (m_bulletAlignmentCtrl->GetSelection() == 2)
360 bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT;
69ce77e2 361 // Left is implied
97ff49b3
JS
362
363 attr->SetBulletStyle(bulletStyle);
364 }
365
366 if (m_hasBulletNumber)
367 {
368 attr->SetBulletNumber(m_numberCtrl->GetValue());
369 }
370
371 if (m_hasBulletSymbol)
372 {
d2d0adc7 373 attr->SetBulletText(m_symbolCtrl->GetValue());
97ff49b3
JS
374 attr->SetBulletFont(m_symbolFontCtrl->GetValue());
375 }
69ce77e2 376
97ff49b3
JS
377 return true;
378}
379
380bool wxRichTextBulletsPage::TransferDataToWindow()
381{
382 m_dontUpdate = true;
383
384 wxPanel::TransferDataToWindow();
385
44cc96a8 386 wxTextAttr* attr = GetAttributes();
97ff49b3
JS
387
388 if (attr->HasBulletStyle())
389 {
f089713f 390 m_hasBulletStyle = true;
d2d0adc7
JS
391 int index = wxRICHTEXT_BULLETINDEX_NONE;
392
97ff49b3 393 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC)
d2d0adc7
JS
394 index = wxRICHTEXT_BULLETINDEX_ARABIC;
395
97ff49b3 396 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER)
d2d0adc7
JS
397 index = wxRICHTEXT_BULLETINDEX_UPPER_CASE;
398
97ff49b3 399 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER)
d2d0adc7
JS
400 index = wxRICHTEXT_BULLETINDEX_LOWER_CASE;
401
97ff49b3 402 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER)
d2d0adc7
JS
403 index = wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN;
404
97ff49b3 405 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER)
d2d0adc7
JS
406 index = wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN;
407
408 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE)
409 index = wxRICHTEXT_BULLETINDEX_OUTLINE;
410
97ff49b3 411 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
d2d0adc7
JS
412 index = wxRICHTEXT_BULLETINDEX_SYMBOL;
413
97ff49b3 414 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP)
d2d0adc7
JS
415 index = wxRICHTEXT_BULLETINDEX_BITMAP;
416
f089713f 417 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD)
d2d0adc7
JS
418 index = wxRICHTEXT_BULLETINDEX_STANDARD;
419
97ff49b3
JS
420 m_styleListBox->SetSelection(index);
421
422 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES)
423 m_parenthesesCtrl->SetValue(true);
424 else
425 m_parenthesesCtrl->SetValue(false);
426
d2d0adc7
JS
427 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS)
428 m_rightParenthesisCtrl->SetValue(true);
429 else
430 m_rightParenthesisCtrl->SetValue(false);
431
97ff49b3
JS
432 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD)
433 m_periodCtrl->SetValue(true);
434 else
5778b3c8 435 m_periodCtrl->SetValue(false);
d2d0adc7
JS
436
437 if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE)
438 m_bulletAlignmentCtrl->SetSelection(1);
439 else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT)
440 m_bulletAlignmentCtrl->SetSelection(2);
441 else
442 m_bulletAlignmentCtrl->SetSelection(0);
97ff49b3
JS
443 }
444 else
f089713f
JS
445 {
446 m_hasBulletStyle = false;
97ff49b3 447 m_styleListBox->SetSelection(-1);
d2d0adc7 448 m_bulletAlignmentCtrl->SetSelection(-1);
f089713f 449 }
97ff49b3 450
d2d0adc7 451 if (attr->HasBulletText())
97ff49b3 452 {
d2d0adc7 453 m_symbolCtrl->SetValue(attr->GetBulletText());
97ff49b3
JS
454 m_symbolFontCtrl->SetValue(attr->GetBulletFont());
455 }
456 else
457 m_symbolCtrl->SetValue(wxEmptyString);
458
459 if (attr->HasBulletNumber())
460 m_numberCtrl->SetValue(attr->GetBulletNumber());
461 else
462 m_numberCtrl->SetValue(0);
463
f089713f
JS
464 if (attr->HasBulletName())
465 m_bulletNameCtrl->SetValue(attr->GetBulletName());
466 else
467 m_bulletNameCtrl->SetValue(wxEmptyString);
468
97ff49b3
JS
469 UpdatePreview();
470
471 m_dontUpdate = false;
472
473 return true;
474}
475
476/// Updates the bullet preview
477void wxRichTextBulletsPage::UpdatePreview()
478{
479 static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \
480Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.");
481
482 static const wxChar* s_para2 = wxT("\nDuis pharetra consequat dui. Cum sociis natoque penatibus \
483et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.");
484
485 static const wxChar* s_para3 = wxT("\nInteger convallis dolor at augue \
486iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");
487
488 TransferDataFromWindow();
44cc96a8 489 wxTextAttr attr(*GetAttributes());
97ff49b3 490 attr.SetFlags(attr.GetFlags() &
d2d0adc7 491 (wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME|
97ff49b3
JS
492 wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|
493 wxTEXT_ATTR_LINE_SPACING));
494
495 wxFont font(m_previewCtrl->GetFont());
496 font.SetPointSize(9);
497 m_previewCtrl->SetFont(font);
498
44cc96a8 499 wxTextAttr normalParaAttr;
dadd4f55
JS
500 normalParaAttr.SetFont(font);
501 normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY")));
97ff49b3 502
dadd4f55 503 m_previewCtrl->Freeze();
97ff49b3
JS
504 m_previewCtrl->Clear();
505
dadd4f55 506 m_previewCtrl->BeginStyle(normalParaAttr);
97ff49b3 507 m_previewCtrl->WriteText(s_para1);
dadd4f55 508 m_previewCtrl->EndStyle();
41a85215 509
97ff49b3
JS
510 m_previewCtrl->BeginStyle(attr);
511 m_previewCtrl->WriteText(s_para2);
512 m_previewCtrl->EndStyle();
dadd4f55
JS
513
514 m_previewCtrl->BeginStyle(normalParaAttr);
97ff49b3 515 m_previewCtrl->WriteText(s_para3);
dadd4f55 516 m_previewCtrl->EndStyle();
69ce77e2 517
d2d0adc7 518 m_previewCtrl->NumberList(wxRichTextRange(0, m_previewCtrl->GetLastPosition()+1));
dadd4f55
JS
519
520 m_previewCtrl->Thaw();
97ff49b3
JS
521}
522
44cc96a8 523wxTextAttr* wxRichTextBulletsPage::GetAttributes()
97ff49b3
JS
524{
525 return wxRichTextFormattingDialog::GetDialogAttributes(this);
526}
527
528/*!
529 * Should we show tooltips?
530 */
531
532bool wxRichTextBulletsPage::ShowToolTips()
533{
dadd4f55 534 return wxRichTextFormattingDialog::ShowToolTips();
97ff49b3
JS
535}
536
537/*!
538 * Get bitmap resources
539 */
540
541wxBitmap wxRichTextBulletsPage::GetBitmapResource( const wxString& name )
542{
543 // Bitmap retrieval
544////@begin wxRichTextBulletsPage bitmap retrieval
545 wxUnusedVar(name);
546 return wxNullBitmap;
547////@end wxRichTextBulletsPage bitmap retrieval
548}
549
550/*!
551 * Get icon resources
552 */
553
554wxIcon wxRichTextBulletsPage::GetIconResource( const wxString& name )
555{
556 // Icon retrieval
557////@begin wxRichTextBulletsPage icon retrieval
558 wxUnusedVar(name);
559 return wxNullIcon;
560////@end wxRichTextBulletsPage icon retrieval
561}
562
563/*!
564 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
565 */
566
567void wxRichTextBulletsPage::OnStylelistboxSelected( wxCommandEvent& WXUNUSED(event) )
568{
569 if (!m_dontUpdate)
570 {
571 m_hasBulletStyle = true;
572
d2d0adc7 573 if (m_styleListBox->GetSelection() == wxRICHTEXT_BULLETINDEX_SYMBOL)
97ff49b3
JS
574 m_hasBulletSymbol = true;
575
576 UpdatePreview();
577 }
578}
579
580/*!
581 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
582 */
583
584void wxRichTextBulletsPage::OnSymbolctrlSelected( wxCommandEvent& WXUNUSED(event) )
585{
586 if (!m_dontUpdate)
587 {
588 m_hasBulletSymbol = true;
589 UpdatePreview();
590 }
591}
592
593/*!
594 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
595 */
596
597void wxRichTextBulletsPage::OnSymbolctrlUpdated( wxCommandEvent& WXUNUSED(event) )
598{
599 if (!m_dontUpdate)
600 {
601 m_hasBulletSymbol = true;
602 UpdatePreview();
603 }
604}
605
606/*!
607 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
608 */
609
610void wxRichTextBulletsPage::OnSymbolctrlUpdate( wxUpdateUIEvent& event )
611{
612 OnSymbolUpdate(event);
613}
614
615/*!
616 * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
617 */
618
619void wxRichTextBulletsPage::OnNumberctrlUpdated( wxSpinEvent& WXUNUSED(event) )
620{
621 if (!m_dontUpdate)
622 {
623 m_hasBulletNumber = true;
624 UpdatePreview();
625 }
626}
627
628/*!
629 * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
630 */
631
632void wxRichTextBulletsPage::OnNumberctrlUp( wxSpinEvent& WXUNUSED(event) )
633{
634 if (!m_dontUpdate)
635 {
636 m_hasBulletNumber = true;
637 UpdatePreview();
638 }
639}
640
641/*!
642 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
643 */
644
645void wxRichTextBulletsPage::OnNumberctrlDown( wxSpinEvent& WXUNUSED(event) )
646{
647 if (!m_dontUpdate)
648 {
649 m_hasBulletNumber = true;
650 UpdatePreview();
651 }
652}
653
654/*!
655 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
656 */
657
658void wxRichTextBulletsPage::OnNumberctrlTextUpdated( wxCommandEvent& WXUNUSED(event) )
659{
660 if (!m_dontUpdate)
661 {
662 m_hasBulletNumber = true;
663 UpdatePreview();
664 }
665}
666
667/*!
668 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
669 */
670
671void wxRichTextBulletsPage::OnNumberctrlUpdate( wxUpdateUIEvent& event )
672{
673 OnNumberUpdate(event);
674}
675
676/*!
677 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
678 */
679
680void wxRichTextBulletsPage::OnParenthesesctrlClick( wxCommandEvent& WXUNUSED(event) )
681{
682 if (!m_dontUpdate)
683 {
684 m_hasBulletStyle = true;
685 UpdatePreview();
686 }
687}
688
689/*!
690 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
691 */
692
693void wxRichTextBulletsPage::OnParenthesesctrlUpdate( wxUpdateUIEvent& event )
694{
695 int sel = m_styleListBox->GetSelection();
d2d0adc7
JS
696 event.Enable(m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
697 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
698 sel != wxRICHTEXT_BULLETINDEX_NONE));
97ff49b3
JS
699}
700
701/*!
702 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
703 */
704
705void wxRichTextBulletsPage::OnPeriodctrlClick( wxCommandEvent& WXUNUSED(event) )
706{
707 if (!m_dontUpdate)
708 {
709 m_hasBulletStyle = true;
710 UpdatePreview();
711 }
712}
713
714/*!
715 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
716 */
717
718void wxRichTextBulletsPage::OnPeriodctrlUpdate( wxUpdateUIEvent& event )
719{
720 int sel = m_styleListBox->GetSelection();
d2d0adc7
JS
721 event.Enable(m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
722 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
723 sel != wxRICHTEXT_BULLETINDEX_NONE));
97ff49b3
JS
724}
725
726/*!
727 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
728 */
729
730void wxRichTextBulletsPage::OnChooseSymbolClick( wxCommandEvent& WXUNUSED(event) )
731{
732 int sel = m_styleListBox->GetSelection();
d2d0adc7 733 if (m_hasBulletStyle && sel == wxRICHTEXT_BULLETINDEX_SYMBOL)
97ff49b3
JS
734 {
735 wxString symbol = m_symbolCtrl->GetValue();
736 wxString fontName = m_symbolFontCtrl->GetValue();
737 wxSymbolPickerDialog dlg(symbol, fontName, fontName, this);
738
739 if (dlg.ShowModal() == wxID_OK)
740 {
741 m_dontUpdate = true;
5778b3c8 742
97ff49b3
JS
743 m_symbolCtrl->SetValue(dlg.GetSymbol());
744 m_symbolFontCtrl->SetValue(dlg.GetFontName());
5778b3c8 745
97ff49b3
JS
746 UpdatePreview();
747
748 m_dontUpdate = false;
749 }
750 }
751}
752
753/*!
754 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
755 */
756
757void wxRichTextBulletsPage::OnChooseSymbolUpdate( wxUpdateUIEvent& event )
758{
759 OnSymbolUpdate(event);
760}
761/*!
762 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
763 */
764
765void wxRichTextBulletsPage::OnSymbolfontctrlSelected( wxCommandEvent& WXUNUSED(event) )
766{
767 if (m_dontUpdate)
768 return;
769 UpdatePreview();
770}
771
772/*!
773 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
774 */
775
776void wxRichTextBulletsPage::OnSymbolfontctrlUpdated( wxCommandEvent& WXUNUSED(event) )
777{
778 if (m_dontUpdate)
779 return;
780 UpdatePreview();
781}
782
783
784/*!
785 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
786 */
787
788void wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event )
789{
790 OnSymbolUpdate(event);
791}
792
793/// Update for symbol-related controls
794void wxRichTextBulletsPage::OnSymbolUpdate( wxUpdateUIEvent& event )
795{
796 int sel = m_styleListBox->GetSelection();
d2d0adc7 797 event.Enable(m_hasBulletStyle && (sel == wxRICHTEXT_BULLETINDEX_SYMBOL));
97ff49b3
JS
798}
799
800/// Update for number-related controls
801void wxRichTextBulletsPage::OnNumberUpdate( wxUpdateUIEvent& event )
802{
803 int sel = m_styleListBox->GetSelection();
d2d0adc7
JS
804 event.Enable( m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
805 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
806 sel != wxRICHTEXT_BULLETINDEX_STANDARD &&
807 sel != wxRICHTEXT_BULLETINDEX_NONE));
97ff49b3
JS
808}
809
f089713f
JS
810/// Update for standard bullet-related controls
811void wxRichTextBulletsPage::OnStandardBulletUpdate( wxUpdateUIEvent& event )
812{
813 int sel = m_styleListBox->GetSelection();
d2d0adc7 814 event.Enable( sel == wxRICHTEXT_BULLETINDEX_STANDARD );
f089713f
JS
815}
816
817
97ff49b3
JS
818/*!
819 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
820 */
821
822void wxRichTextBulletsPage::OnSymbolstaticUpdate( wxUpdateUIEvent& event )
823{
824 OnSymbolUpdate(event);
825}
826
827
828/*!
829 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
830 */
831
832void wxRichTextBulletsPage::OnNumberstaticUpdate( wxUpdateUIEvent& event )
833{
834 OnNumberUpdate(event);
835}
836
f089713f
JS
837/*!
838 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
839 */
840
841void wxRichTextBulletsPage::OnNamestaticUpdate( wxUpdateUIEvent& event )
842{
843 OnStandardBulletUpdate(event);
844}
845
846
847/*!
848 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
849 */
850
851void wxRichTextBulletsPage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) )
852{
853 if (m_dontUpdate)
854 return;
855 UpdatePreview();
856}
857
858/*!
859 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
860 */
861
862void wxRichTextBulletsPage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) )
863{
864 if (m_dontUpdate)
865 return;
866 UpdatePreview();
867}
868
869/*!
870 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
871 */
872
873void wxRichTextBulletsPage::OnNamectrlUIUpdate( wxUpdateUIEvent& event )
874{
875 OnStandardBulletUpdate(event);
876}
877
b68603d5 878#endif // wxUSE_RICHTEXT
d2d0adc7
JS
879/*!
880 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHT_PARENTHESIS_CTRL
881 */
882
883void wxRichTextBulletsPage::OnRightParenthesisCtrlClick( wxCommandEvent& WXUNUSED(event) )
884{
885 if (!m_dontUpdate)
886 {
887 m_hasBulletStyle = true;
888 UpdatePreview();
889 }
890}
891
892/*!
893 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHT_PARENTHESIS_CTRL
894 */
895
896void wxRichTextBulletsPage::OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event )
897{
898 int sel = m_styleListBox->GetSelection();
899 event.Enable(m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL &&
900 sel != wxRICHTEXT_BULLETINDEX_BITMAP &&
901 sel != wxRICHTEXT_BULLETINDEX_NONE));
902}
903
904/*!
905 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX
906 */
907
908void wxRichTextBulletsPage::OnBulletAlignmentCtrlSelected( wxCommandEvent& WXUNUSED(event) )
909{
910 if (m_dontUpdate)
911 return;
912 UpdatePreview();
913}
914
915