1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/richtext/richtextbulletspage.cpp
4 // Author: Julian Smart
6 // Created: 10/4/2006 10:32:31 AM
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/richtext/richtextbulletspage.h"
16 #include "wx/richtext/richtextsymboldlg.h"
17 #include "wx/fontenum.h"
20 * wxRichTextBulletsPage type definition
23 IMPLEMENT_DYNAMIC_CLASS( wxRichTextBulletsPage
, wxPanel
)
26 * wxRichTextBulletsPage event table definition
29 BEGIN_EVENT_TABLE( wxRichTextBulletsPage
, wxPanel
)
31 ////@begin wxRichTextBulletsPage event table entries
32 EVT_LISTBOX( ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
, wxRichTextBulletsPage::OnStylelistboxSelected
)
34 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
, wxRichTextBulletsPage::OnSymbolstaticUpdate
)
36 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextBulletsPage::OnSymbolctrlSelected
)
37 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextBulletsPage::OnSymbolctrlUpdated
)
38 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextBulletsPage::OnSymbolctrlUpdate
)
40 EVT_BUTTON( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, wxRichTextBulletsPage::OnChooseSymbolClick
)
41 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, wxRichTextBulletsPage::OnChooseSymbolUpdate
)
43 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, wxRichTextBulletsPage::OnSymbolfontctrlSelected
)
44 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, wxRichTextBulletsPage::OnSymbolfontctrlUpdated
)
45 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
, wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate
)
47 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
, wxRichTextBulletsPage::OnNumberstaticUpdate
)
49 EVT_SPINCTRL( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlUpdated
)
50 EVT_SPIN_UP( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlUp
)
51 EVT_SPIN_DOWN( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlDown
)
52 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlTextUpdated
)
53 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, wxRichTextBulletsPage::OnNumberctrlUpdate
)
55 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
, wxRichTextBulletsPage::OnParenthesesctrlClick
)
56 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
, wxRichTextBulletsPage::OnParenthesesctrlUpdate
)
58 EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PERIODCTRL
, wxRichTextBulletsPage::OnPeriodctrlClick
)
59 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PERIODCTRL
, wxRichTextBulletsPage::OnPeriodctrlUpdate
)
61 ////@end wxRichTextBulletsPage event table entries
66 * wxRichTextBulletsPage constructors
69 wxRichTextBulletsPage::wxRichTextBulletsPage( )
74 wxRichTextBulletsPage::wxRichTextBulletsPage( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
77 Create(parent
, id
, pos
, size
, style
);
84 void wxRichTextBulletsPage::Init()
86 m_hasBulletStyle
= false;
87 m_hasBulletNumber
= false;
88 m_hasBulletSymbol
= false;
91 ////@begin wxRichTextBulletsPage member initialisation
92 m_styleListBox
= NULL
;
94 m_symbolFontCtrl
= NULL
;
96 m_parenthesesCtrl
= NULL
;
99 ////@end wxRichTextBulletsPage member initialisation
103 * wxRichTextBulletsPage creator
106 bool wxRichTextBulletsPage::Create( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
108 ////@begin wxRichTextBulletsPage creation
109 wxPanel::Create( parent
, id
, pos
, size
, style
);
114 GetSizer()->SetSizeHints(this);
117 ////@end wxRichTextBulletsPage creation
122 * Control creation for wxRichTextBulletsPage
125 void wxRichTextBulletsPage::CreateControls()
127 ////@begin wxRichTextBulletsPage content construction
128 wxRichTextBulletsPage
* itemPanel1
= this;
130 wxBoxSizer
* itemBoxSizer2
= new wxBoxSizer(wxVERTICAL
);
131 itemPanel1
->SetSizer(itemBoxSizer2
);
133 wxBoxSizer
* itemBoxSizer3
= new wxBoxSizer(wxVERTICAL
);
134 itemBoxSizer2
->Add(itemBoxSizer3
, 1, wxGROW
|wxALL
, 5);
136 wxBoxSizer
* itemBoxSizer4
= new wxBoxSizer(wxHORIZONTAL
);
137 itemBoxSizer3
->Add(itemBoxSizer4
, 0, wxGROW
, 5);
139 wxBoxSizer
* itemBoxSizer5
= new wxBoxSizer(wxVERTICAL
);
140 itemBoxSizer4
->Add(itemBoxSizer5
, 0, wxGROW
, 5);
142 wxStaticText
* itemStaticText6
= new wxStaticText( itemPanel1
, wxID_STATIC
, _("&Bullet style:"), wxDefaultPosition
, wxDefaultSize
, 0 );
143 itemBoxSizer5
->Add(itemStaticText6
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
145 wxString
* m_styleListBoxStrings
= NULL
;
146 m_styleListBox
= new wxListBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
, wxDefaultPosition
, wxDefaultSize
, 0, m_styleListBoxStrings
, wxLB_SINGLE
);
147 itemBoxSizer5
->Add(m_styleListBox
, 1, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
149 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
151 wxStaticLine
* itemStaticLine9
= new wxStaticLine( itemPanel1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
152 itemBoxSizer4
->Add(itemStaticLine9
, 0, wxGROW
|wxALL
, 5);
154 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
156 wxBoxSizer
* itemBoxSizer11
= new wxBoxSizer(wxVERTICAL
);
157 itemBoxSizer4
->Add(itemBoxSizer11
, 0, wxGROW
, 5);
159 wxStaticText
* itemStaticText12
= new wxStaticText( itemPanel1
, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
, _("&Symbol:"), wxDefaultPosition
, wxDefaultSize
, 0 );
160 itemBoxSizer11
->Add(itemStaticText12
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
162 wxBoxSizer
* itemBoxSizer13
= new wxBoxSizer(wxHORIZONTAL
);
163 itemBoxSizer11
->Add(itemBoxSizer13
, 0, wxGROW
, 5);
165 wxString
* m_symbolCtrlStrings
= NULL
;
166 m_symbolCtrl
= new wxComboBox( itemPanel1
,
167 ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
,
170 wxSize(60, wxDefaultCoord
),
174 itemBoxSizer13
->Add(m_symbolCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
|wxFIXED_MINSIZE
, 5);
176 wxButton
* itemButton15
= new wxButton( itemPanel1
, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, _("Ch&oose..."), wxDefaultPosition
, wxDefaultSize
, 0 );
177 itemBoxSizer13
->Add(itemButton15
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
179 itemBoxSizer11
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
181 wxStaticText
* itemStaticText17
= new wxStaticText( itemPanel1
, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
, _("Symbol &font:"), wxDefaultPosition
, wxDefaultSize
, 0 );
182 itemBoxSizer11
->Add(itemStaticText17
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
184 wxString
* m_symbolFontCtrlStrings
= NULL
;
185 m_symbolFontCtrl
= new wxComboBox( itemPanel1
,
186 ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
,
191 m_symbolFontCtrlStrings
,
193 itemBoxSizer11
->Add(m_symbolFontCtrl
, 0, wxGROW
|wxALL
, 5);
195 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
197 wxStaticLine
* itemStaticLine20
= new wxStaticLine( itemPanel1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
198 itemBoxSizer4
->Add(itemStaticLine20
, 0, wxGROW
|wxALL
, 5);
200 itemBoxSizer4
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
202 wxBoxSizer
* itemBoxSizer22
= new wxBoxSizer(wxVERTICAL
);
203 itemBoxSizer4
->Add(itemBoxSizer22
, 0, wxGROW
, 5);
205 wxStaticText
* itemStaticText23
= new wxStaticText( itemPanel1
, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
, _("&Number:"), wxDefaultPosition
, wxDefaultSize
, 0 );
206 itemBoxSizer22
->Add(itemStaticText23
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
208 m_numberCtrl
= new wxSpinCtrl( itemPanel1
, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
, _T("0"), wxDefaultPosition
, wxSize(50, wxDefaultCoord
), wxSP_ARROW_KEYS
, 0, 100000, 0 );
209 itemBoxSizer22
->Add(m_numberCtrl
, 0, wxGROW
|wxALL
, 5);
211 itemBoxSizer22
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
213 m_parenthesesCtrl
= new wxCheckBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
, _("&Parentheses"), wxDefaultPosition
, wxDefaultSize
, 0 );
214 m_parenthesesCtrl
->SetValue(false);
215 itemBoxSizer22
->Add(m_parenthesesCtrl
, 0, wxALIGN_LEFT
|wxALL
, 5);
217 m_periodCtrl
= new wxCheckBox( itemPanel1
, ID_RICHTEXTBULLETSPAGE_PERIODCTRL
, _("Peri&od"), wxDefaultPosition
, wxDefaultSize
, 0 );
218 m_periodCtrl
->SetValue(false);
219 itemBoxSizer22
->Add(m_periodCtrl
, 0, wxALIGN_LEFT
|wxALL
, 5);
221 itemBoxSizer3
->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
223 m_previewCtrl
= new wxRichTextCtrl( itemPanel1
, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(350, 180), wxSUNKEN_BORDER
);
224 m_previewCtrl
->SetHelpText(_("Shows a preview of the bullet settings."));
226 m_previewCtrl
->SetToolTip(_("Shows a preview of the bullet settings."));
227 itemBoxSizer3
->Add(m_previewCtrl
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
229 ////@end wxRichTextBulletsPage content construction
231 m_styleListBox
->Append(_("(None)"));
232 m_styleListBox
->Append(_("Arabic"));
233 m_styleListBox
->Append(_("Upper case letters"));
234 m_styleListBox
->Append(_("Lower case letters"));
235 m_styleListBox
->Append(_("Upper case roman numerals"));
236 m_styleListBox
->Append(_("Lower case roman numerals"));
237 m_styleListBox
->Append(_("Symbol"));
238 m_styleListBox
->Append(_("Bitmap"));
240 m_symbolCtrl
->Append(_("*"));
241 m_symbolCtrl
->Append(_("-"));
242 m_symbolCtrl
->Append(_(">"));
243 m_symbolCtrl
->Append(_("+"));
244 m_symbolCtrl
->Append(_("~"));
246 wxFontEnumerator enumerator
;
247 enumerator
.EnumerateFacenames();
248 wxArrayString facenames
= enumerator
.GetFacenames();
251 m_symbolFontCtrl
->Append(facenames
);
254 /// Transfer data from/to window
255 bool wxRichTextBulletsPage::TransferDataFromWindow()
257 wxPanel::TransferDataFromWindow();
259 wxTextAttrEx
* attr
= GetAttributes();
261 if (m_hasBulletStyle
)
263 long bulletStyle
= 0;
265 int index
= m_styleListBox
->GetSelection();
267 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ARABIC
;
269 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
;
271 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
;
273 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
;
275 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
;
277 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_SYMBOL
;
279 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_BITMAP
;
281 if (m_parenthesesCtrl
->GetValue())
282 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
;
283 if (m_periodCtrl
->GetValue())
284 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_PERIOD
;
286 attr
->SetBulletStyle(bulletStyle
);
289 if (m_hasBulletNumber
)
291 attr
->SetBulletNumber(m_numberCtrl
->GetValue());
294 if (m_hasBulletSymbol
)
297 if (m_symbolCtrl
->GetValue().length() > 0)
298 c
= m_symbolCtrl
->GetValue()[0];
299 attr
->SetBulletSymbol(c
);
300 attr
->SetBulletFont(m_symbolFontCtrl
->GetValue());
305 bool wxRichTextBulletsPage::TransferDataToWindow()
309 wxPanel::TransferDataToWindow();
311 wxTextAttrEx
* attr
= GetAttributes();
313 if (attr
->HasBulletStyle())
316 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC
)
318 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
)
320 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
)
322 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
)
324 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
)
326 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL
)
328 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP
)
330 m_styleListBox
->SetSelection(index
);
332 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
)
333 m_parenthesesCtrl
->SetValue(true);
335 m_parenthesesCtrl
->SetValue(false);
337 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD
)
338 m_periodCtrl
->SetValue(true);
340 m_periodCtrl
->SetValue(false);
343 m_styleListBox
->SetSelection(-1);
345 if (attr
->HasBulletSymbol())
347 wxChar c
= attr
->GetBulletSymbol();
350 m_symbolCtrl
->SetValue(s
);
351 m_symbolFontCtrl
->SetValue(attr
->GetBulletFont());
354 m_symbolCtrl
->SetValue(wxEmptyString
);
356 if (attr
->HasBulletNumber())
357 m_numberCtrl
->SetValue(attr
->GetBulletNumber());
359 m_numberCtrl
->SetValue(0);
363 m_dontUpdate
= false;
368 /// Updates the bullet preview
369 void wxRichTextBulletsPage::UpdatePreview()
371 static const wxChar
* s_para1
= wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \
372 Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.");
374 static const wxChar
* s_para2
= wxT("\nDuis pharetra consequat dui. Cum sociis natoque penatibus \
375 et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.");
377 static const wxChar
* s_para3
= wxT("\nInteger convallis dolor at augue \
378 iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");
380 TransferDataFromWindow();
381 wxTextAttrEx
attr(*GetAttributes());
382 attr
.SetFlags(attr
.GetFlags() &
383 (wxTEXT_ATTR_BULLET_STYLE
|wxTEXT_ATTR_BULLET_NUMBER
|wxTEXT_ATTR_BULLET_SYMBOL
|
384 wxTEXT_ATTR_ALIGNMENT
|wxTEXT_ATTR_LEFT_INDENT
|wxTEXT_ATTR_RIGHT_INDENT
|wxTEXT_ATTR_PARA_SPACING_BEFORE
|wxTEXT_ATTR_PARA_SPACING_AFTER
|
385 wxTEXT_ATTR_LINE_SPACING
));
387 wxFont
font(m_previewCtrl
->GetFont());
388 font
.SetPointSize(9);
389 m_previewCtrl
->SetFont(font
);
391 font
.SetWeight(wxBOLD
);
394 m_previewCtrl
->Clear();
396 m_previewCtrl
->WriteText(s_para1
);
397 m_previewCtrl
->BeginStyle(attr
);
398 m_previewCtrl
->WriteText(s_para2
);
399 m_previewCtrl
->EndStyle();
400 m_previewCtrl
->WriteText(s_para3
);
403 wxTextAttrEx
* wxRichTextBulletsPage::GetAttributes()
405 return wxRichTextFormattingDialog::GetDialogAttributes(this);
409 * Should we show tooltips?
412 bool wxRichTextBulletsPage::ShowToolTips()
418 * Get bitmap resources
421 wxBitmap
wxRichTextBulletsPage::GetBitmapResource( const wxString
& name
)
424 ////@begin wxRichTextBulletsPage bitmap retrieval
427 ////@end wxRichTextBulletsPage bitmap retrieval
434 wxIcon
wxRichTextBulletsPage::GetIconResource( const wxString
& name
)
437 ////@begin wxRichTextBulletsPage icon retrieval
440 ////@end wxRichTextBulletsPage icon retrieval
444 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
447 void wxRichTextBulletsPage::OnStylelistboxSelected( wxCommandEvent
& WXUNUSED(event
) )
451 m_hasBulletStyle
= true;
453 if (m_styleListBox
->GetSelection() == 6)
454 m_hasBulletSymbol
= true;
461 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
464 void wxRichTextBulletsPage::OnSymbolctrlSelected( wxCommandEvent
& WXUNUSED(event
) )
468 m_hasBulletSymbol
= true;
474 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
477 void wxRichTextBulletsPage::OnSymbolctrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
481 m_hasBulletSymbol
= true;
487 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
490 void wxRichTextBulletsPage::OnSymbolctrlUpdate( wxUpdateUIEvent
& event
)
492 OnSymbolUpdate(event
);
496 * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
499 void wxRichTextBulletsPage::OnNumberctrlUpdated( wxSpinEvent
& WXUNUSED(event
) )
503 m_hasBulletNumber
= true;
509 * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
512 void wxRichTextBulletsPage::OnNumberctrlUp( wxSpinEvent
& WXUNUSED(event
) )
516 m_hasBulletNumber
= true;
522 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
525 void wxRichTextBulletsPage::OnNumberctrlDown( wxSpinEvent
& WXUNUSED(event
) )
529 m_hasBulletNumber
= true;
535 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
538 void wxRichTextBulletsPage::OnNumberctrlTextUpdated( wxCommandEvent
& WXUNUSED(event
) )
542 m_hasBulletNumber
= true;
548 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
551 void wxRichTextBulletsPage::OnNumberctrlUpdate( wxUpdateUIEvent
& event
)
553 OnNumberUpdate(event
);
557 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
560 void wxRichTextBulletsPage::OnParenthesesctrlClick( wxCommandEvent
& WXUNUSED(event
) )
564 m_hasBulletStyle
= true;
570 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
573 void wxRichTextBulletsPage::OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
)
575 int sel
= m_styleListBox
->GetSelection();
576 event
.Enable(m_hasBulletStyle
&& (sel
!= 6 && sel
!= 7 && sel
!= 0));
580 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
583 void wxRichTextBulletsPage::OnPeriodctrlClick( wxCommandEvent
& WXUNUSED(event
) )
587 m_hasBulletStyle
= true;
593 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
596 void wxRichTextBulletsPage::OnPeriodctrlUpdate( wxUpdateUIEvent
& event
)
598 int sel
= m_styleListBox
->GetSelection();
599 event
.Enable(m_hasBulletStyle
&& (sel
!= 6 && sel
!= 7 && sel
!= 0));
603 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
606 void wxRichTextBulletsPage::OnChooseSymbolClick( wxCommandEvent
& WXUNUSED(event
) )
608 int sel
= m_styleListBox
->GetSelection();
609 if (m_hasBulletStyle
&& sel
== 6)
611 wxString symbol
= m_symbolCtrl
->GetValue();
612 wxString fontName
= m_symbolFontCtrl
->GetValue();
613 wxSymbolPickerDialog
dlg(symbol
, fontName
, fontName
, this);
615 if (dlg
.ShowModal() == wxID_OK
)
619 m_symbolCtrl
->SetValue(dlg
.GetSymbol());
620 m_symbolFontCtrl
->SetValue(dlg
.GetFontName());
624 m_dontUpdate
= false;
630 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
633 void wxRichTextBulletsPage::OnChooseSymbolUpdate( wxUpdateUIEvent
& event
)
635 OnSymbolUpdate(event
);
638 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
641 void wxRichTextBulletsPage::OnSymbolfontctrlSelected( wxCommandEvent
& WXUNUSED(event
) )
649 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
652 void wxRichTextBulletsPage::OnSymbolfontctrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
661 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
664 void wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
)
666 OnSymbolUpdate(event
);
669 /// Update for symbol-related controls
670 void wxRichTextBulletsPage::OnSymbolUpdate( wxUpdateUIEvent
& event
)
672 int sel
= m_styleListBox
->GetSelection();
673 event
.Enable(m_hasBulletStyle
&& (sel
== 6));
676 /// Update for number-related controls
677 void wxRichTextBulletsPage::OnNumberUpdate( wxUpdateUIEvent
& event
)
679 int sel
= m_styleListBox
->GetSelection();
680 event
.Enable( m_hasBulletStyle
&& (sel
!= 6 && sel
!= 7 && sel
!= 0));
684 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
687 void wxRichTextBulletsPage::OnSymbolstaticUpdate( wxUpdateUIEvent
& event
)
689 OnSymbolUpdate(event
);
694 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
697 void wxRichTextBulletsPage::OnNumberstaticUpdate( wxUpdateUIEvent
& event
)
699 OnNumberUpdate(event
);
702 #endif // wxUSE_RICHTEXT