1 /////////////////////////////////////////////////////////////////////////////
2 // Name: richtextbulletspage.cpp
4 // Author: Julian Smart
6 // Created: 10/4/2006 10:32:31 AM
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
15 #include "../../include/wx/richtext/richtextbulletspage.h"
16 #include "wx/richtext/richtextsymboldlg.h"
17 #include "wx/fontenum.h"
23 * wxRichTextBulletsPage type definition
26 IMPLEMENT_DYNAMIC_CLASS( wxRichTextBulletsPage
, wxPanel
)
29 * wxRichTextBulletsPage event table definition
32 BEGIN_EVENT_TABLE( wxRichTextBulletsPage
, wxPanel
)
34 ////@begin wxRichTextBulletsPage event table entries
35 EVT_LISTBOX( ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
, wxRichTextBulletsPage::OnStylelistboxSelected
)
37 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
, wxRichTextBulletsPage::OnSymbolstaticUpdate
)
39 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextBulletsPage::OnSymbolctrlSelected
)
40 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextBulletsPage::OnSymbolctrlUpdated
)
41 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextBulletsPage::OnSymbolctrlUpdate
)
43 EVT_BUTTON( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, wxRichTextBulletsPage::OnChooseSymbolClick
)
44 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, wxRichTextBulletsPage::OnChooseSymbolUpdate
)
46 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, wxRichTextBulletsPage::OnSymbolfontctrlSelected
)
47 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, wxRichTextBulletsPage::OnSymbolfontctrlUpdated
)
48 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate
)
50 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
, wxRichTextBulletsPage::OnNumberstaticUpdate
)
52 EVT_SPINCTRL( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlUpdated
)
53 EVT_SPIN_UP( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlUp
)
54 EVT_SPIN_DOWN( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlDown
)
55 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlTextUpdated
)
56 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlUpdate
)
58 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
, wxRichTextBulletsPage::OnParenthesesctrlClick
)
59 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
, wxRichTextBulletsPage::OnParenthesesctrlUpdate
)
61 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PERIODCTRL
, wxRichTextBulletsPage::OnPeriodctrlClick
)
62 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PERIODCTRL
, wxRichTextBulletsPage::OnPeriodctrlUpdate
)
64 ////@end wxRichTextBulletsPage event table entries
69 * wxRichTextBulletsPage constructors
72 wxRichTextBulletsPage::wxRichTextBulletsPage( )
77 wxRichTextBulletsPage::wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
80 Create(parent
, id
, pos
, size
, style
);
87 void wxRichTextBulletsPage::Init()
89 m_hasBulletStyle
= false;
90 m_hasBulletNumber
= false;
91 m_hasBulletSymbol
= false;
94 ////@begin wxRichTextBulletsPage member initialisation
95 m_styleListBox
= NULL
;
97 m_symbolFontCtrl
= NULL
;
99 m_parenthesesCtrl
= NULL
;
101 m_previewCtrl
= NULL
;
102 ////@end wxRichTextBulletsPage member initialisation
106 * wxRichTextBulletsPage creator
109 bool wxRichTextBulletsPage::Create( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
111 ////@begin wxRichTextBulletsPage creation
112 wxPanel::Create( parent
, id
, pos
, size
, style
);
117 GetSizer()->SetSizeHints(this);
120 ////@end wxRichTextBulletsPage creation
125 * Control creation for wxRichTextBulletsPage
128 void wxRichTextBulletsPage::CreateControls()
130 ////@begin wxRichTextBulletsPage content construction
131 wxRichTextBulletsPage
* itemPanel1
= this;
133 wxBoxSizer
* itemBoxSizer2
= new wxBoxSizer(wxVERTICAL
);
134 itemPanel1
->SetSizer(itemBoxSizer2
);
136 wxBoxSizer
* itemBoxSizer3
= new wxBoxSizer(wxVERTICAL
);
137 itemBoxSizer2
->Add(itemBoxSizer3
, 1, wxGROW
|wxALL
, 5);
139 wxBoxSizer
* itemBoxSizer4
= new wxBoxSizer(wxHORIZONTAL
);
140 itemBoxSizer3
->Add(itemBoxSizer4
, 0, wxGROW
, 5);
142 wxBoxSizer
* itemBoxSizer5
= new wxBoxSizer(wxVERTICAL
);
143 itemBoxSizer4
->Add(itemBoxSizer5
, 0, wxGROW
, 5);
145 wxStaticText
* itemStaticText6
= new wxStaticText( itemPanel1
, wxID_STATIC
, _("&Bullet style:"), wxDefaultPosition
, wxDefaultSize
, 0 );
146 itemBoxSizer5
->Add(itemStaticText6
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
148 wxString
* m_styleListBoxStrings
= NULL
;
149 m_styleListBox
= new wxListBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
, wxDefaultPosition
, wxDefaultSize
, 0, m_styleListBoxStrings
, wxLB_SINGLE
);
150 itemBoxSizer5
->Add(m_styleListBox
, 1, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
152 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
154 wxStaticLine
* itemStaticLine9
= new wxStaticLine( itemPanel1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
155 itemBoxSizer4
->Add(itemStaticLine9
, 0, wxGROW
|wxALL
, 5);
157 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
159 wxBoxSizer
* itemBoxSizer11
= new wxBoxSizer(wxVERTICAL
);
160 itemBoxSizer4
->Add(itemBoxSizer11
, 0, wxGROW
, 5);
162 wxStaticText
* itemStaticText12
= new wxStaticText( itemPanel1
, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
, _("&Symbol:"), wxDefaultPosition
, wxDefaultSize
, 0 );
163 itemBoxSizer11
->Add(itemStaticText12
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
165 wxBoxSizer
* itemBoxSizer13
= new wxBoxSizer(wxHORIZONTAL
);
166 itemBoxSizer11
->Add(itemBoxSizer13
, 0, wxGROW
, 5);
168 wxString
* m_symbolCtrlStrings
= NULL
;
169 m_symbolCtrl
= new wxComboBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, _T(""), wxDefaultPosition
, wxSize(60, -1), 0, m_symbolCtrlStrings
, wxCB_DROPDOWN
);
170 itemBoxSizer13
->Add(m_symbolCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
|wxFIXED_MINSIZE
, 5);
172 wxButton
* itemButton15
= new wxButton( itemPanel1
, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, _("Ch&oose..."), wxDefaultPosition
, wxDefaultSize
, 0 );
173 itemBoxSizer13
->Add(itemButton15
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
175 itemBoxSizer11
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
177 wxStaticText
* itemStaticText17
= new wxStaticText( itemPanel1
, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
, _("Symbol &font:"), wxDefaultPosition
, wxDefaultSize
, 0 );
178 itemBoxSizer11
->Add(itemStaticText17
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
180 wxString
* m_symbolFontCtrlStrings
= NULL
;
181 m_symbolFontCtrl
= new wxComboBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, _T(""), wxDefaultPosition
, wxDefaultSize
, 0, m_symbolFontCtrlStrings
, wxCB_DROPDOWN
);
182 itemBoxSizer11
->Add(m_symbolFontCtrl
, 0, wxGROW
|wxALL
, 5);
184 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
186 wxStaticLine
* itemStaticLine20
= new wxStaticLine( itemPanel1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
187 itemBoxSizer4
->Add(itemStaticLine20
, 0, wxGROW
|wxALL
, 5);
189 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
191 wxBoxSizer
* itemBoxSizer22
= new wxBoxSizer(wxVERTICAL
);
192 itemBoxSizer4
->Add(itemBoxSizer22
, 0, wxGROW
, 5);
194 wxStaticText
* itemStaticText23
= new wxStaticText( itemPanel1
, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
, _("&Number:"), wxDefaultPosition
, wxDefaultSize
, 0 );
195 itemBoxSizer22
->Add(itemStaticText23
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
197 m_numberCtrl
= new wxSpinCtrl( itemPanel1
, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, _T("0"), wxDefaultPosition
, wxSize(50, -1), wxSP_ARROW_KEYS
, 0, 100000, 0 );
198 itemBoxSizer22
->Add(m_numberCtrl
, 0, wxGROW
|wxALL
, 5);
200 itemBoxSizer22
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
202 m_parenthesesCtrl
= new wxCheckBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
, _("&Parentheses"), wxDefaultPosition
, wxDefaultSize
, 0 );
203 m_parenthesesCtrl
->SetValue(false);
204 itemBoxSizer22
->Add(m_parenthesesCtrl
, 0, wxALIGN_LEFT
|wxALL
, 5);
206 m_periodCtrl
= new wxCheckBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_PERIODCTRL
, _("Peri&od"), wxDefaultPosition
, wxDefaultSize
, 0 );
207 m_periodCtrl
->SetValue(false);
208 itemBoxSizer22
->Add(m_periodCtrl
, 0, wxALIGN_LEFT
|wxALL
, 5);
210 itemBoxSizer3
->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
212 m_previewCtrl
= new wxRichTextCtrl( itemPanel1
, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(350, 180), wxSUNKEN_BORDER
);
213 m_previewCtrl
->SetHelpText(_("Shows a preview of the bullet settings."));
215 m_previewCtrl
->SetToolTip(_("Shows a preview of the bullet settings."));
216 itemBoxSizer3
->Add(m_previewCtrl
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
218 ////@end wxRichTextBulletsPage content construction
220 m_styleListBox
->Append(_("(None)"));
221 m_styleListBox
->Append(_("Arabic"));
222 m_styleListBox
->Append(_("Upper case letters"));
223 m_styleListBox
->Append(_("Lower case letters"));
224 m_styleListBox
->Append(_("Upper case roman numerals"));
225 m_styleListBox
->Append(_("Lower case roman numerals"));
226 m_styleListBox
->Append(_("Symbol"));
227 m_styleListBox
->Append(_("Bitmap"));
229 m_symbolCtrl
->Append(_("*"));
230 m_symbolCtrl
->Append(_("-"));
231 m_symbolCtrl
->Append(_(">"));
232 m_symbolCtrl
->Append(_("+"));
233 m_symbolCtrl
->Append(_("~"));
235 wxFontEnumerator enumerator
;
236 enumerator
.EnumerateFacenames();
237 wxArrayString facenames
= enumerator
.GetFacenames();
240 m_symbolFontCtrl
->Append(facenames
);
243 /// Transfer data from/to window
244 bool wxRichTextBulletsPage::TransferDataFromWindow()
246 wxPanel::TransferDataFromWindow();
248 wxTextAttrEx
* attr
= GetAttributes();
250 if (m_hasBulletStyle
)
252 long bulletStyle
= 0;
254 int index
= m_styleListBox
->GetSelection();
256 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ARABIC
;
258 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
;
260 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
;
262 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
;
264 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
;
266 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_SYMBOL
;
268 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_BITMAP
;
270 if (m_parenthesesCtrl
->GetValue())
271 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
;
272 if (m_periodCtrl
->GetValue())
273 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_PERIOD
;
275 attr
->SetBulletStyle(bulletStyle
);
278 if (m_hasBulletNumber
)
280 attr
->SetBulletNumber(m_numberCtrl
->GetValue());
283 if (m_hasBulletSymbol
)
286 if (m_symbolCtrl
->GetValue().Length() > 0)
287 c
= m_symbolCtrl
->GetValue()[0];
288 attr
->SetBulletSymbol(c
);
289 attr
->SetBulletFont(m_symbolFontCtrl
->GetValue());
294 bool wxRichTextBulletsPage::TransferDataToWindow()
298 wxPanel::TransferDataToWindow();
300 wxTextAttrEx
* attr
= GetAttributes();
302 if (attr
->HasBulletStyle())
305 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC
)
307 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
)
309 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
)
311 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
)
313 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
)
315 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL
)
317 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP
)
319 m_styleListBox
->SetSelection(index
);
321 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
)
322 m_parenthesesCtrl
->SetValue(true);
324 m_parenthesesCtrl
->SetValue(false);
326 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD
)
327 m_periodCtrl
->SetValue(true);
329 m_periodCtrl
->SetValue(false);
332 m_styleListBox
->SetSelection(-1);
334 if (attr
->HasBulletSymbol())
336 wxChar c
= attr
->GetBulletSymbol();
339 m_symbolCtrl
->SetValue(s
);
340 m_symbolFontCtrl
->SetValue(attr
->GetBulletFont());
343 m_symbolCtrl
->SetValue(wxEmptyString
);
345 if (attr
->HasBulletNumber())
346 m_numberCtrl
->SetValue(attr
->GetBulletNumber());
348 m_numberCtrl
->SetValue(0);
352 m_dontUpdate
= false;
357 /// Updates the bullet preview
358 void wxRichTextBulletsPage::UpdatePreview()
360 static const wxChar
* s_para1
= wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \
361 Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.");
363 static const wxChar
* s_para2
= wxT("\nDuis pharetra consequat dui. Cum sociis natoque penatibus \
364 et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.");
366 static const wxChar
* s_para3
= wxT("\nInteger convallis dolor at augue \
367 iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");
369 TransferDataFromWindow();
370 wxTextAttrEx
attr(*GetAttributes());
371 attr
.SetFlags(attr
.GetFlags() &
372 (wxTEXT_ATTR_BULLET_STYLE
|wxTEXT_ATTR_BULLET_NUMBER
|wxTEXT_ATTR_BULLET_SYMBOL
|
373 wxTEXT_ATTR_ALIGNMENT
|wxTEXT_ATTR_LEFT_INDENT
|wxTEXT_ATTR_RIGHT_INDENT
|wxTEXT_ATTR_PARA_SPACING_BEFORE
|wxTEXT_ATTR_PARA_SPACING_AFTER
|
374 wxTEXT_ATTR_LINE_SPACING
));
376 wxFont
font(m_previewCtrl
->GetFont());
377 font
.SetPointSize(9);
378 m_previewCtrl
->SetFont(font
);
380 font
.SetWeight(wxBOLD
);
383 m_previewCtrl
->Clear();
385 m_previewCtrl
->WriteText(s_para1
);
386 m_previewCtrl
->BeginStyle(attr
);
387 m_previewCtrl
->WriteText(s_para2
);
388 m_previewCtrl
->EndStyle();
389 m_previewCtrl
->WriteText(s_para3
);
392 wxTextAttrEx
* wxRichTextBulletsPage::GetAttributes()
394 return wxRichTextFormattingDialog::GetDialogAttributes(this);
398 * Should we show tooltips?
401 bool wxRichTextBulletsPage::ShowToolTips()
407 * Get bitmap resources
410 wxBitmap
wxRichTextBulletsPage::GetBitmapResource( const wxString
& name
)
413 ////@begin wxRichTextBulletsPage bitmap retrieval
416 ////@end wxRichTextBulletsPage bitmap retrieval
423 wxIcon
wxRichTextBulletsPage::GetIconResource( const wxString
& name
)
426 ////@begin wxRichTextBulletsPage icon retrieval
429 ////@end wxRichTextBulletsPage icon retrieval
433 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
436 void wxRichTextBulletsPage::OnStylelistboxSelected( wxCommandEvent
& WXUNUSED(event
) )
440 m_hasBulletStyle
= true;
442 if (m_styleListBox
->GetSelection() == 6)
443 m_hasBulletSymbol
= true;
450 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
453 void wxRichTextBulletsPage::OnSymbolctrlSelected( wxCommandEvent
& WXUNUSED(event
) )
457 m_hasBulletSymbol
= true;
463 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
466 void wxRichTextBulletsPage::OnSymbolctrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
470 m_hasBulletSymbol
= true;
476 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
479 void wxRichTextBulletsPage::OnSymbolctrlUpdate( wxUpdateUIEvent
& event
)
481 OnSymbolUpdate(event
);
485 * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
488 void wxRichTextBulletsPage::OnNumberctrlUpdated( wxSpinEvent
& WXUNUSED(event
) )
492 m_hasBulletNumber
= true;
498 * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
501 void wxRichTextBulletsPage::OnNumberctrlUp( wxSpinEvent
& WXUNUSED(event
) )
505 m_hasBulletNumber
= true;
511 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
514 void wxRichTextBulletsPage::OnNumberctrlDown( wxSpinEvent
& WXUNUSED(event
) )
518 m_hasBulletNumber
= true;
524 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
527 void wxRichTextBulletsPage::OnNumberctrlTextUpdated( wxCommandEvent
& WXUNUSED(event
) )
531 m_hasBulletNumber
= true;
537 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
540 void wxRichTextBulletsPage::OnNumberctrlUpdate( wxUpdateUIEvent
& event
)
542 OnNumberUpdate(event
);
546 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
549 void wxRichTextBulletsPage::OnParenthesesctrlClick( wxCommandEvent
& WXUNUSED(event
) )
553 m_hasBulletStyle
= true;
559 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
562 void wxRichTextBulletsPage::OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
)
564 int sel
= m_styleListBox
->GetSelection();
565 event
.Enable(m_hasBulletStyle
&& (sel
!= 6 && sel
!= 7 && sel
!= 0));
569 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
572 void wxRichTextBulletsPage::OnPeriodctrlClick( wxCommandEvent
& WXUNUSED(event
) )
576 m_hasBulletStyle
= true;
582 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
585 void wxRichTextBulletsPage::OnPeriodctrlUpdate( wxUpdateUIEvent
& event
)
587 int sel
= m_styleListBox
->GetSelection();
588 event
.Enable(m_hasBulletStyle
&& (sel
!= 6 && sel
!= 7 && sel
!= 0));
592 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
595 void wxRichTextBulletsPage::OnChooseSymbolClick( wxCommandEvent
& WXUNUSED(event
) )
597 int sel
= m_styleListBox
->GetSelection();
598 if (m_hasBulletStyle
&& sel
== 6)
600 wxString symbol
= m_symbolCtrl
->GetValue();
601 wxString fontName
= m_symbolFontCtrl
->GetValue();
602 wxSymbolPickerDialog
dlg(symbol
, fontName
, fontName
, this);
604 if (dlg
.ShowModal() == wxID_OK
)
608 m_symbolCtrl
->SetValue(dlg
.GetSymbol());
609 m_symbolFontCtrl
->SetValue(dlg
.GetFontName());
613 m_dontUpdate
= false;
619 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
622 void wxRichTextBulletsPage::OnChooseSymbolUpdate( wxUpdateUIEvent
& event
)
624 OnSymbolUpdate(event
);
627 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
630 void wxRichTextBulletsPage::OnSymbolfontctrlSelected( wxCommandEvent
& WXUNUSED(event
) )
638 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
641 void wxRichTextBulletsPage::OnSymbolfontctrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
650 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
653 void wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
)
655 OnSymbolUpdate(event
);
658 /// Update for symbol-related controls
659 void wxRichTextBulletsPage::OnSymbolUpdate( wxUpdateUIEvent
& event
)
661 int sel
= m_styleListBox
->GetSelection();
662 event
.Enable(m_hasBulletStyle
&& (sel
== 6));
665 /// Update for number-related controls
666 void wxRichTextBulletsPage::OnNumberUpdate( wxUpdateUIEvent
& event
)
668 int sel
= m_styleListBox
->GetSelection();
669 event
.Enable( m_hasBulletStyle
&& (sel
!= 6 && sel
!= 7 && sel
!= 0));
673 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
676 void wxRichTextBulletsPage::OnSymbolstaticUpdate( wxUpdateUIEvent
& event
)
678 OnSymbolUpdate(event
);
683 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
686 void wxRichTextBulletsPage::OnNumberstaticUpdate( wxUpdateUIEvent
& event
)
688 OnNumberUpdate(event
);