1 /////////////////////////////////////////////////////////////////////////////
2 // Name: richtextliststylepage.cpp
4 // Author: Julian Smart
6 // Created: 10/18/2006 11:36:37 AM
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #include "../../include/wx/richtext/richtextliststylepage.h"
18 * wxRichTextListStylePage type definition
21 IMPLEMENT_DYNAMIC_CLASS( wxRichTextListStylePage
, wxPanel
)
24 * wxRichTextListStylePage event table definition
27 BEGIN_EVENT_TABLE( wxRichTextListStylePage
, wxPanel
)
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
)
36 EVT_BUTTON( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
, wxRichTextListStylePage::OnChooseFontClick
)
38 EVT_LISTBOX( ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
, wxRichTextListStylePage::OnStylelistboxSelected
)
40 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
, wxRichTextListStylePage::OnSymbolstaticUpdate
)
42 EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextListStylePage::OnSymbolctrlSelected
)
43 EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextListStylePage::OnSymbolctrlUpdated
)
44 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, wxRichTextListStylePage::OnSymbolctrlUIUpdate
)
46 EVT_BUTTON( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, wxRichTextListStylePage::OnChooseSymbolClick
)
47 EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, wxRichTextListStylePage::OnChooseSymbolUpdate
)
49 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
, wxRichTextListStylePage::OnSymbolfontctrlSelected
)
50 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
, wxRichTextListStylePage::OnSymbolfontctrlUpdated
)
51 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
, wxRichTextListStylePage::OnSymbolfontctrlUIUpdate
)
53 EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
, wxRichTextListStylePage::OnParenthesesctrlClick
)
54 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
, wxRichTextListStylePage::OnParenthesesctrlUpdate
)
56 EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
, wxRichTextListStylePage::OnPeriodctrlClick
)
57 EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
, wxRichTextListStylePage::OnPeriodctrlUpdate
)
59 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
, wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected
)
61 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
, wxRichTextListStylePage::OnRichtextliststylepageAlignrightSelected
)
63 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
, wxRichTextListStylePage::OnRichtextliststylepageJustifiedSelected
)
65 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_CENTERED
, wxRichTextListStylePage::OnRichtextliststylepageCenteredSelected
)
67 EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
, wxRichTextListStylePage::OnRichtextliststylepageAlignindeterminateSelected
)
69 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
, wxRichTextListStylePage::OnIndentLeftUpdated
)
71 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
, wxRichTextListStylePage::OnIndentFirstLineUpdated
)
73 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
, wxRichTextListStylePage::OnIndentRightUpdated
)
75 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
, wxRichTextListStylePage::OnSpacingBeforeUpdated
)
77 EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
, wxRichTextListStylePage::OnSpacingAfterUpdated
)
79 EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
, wxRichTextListStylePage::OnLineSpacingSelected
)
81 ////@end wxRichTextListStylePage event table entries
86 * wxRichTextListStylePage constructors
89 wxRichTextListStylePage::wxRichTextListStylePage( )
94 wxRichTextListStylePage::wxRichTextListStylePage( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
97 Create(parent
, id
, pos
, size
, style
);
101 * wxRichTextListStylePage creator
104 bool wxRichTextListStylePage::Create( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
106 ////@begin wxRichTextListStylePage creation
107 wxPanel::Create( parent
, id
, pos
, size
, style
);
112 GetSizer()->SetSizeHints(this);
115 ////@end wxRichTextListStylePage creation
120 * Member initialisation
123 void wxRichTextListStylePage::Init()
125 m_dontUpdate
= false;
128 ////@begin wxRichTextListStylePage member initialisation
130 m_styleListBox
= NULL
;
132 m_symbolFontCtrl
= NULL
;
133 m_parenthesesCtrl
= NULL
;
135 m_alignmentLeft
= NULL
;
136 m_alignmentRight
= NULL
;
137 m_alignmentJustified
= NULL
;
138 m_alignmentCentred
= NULL
;
139 m_alignmentIndeterminate
= NULL
;
141 m_indentLeftFirst
= NULL
;
142 m_indentRight
= NULL
;
143 m_spacingBefore
= NULL
;
144 m_spacingAfter
= NULL
;
145 m_spacingLine
= NULL
;
146 m_previewCtrl
= NULL
;
147 ////@end wxRichTextListStylePage member initialisation
150 * Control creation for wxRichTextListStylePage
153 void wxRichTextListStylePage::CreateControls()
155 ////@begin wxRichTextListStylePage content construction
156 wxRichTextListStylePage
* itemPanel1
= this;
158 wxBoxSizer
* itemBoxSizer2
= new wxBoxSizer(wxVERTICAL
);
159 itemPanel1
->SetSizer(itemBoxSizer2
);
161 wxBoxSizer
* itemBoxSizer3
= new wxBoxSizer(wxVERTICAL
);
162 itemBoxSizer2
->Add(itemBoxSizer3
, 1, wxGROW
|wxALL
, 5);
164 wxBoxSizer
* itemBoxSizer4
= new wxBoxSizer(wxHORIZONTAL
);
165 itemBoxSizer3
->Add(itemBoxSizer4
, 0, wxALIGN_CENTER_HORIZONTAL
, 5);
167 wxStaticText
* itemStaticText5
= new wxStaticText( itemPanel1
, wxID_STATIC
, _("&List level:"), wxDefaultPosition
, wxDefaultSize
, 0 );
168 itemBoxSizer4
->Add(itemStaticText5
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
170 m_levelCtrl
= new wxSpinCtrl( itemPanel1
, ID_RICHTEXTLISTSTYLEPAGE_LEVEL
, _T("1"), wxDefaultPosition
, wxSize(60, -1), wxSP_ARROW_KEYS
, 1, 10, 1 );
171 m_levelCtrl
->SetHelpText(_("Selects the list level to edit."));
173 m_levelCtrl
->SetToolTip(_("Selects the list level to edit."));
174 itemBoxSizer4
->Add(m_levelCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
176 itemBoxSizer4
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
178 wxButton
* itemButton8
= new wxButton( itemPanel1
, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
, _("&Font for Level..."), wxDefaultPosition
, wxDefaultSize
, 0 );
179 itemButton8
->SetHelpText(_("Click to choose the font for this level."));
181 itemButton8
->SetToolTip(_("Click to choose the font for this level."));
182 itemBoxSizer4
->Add(itemButton8
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
184 wxNotebook
* itemNotebook9
= new wxNotebook( itemPanel1
, ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK
, wxDefaultPosition
, wxDefaultSize
, wxBK_TOP
);
186 wxPanel
* itemPanel10
= new wxPanel( itemNotebook9
, ID_RICHTEXTLISTSTYLEPAGE_BULLETS
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxTAB_TRAVERSAL
);
187 wxBoxSizer
* itemBoxSizer11
= new wxBoxSizer(wxVERTICAL
);
188 itemPanel10
->SetSizer(itemBoxSizer11
);
190 wxBoxSizer
* itemBoxSizer12
= new wxBoxSizer(wxHORIZONTAL
);
191 itemBoxSizer11
->Add(itemBoxSizer12
, 1, wxGROW
, 5);
192 wxBoxSizer
* itemBoxSizer13
= new wxBoxSizer(wxVERTICAL
);
193 itemBoxSizer12
->Add(itemBoxSizer13
, 0, wxGROW
, 5);
194 wxStaticText
* itemStaticText14
= new wxStaticText( itemPanel10
, wxID_STATIC
, _("&Bullet style:"), wxDefaultPosition
, wxDefaultSize
, 0 );
195 itemBoxSizer13
->Add(itemStaticText14
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
197 wxString
* m_styleListBoxStrings
= NULL
;
198 m_styleListBox
= new wxListBox( itemPanel10
, ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
, wxDefaultPosition
, wxDefaultSize
, 0, m_styleListBoxStrings
, wxLB_SINGLE
);
199 m_styleListBox
->SetHelpText(_("The available bullet styles."));
201 m_styleListBox
->SetToolTip(_("The available bullet styles."));
202 itemBoxSizer13
->Add(m_styleListBox
, 1, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
204 itemBoxSizer12
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
206 wxStaticLine
* itemStaticLine17
= new wxStaticLine( itemPanel10
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
207 itemBoxSizer12
->Add(itemStaticLine17
, 0, wxGROW
|wxALL
, 5);
209 itemBoxSizer12
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
211 wxBoxSizer
* itemBoxSizer19
= new wxBoxSizer(wxVERTICAL
);
212 itemBoxSizer12
->Add(itemBoxSizer19
, 0, wxGROW
, 5);
213 wxStaticText
* itemStaticText20
= new wxStaticText( itemPanel10
, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
, _("&Symbol:"), wxDefaultPosition
, wxDefaultSize
, 0 );
214 itemBoxSizer19
->Add(itemStaticText20
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
216 wxBoxSizer
* itemBoxSizer21
= new wxBoxSizer(wxHORIZONTAL
);
217 itemBoxSizer19
->Add(itemBoxSizer21
, 0, wxGROW
, 5);
218 wxString
* m_symbolCtrlStrings
= NULL
;
219 m_symbolCtrl
= new wxComboBox( itemPanel10
, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
, _T(""), wxDefaultPosition
, wxSize(60, -1), 0, m_symbolCtrlStrings
, wxCB_DROPDOWN
);
220 m_symbolCtrl
->SetHelpText(_("The bullet character."));
222 m_symbolCtrl
->SetToolTip(_("The bullet character."));
223 itemBoxSizer21
->Add(m_symbolCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
|wxFIXED_MINSIZE
, 5);
225 wxButton
* itemButton23
= new wxButton( itemPanel10
, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
, _("Ch&oose..."), wxDefaultPosition
, wxDefaultSize
, 0 );
226 itemButton23
->SetHelpText(_("Click to browse for a symbol."));
228 itemButton23
->SetToolTip(_("Click to browse for a symbol."));
229 itemBoxSizer21
->Add(itemButton23
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
231 itemBoxSizer19
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
233 wxStaticText
* itemStaticText25
= new wxStaticText( itemPanel10
, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
, _("Symbol &font:"), wxDefaultPosition
, wxDefaultSize
, 0 );
234 itemBoxSizer19
->Add(itemStaticText25
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
236 wxString
* m_symbolFontCtrlStrings
= NULL
;
237 m_symbolFontCtrl
= new wxComboBox( itemPanel10
, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
, _T(""), wxDefaultPosition
, wxDefaultSize
, 0, m_symbolFontCtrlStrings
, wxCB_DROPDOWN
);
239 m_symbolFontCtrl
->SetToolTip(_("Available fonts."));
240 itemBoxSizer19
->Add(m_symbolFontCtrl
, 0, wxGROW
|wxALL
, 5);
242 itemBoxSizer12
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
244 wxStaticLine
* itemStaticLine28
= new wxStaticLine( itemPanel10
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
245 itemBoxSizer12
->Add(itemStaticLine28
, 0, wxGROW
|wxALL
, 5);
247 itemBoxSizer12
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
249 wxBoxSizer
* itemBoxSizer30
= new wxBoxSizer(wxVERTICAL
);
250 itemBoxSizer12
->Add(itemBoxSizer30
, 0, wxALIGN_TOP
|wxRIGHT
|wxTOP
|wxBOTTOM
, 5);
251 m_parenthesesCtrl
= new wxCheckBox( itemPanel10
, ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL
, _("&Parentheses"), wxDefaultPosition
, wxDefaultSize
, 0 );
252 m_parenthesesCtrl
->SetValue(false);
253 m_parenthesesCtrl
->SetHelpText(_("Check to enclose the bullet in parentheses."));
255 m_parenthesesCtrl
->SetToolTip(_("Check to enclose the bullet in parentheses."));
256 itemBoxSizer30
->Add(m_parenthesesCtrl
, 0, wxALIGN_LEFT
|wxALL
, 5);
258 m_periodCtrl
= new wxCheckBox( itemPanel10
, ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
, _("Peri&od"), wxDefaultPosition
, wxDefaultSize
, 0 );
259 m_periodCtrl
->SetValue(false);
260 m_periodCtrl
->SetHelpText(_("Check to add a period after the bullet."));
262 m_periodCtrl
->SetToolTip(_("Check to add a period after the bullet."));
263 itemBoxSizer30
->Add(m_periodCtrl
, 0, wxALIGN_LEFT
|wxALL
, 5);
265 itemNotebook9
->AddPage(itemPanel10
, _("Bullet style"));
267 wxPanel
* itemPanel33
= new wxPanel( itemNotebook9
, ID_RICHTEXTLISTSTYLEPAGE_SPACING
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxTAB_TRAVERSAL
);
268 wxBoxSizer
* itemBoxSizer34
= new wxBoxSizer(wxVERTICAL
);
269 itemPanel33
->SetSizer(itemBoxSizer34
);
271 wxBoxSizer
* itemBoxSizer35
= new wxBoxSizer(wxHORIZONTAL
);
272 itemBoxSizer34
->Add(itemBoxSizer35
, 0, wxGROW
, 5);
273 wxBoxSizer
* itemBoxSizer36
= new wxBoxSizer(wxVERTICAL
);
274 itemBoxSizer35
->Add(itemBoxSizer36
, 0, wxGROW
, 5);
275 wxStaticText
* itemStaticText37
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("&Alignment"), wxDefaultPosition
, wxDefaultSize
, 0 );
276 itemBoxSizer36
->Add(itemStaticText37
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
278 wxBoxSizer
* itemBoxSizer38
= new wxBoxSizer(wxHORIZONTAL
);
279 itemBoxSizer36
->Add(itemBoxSizer38
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
280 itemBoxSizer38
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
, 5);
282 wxBoxSizer
* itemBoxSizer40
= new wxBoxSizer(wxVERTICAL
);
283 itemBoxSizer38
->Add(itemBoxSizer40
, 0, wxALIGN_CENTER_VERTICAL
|wxTOP
, 5);
284 m_alignmentLeft
= new wxRadioButton( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
, _("&Left"), wxDefaultPosition
, wxDefaultSize
, wxRB_GROUP
);
285 m_alignmentLeft
->SetValue(false);
286 m_alignmentLeft
->SetHelpText(_("Left-align text."));
288 m_alignmentLeft
->SetToolTip(_("Left-align text."));
289 itemBoxSizer40
->Add(m_alignmentLeft
, 0, wxALIGN_LEFT
|wxALL
, 5);
291 m_alignmentRight
= new wxRadioButton( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
, _("&Right"), wxDefaultPosition
, wxDefaultSize
, 0 );
292 m_alignmentRight
->SetValue(false);
293 m_alignmentRight
->SetHelpText(_("Right-align text."));
295 m_alignmentRight
->SetToolTip(_("Right-align text."));
296 itemBoxSizer40
->Add(m_alignmentRight
, 0, wxALIGN_LEFT
|wxALL
, 5);
298 m_alignmentJustified
= new wxRadioButton( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
, _("&Justified"), wxDefaultPosition
, wxDefaultSize
, 0 );
299 m_alignmentJustified
->SetValue(false);
300 m_alignmentJustified
->SetHelpText(_("Justify text left and right."));
302 m_alignmentJustified
->SetToolTip(_("Justify text left and right."));
303 itemBoxSizer40
->Add(m_alignmentJustified
, 0, wxALIGN_LEFT
|wxALL
, 5);
305 m_alignmentCentred
= new wxRadioButton( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_CENTERED
, _("Cen&tred"), wxDefaultPosition
, wxDefaultSize
, 0 );
306 m_alignmentCentred
->SetValue(false);
307 m_alignmentCentred
->SetHelpText(_("Centre text."));
309 m_alignmentCentred
->SetToolTip(_("Centre text."));
310 itemBoxSizer40
->Add(m_alignmentCentred
, 0, wxALIGN_LEFT
|wxALL
, 5);
312 m_alignmentIndeterminate
= new wxRadioButton( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
, _("&Indeterminate"), wxDefaultPosition
, wxDefaultSize
, 0 );
313 m_alignmentIndeterminate
->SetValue(false);
314 m_alignmentIndeterminate
->SetHelpText(_("Use the current alignment setting."));
316 m_alignmentIndeterminate
->SetToolTip(_("Use the current alignment setting."));
317 itemBoxSizer40
->Add(m_alignmentIndeterminate
, 0, wxALIGN_LEFT
|wxALL
, 5);
319 itemBoxSizer35
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
321 wxStaticLine
* itemStaticLine47
= new wxStaticLine( itemPanel33
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
322 itemBoxSizer35
->Add(itemStaticLine47
, 0, wxGROW
|wxLEFT
|wxBOTTOM
, 5);
324 itemBoxSizer35
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
326 wxBoxSizer
* itemBoxSizer49
= new wxBoxSizer(wxVERTICAL
);
327 itemBoxSizer35
->Add(itemBoxSizer49
, 0, wxGROW
, 5);
328 wxStaticText
* itemStaticText50
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("&Indentation (tenths of a mm)"), wxDefaultPosition
, wxDefaultSize
, 0 );
329 itemBoxSizer49
->Add(itemStaticText50
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
331 wxBoxSizer
* itemBoxSizer51
= new wxBoxSizer(wxHORIZONTAL
);
332 itemBoxSizer49
->Add(itemBoxSizer51
, 0, wxALIGN_LEFT
|wxALL
, 5);
333 itemBoxSizer51
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
, 5);
335 wxFlexGridSizer
* itemFlexGridSizer53
= new wxFlexGridSizer(2, 2, 0, 0);
336 itemBoxSizer51
->Add(itemFlexGridSizer53
, 0, wxALIGN_CENTER_VERTICAL
, 5);
337 wxStaticText
* itemStaticText54
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("&Left:"), wxDefaultPosition
, wxDefaultSize
, 0 );
338 itemFlexGridSizer53
->Add(itemStaticText54
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
340 wxBoxSizer
* itemBoxSizer55
= new wxBoxSizer(wxHORIZONTAL
);
341 itemFlexGridSizer53
->Add(itemBoxSizer55
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALIGN_CENTER_VERTICAL
, 5);
342 m_indentLeft
= new wxTextCtrl( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
, _T(""), wxDefaultPosition
, wxSize(50, -1), 0 );
343 m_indentLeft
->SetHelpText(_("The left indent."));
345 m_indentLeft
->SetToolTip(_("The left indent."));
346 itemBoxSizer55
->Add(m_indentLeft
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
348 wxStaticText
* itemStaticText57
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("Left (&first line):"), wxDefaultPosition
, wxDefaultSize
, 0 );
349 itemFlexGridSizer53
->Add(itemStaticText57
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
351 wxBoxSizer
* itemBoxSizer58
= new wxBoxSizer(wxHORIZONTAL
);
352 itemFlexGridSizer53
->Add(itemBoxSizer58
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALIGN_CENTER_VERTICAL
, 5);
353 m_indentLeftFirst
= new wxTextCtrl( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
, _T(""), wxDefaultPosition
, wxSize(50, -1), 0 );
354 m_indentLeftFirst
->SetHelpText(_("The first line indent."));
356 m_indentLeftFirst
->SetToolTip(_("The first line indent."));
357 itemBoxSizer58
->Add(m_indentLeftFirst
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
359 wxStaticText
* itemStaticText60
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("&Right:"), wxDefaultPosition
, wxDefaultSize
, 0 );
360 itemFlexGridSizer53
->Add(itemStaticText60
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
362 wxBoxSizer
* itemBoxSizer61
= new wxBoxSizer(wxHORIZONTAL
);
363 itemFlexGridSizer53
->Add(itemBoxSizer61
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALIGN_CENTER_VERTICAL
, 5);
364 m_indentRight
= new wxTextCtrl( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
, _T(""), wxDefaultPosition
, wxSize(50, -1), 0 );
365 m_indentRight
->SetHelpText(_("The right indent."));
367 m_indentRight
->SetToolTip(_("The right indent."));
368 itemBoxSizer61
->Add(m_indentRight
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
370 itemBoxSizer35
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
372 wxStaticLine
* itemStaticLine64
= new wxStaticLine( itemPanel33
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_VERTICAL
);
373 itemBoxSizer35
->Add(itemStaticLine64
, 0, wxGROW
|wxTOP
|wxBOTTOM
, 5);
375 itemBoxSizer35
->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
377 wxBoxSizer
* itemBoxSizer66
= new wxBoxSizer(wxVERTICAL
);
378 itemBoxSizer35
->Add(itemBoxSizer66
, 0, wxGROW
, 5);
379 wxStaticText
* itemStaticText67
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("&Spacing (tenths of a mm)"), wxDefaultPosition
, wxDefaultSize
, 0 );
380 itemBoxSizer66
->Add(itemStaticText67
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
382 wxBoxSizer
* itemBoxSizer68
= new wxBoxSizer(wxHORIZONTAL
);
383 itemBoxSizer66
->Add(itemBoxSizer68
, 0, wxALIGN_LEFT
|wxALL
, 5);
384 itemBoxSizer68
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
, 5);
386 wxFlexGridSizer
* itemFlexGridSizer70
= new wxFlexGridSizer(2, 2, 0, 0);
387 itemBoxSizer68
->Add(itemFlexGridSizer70
, 0, wxALIGN_CENTER_VERTICAL
, 5);
388 wxStaticText
* itemStaticText71
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("Before a paragraph:"), wxDefaultPosition
, wxDefaultSize
, 0 );
389 itemFlexGridSizer70
->Add(itemStaticText71
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
391 wxBoxSizer
* itemBoxSizer72
= new wxBoxSizer(wxHORIZONTAL
);
392 itemFlexGridSizer70
->Add(itemBoxSizer72
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALIGN_CENTER_VERTICAL
, 5);
393 m_spacingBefore
= new wxTextCtrl( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
, _T(""), wxDefaultPosition
, wxSize(50, -1), 0 );
394 m_spacingBefore
->SetHelpText(_("The spacing before the paragraph."));
396 m_spacingBefore
->SetToolTip(_("The spacing before the paragraph."));
397 itemBoxSizer72
->Add(m_spacingBefore
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
399 wxStaticText
* itemStaticText74
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("After a paragraph:"), wxDefaultPosition
, wxDefaultSize
, 0 );
400 itemFlexGridSizer70
->Add(itemStaticText74
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
402 wxBoxSizer
* itemBoxSizer75
= new wxBoxSizer(wxHORIZONTAL
);
403 itemFlexGridSizer70
->Add(itemBoxSizer75
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALIGN_CENTER_VERTICAL
, 5);
404 m_spacingAfter
= new wxTextCtrl( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
, _T(""), wxDefaultPosition
, wxSize(50, -1), 0 );
405 m_spacingAfter
->SetHelpText(_("The spacing after the paragraph."));
407 m_spacingAfter
->SetToolTip(_("The spacing after the paragraph."));
408 itemBoxSizer75
->Add(m_spacingAfter
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
410 wxStaticText
* itemStaticText77
= new wxStaticText( itemPanel33
, wxID_STATIC
, _("Line spacing:"), wxDefaultPosition
, wxDefaultSize
, 0 );
411 itemFlexGridSizer70
->Add(itemStaticText77
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
|wxADJUST_MINSIZE
, 5);
413 wxBoxSizer
* itemBoxSizer78
= new wxBoxSizer(wxHORIZONTAL
);
414 itemFlexGridSizer70
->Add(itemBoxSizer78
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALIGN_CENTER_VERTICAL
, 5);
415 wxString m_spacingLineStrings
[] = {
420 m_spacingLine
= new wxComboBox( itemPanel33
, ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
, _("Single"), wxDefaultPosition
, wxDefaultSize
, 3, m_spacingLineStrings
, wxCB_READONLY
);
421 m_spacingLine
->SetStringSelection(_("Single"));
422 m_spacingLine
->SetHelpText(_("The line spacing."));
424 m_spacingLine
->SetToolTip(_("The line spacing."));
425 itemBoxSizer78
->Add(m_spacingLine
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
427 itemNotebook9
->AddPage(itemPanel33
, _("Spacing"));
429 itemBoxSizer3
->Add(itemNotebook9
, 0, wxGROW
|wxALL
, 5);
431 m_previewCtrl
= new wxRichTextCtrl( itemPanel1
, ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(350, 180), wxSUNKEN_BORDER
);
432 m_previewCtrl
->SetHelpText(_("Shows a preview of the bullet settings."));
434 m_previewCtrl
->SetToolTip(_("Shows a preview of the bullet settings."));
435 itemBoxSizer3
->Add(m_previewCtrl
, 0, wxGROW
|wxALL
, 5);
437 ////@end wxRichTextListStylePage content construction
439 m_styleListBox
->Append(_("(None)"));
440 m_styleListBox
->Append(_("Arabic"));
441 m_styleListBox
->Append(_("Upper case letters"));
442 m_styleListBox
->Append(_("Lower case letters"));
443 m_styleListBox
->Append(_("Upper case roman numerals"));
444 m_styleListBox
->Append(_("Lower case roman numerals"));
445 m_styleListBox
->Append(_("Symbol"));
446 m_styleListBox
->Append(_("Bitmap"));
448 m_symbolCtrl
->Append(_("*"));
449 m_symbolCtrl
->Append(_("-"));
450 m_symbolCtrl
->Append(_(">"));
451 m_symbolCtrl
->Append(_("+"));
452 m_symbolCtrl
->Append(_("~"));
454 wxArrayString facenames
= wxRichTextCtrl::GetAvailableFontNames();
457 m_symbolFontCtrl
->Append(facenames
);
460 /// Updates the font preview
461 void wxRichTextListStylePage::UpdatePreview()
463 static const wxChar
* s_para1
= wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \
464 Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.");
466 static const wxChar
* s_para2
= wxT("Duis pharetra consequat dui. Nullam vitae justo id mauris lobortis interdum.");
468 static const wxChar
* s_para3
= wxT("\nInteger convallis dolor at augue \
469 iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n");
471 wxRichTextListStyleDefinition
* def
= wxDynamicCast(wxRichTextFormattingDialog::GetDialogStyleDefinition(this),
472 wxRichTextListStyleDefinition
);
474 wxTextAttrEx
attr(def
->GetStyle());
475 attr
.SetFlags(attr
.GetFlags() &
476 (wxTEXT_ATTR_ALIGNMENT
|wxTEXT_ATTR_LEFT_INDENT
|wxTEXT_ATTR_RIGHT_INDENT
|wxTEXT_ATTR_PARA_SPACING_BEFORE
|wxTEXT_ATTR_PARA_SPACING_AFTER
|
477 wxTEXT_ATTR_LINE_SPACING
|
478 wxTEXT_ATTR_BULLET_STYLE
|wxTEXT_ATTR_BULLET_NUMBER
|wxTEXT_ATTR_BULLET_SYMBOL
));
480 wxFont
font(m_previewCtrl
->GetFont());
481 font
.SetPointSize(9);
482 m_previewCtrl
->SetFont(font
);
484 wxTextAttrEx normalParaAttr
;
485 normalParaAttr
.SetFont(font
);
486 normalParaAttr
.SetTextColour(wxColour(wxT("LIGHT GREY")));
488 m_previewCtrl
->Freeze();
489 m_previewCtrl
->Clear();
491 m_previewCtrl
->BeginStyle(normalParaAttr
);
492 m_previewCtrl
->WriteText(s_para1
);
493 m_previewCtrl
->EndStyle();
495 m_previewCtrl
->BeginStyle(attr
);
498 for (i
= 0; i
< 10; i
++)
500 wxTextAttrEx levelAttr
= * def
->GetLevelAttributes(i
);
501 levelAttr
.SetBulletNumber(1);
502 m_previewCtrl
->BeginStyle(levelAttr
);
503 m_previewCtrl
->WriteText(wxString::Format(wxT("\nList level %d. "), i
+1) + s_para2
);
504 m_previewCtrl
->EndStyle();
506 m_previewCtrl
->EndStyle();
508 m_previewCtrl
->BeginStyle(normalParaAttr
);
509 m_previewCtrl
->WriteText(s_para3
);
510 m_previewCtrl
->EndStyle();
512 m_previewCtrl
->Thaw();
515 /// Transfer data from/to window
516 bool wxRichTextListStylePage::TransferDataFromWindow()
518 wxPanel::TransferDataFromWindow();
520 m_currentLevel
= m_levelCtrl
->GetValue();
522 wxTextAttrEx
* attr
= GetAttributesForSelection();
524 if (m_alignmentLeft
->GetValue())
525 attr
->SetAlignment(wxTEXT_ALIGNMENT_LEFT
);
526 else if (m_alignmentCentred
->GetValue())
527 attr
->SetAlignment(wxTEXT_ALIGNMENT_CENTRE
);
528 else if (m_alignmentRight
->GetValue())
529 attr
->SetAlignment(wxTEXT_ALIGNMENT_RIGHT
);
530 else if (m_alignmentJustified
->GetValue())
531 attr
->SetAlignment(wxTEXT_ALIGNMENT_JUSTIFIED
);
534 attr
->SetAlignment(wxTEXT_ALIGNMENT_DEFAULT
);
535 attr
->SetFlags(attr
->GetFlags() & (~wxTEXT_ATTR_ALIGNMENT
));
538 wxString
leftIndent(m_indentLeft
->GetValue());
539 wxString
leftFirstIndent(m_indentLeftFirst
->GetValue());
540 if (!leftIndent
.empty())
542 int visualLeftIndent
= wxAtoi(leftIndent
);
543 int visualLeftFirstIndent
= wxAtoi(leftFirstIndent
);
544 int actualLeftIndent
= visualLeftFirstIndent
;
545 int actualLeftSubIndent
= visualLeftIndent
- visualLeftFirstIndent
;
547 attr
->SetLeftIndent(actualLeftIndent
, actualLeftSubIndent
);
550 attr
->SetFlags(attr
->GetFlags() & (~wxTEXT_ATTR_LEFT_INDENT
));
552 wxString
rightIndent(m_indentRight
->GetValue());
553 if (!rightIndent
.empty())
554 attr
->SetRightIndent(wxAtoi(rightIndent
));
556 attr
->SetFlags(attr
->GetFlags() & (~wxTEXT_ATTR_RIGHT_INDENT
));
558 wxString
spacingAfter(m_spacingAfter
->GetValue());
559 if (!spacingAfter
.empty())
560 attr
->SetParagraphSpacingAfter(wxAtoi(spacingAfter
));
562 attr
->SetFlags(attr
->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_AFTER
));
564 wxString
spacingBefore(m_spacingBefore
->GetValue());
565 if (!spacingBefore
.empty())
566 attr
->SetParagraphSpacingBefore(wxAtoi(spacingBefore
));
568 attr
->SetFlags(attr
->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE
));
570 int spacingIndex
= m_spacingLine
->GetSelection();
572 if (spacingIndex
== 0)
574 else if (spacingIndex
== 1)
576 else if (spacingIndex
== 2)
579 if (lineSpacing
== 0)
580 attr
->SetFlags(attr
->GetFlags() & (~wxTEXT_ATTR_LINE_SPACING
));
582 attr
->SetLineSpacing(lineSpacing
);
585 if (true) // m_hasBulletStyle)
587 long bulletStyle
= 0;
589 int index
= m_styleListBox
->GetSelection();
591 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ARABIC
;
593 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
;
595 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
;
597 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
;
599 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
;
601 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_SYMBOL
;
603 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_BITMAP
;
605 if (m_parenthesesCtrl
->GetValue())
606 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
;
607 if (m_periodCtrl
->GetValue())
608 bulletStyle
|= wxTEXT_ATTR_BULLET_STYLE_PERIOD
;
610 attr
->SetBulletStyle(bulletStyle
);
613 // if (m_hasBulletSymbol)
616 if (m_symbolCtrl
->GetValue().length() > 0)
617 c
= m_symbolCtrl
->GetValue()[0];
618 attr
->SetBulletSymbol(c
);
619 attr
->SetBulletFont(m_symbolFontCtrl
->GetValue());
625 bool wxRichTextListStylePage::TransferDataToWindow()
627 DoTransferDataToWindow();
633 /// Just transfer to the window
634 void wxRichTextListStylePage::DoTransferDataToWindow()
638 wxPanel::TransferDataToWindow();
640 m_levelCtrl
->SetValue(m_currentLevel
);
642 wxTextAttrEx
* attr
= GetAttributesForSelection();
644 if (attr
->HasAlignment())
646 if (attr
->GetAlignment() == wxTEXT_ALIGNMENT_LEFT
)
647 m_alignmentLeft
->SetValue(true);
648 else if (attr
->GetAlignment() == wxTEXT_ALIGNMENT_RIGHT
)
649 m_alignmentRight
->SetValue(true);
650 else if (attr
->GetAlignment() == wxTEXT_ALIGNMENT_CENTRE
)
651 m_alignmentCentred
->SetValue(true);
652 else if (attr
->GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED
)
653 m_alignmentJustified
->SetValue(true);
655 m_alignmentIndeterminate
->SetValue(true);
658 m_alignmentIndeterminate
->SetValue(true);
660 if (attr
->HasLeftIndent())
662 wxString
leftIndent(wxString::Format(wxT("%ld"), attr
->GetLeftIndent() + attr
->GetLeftSubIndent()));
663 wxString
leftFirstIndent(wxString::Format(wxT("%ld"), attr
->GetLeftIndent()));
665 m_indentLeft
->SetValue(leftIndent
);
666 m_indentLeftFirst
->SetValue(leftFirstIndent
);
670 m_indentLeft
->SetValue(wxEmptyString
);
671 m_indentLeftFirst
->SetValue(wxEmptyString
);
674 if (attr
->HasRightIndent())
676 wxString
rightIndent(wxString::Format(wxT("%ld"), attr
->GetRightIndent()));
678 m_indentRight
->SetValue(rightIndent
);
681 m_indentRight
->SetValue(wxEmptyString
);
683 if (attr
->HasParagraphSpacingAfter())
685 wxString
spacingAfter(wxString::Format(wxT("%d"), attr
->GetParagraphSpacingAfter()));
687 m_spacingAfter
->SetValue(spacingAfter
);
690 m_spacingAfter
->SetValue(wxEmptyString
);
692 if (attr
->HasParagraphSpacingBefore())
694 wxString
spacingBefore(wxString::Format(wxT("%d"), attr
->GetParagraphSpacingBefore()));
696 m_spacingBefore
->SetValue(spacingBefore
);
699 m_spacingBefore
->SetValue(wxEmptyString
);
701 if (attr
->HasLineSpacing())
705 int lineSpacing
= attr
->GetLineSpacing();
706 if (lineSpacing
== 10)
708 else if (lineSpacing
== 15)
710 else if (lineSpacing
== 20)
715 m_spacingLine
->SetSelection(index
);
718 m_spacingLine
->SetSelection(-1);
721 if (attr
->HasBulletStyle())
724 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC
)
726 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
)
728 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
)
730 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
)
732 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
)
734 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL
)
736 else if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP
)
738 m_styleListBox
->SetSelection(index
);
740 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
)
741 m_parenthesesCtrl
->SetValue(true);
743 m_parenthesesCtrl
->SetValue(false);
745 if (attr
->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD
)
746 m_periodCtrl
->SetValue(true);
748 m_periodCtrl
->SetValue(false);
751 m_styleListBox
->SetSelection(-1);
753 if (attr
->HasBulletSymbol())
755 wxChar c
= attr
->GetBulletSymbol();
758 m_symbolCtrl
->SetValue(s
);
759 m_symbolFontCtrl
->SetValue(attr
->GetBulletFont());
762 m_symbolCtrl
->SetValue(wxEmptyString
);
764 m_dontUpdate
= false;
767 /// Get attributes for selected level
768 wxTextAttrEx
* wxRichTextListStylePage::GetAttributesForSelection()
770 wxRichTextListStyleDefinition
* def
= wxDynamicCast(wxRichTextFormattingDialog::GetDialogStyleDefinition(this),
771 wxRichTextListStyleDefinition
);
773 int value
= m_levelCtrl
->GetValue();
776 return def
->GetLevelAttributes(value
-1);
781 /// Just transfer from the window and update the preview
782 void wxRichTextListStylePage::TransferAndPreview()
786 TransferDataFromWindow();
793 * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
796 void wxRichTextListStylePage::OnLevelUpdated( wxSpinEvent
& WXUNUSED(event
) )
800 m_currentLevel
= m_levelCtrl
->GetValue();
801 TransferDataToWindow();
806 * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
809 void wxRichTextListStylePage::OnLevelUp( wxSpinEvent
& event
)
813 m_currentLevel
= event
.GetPosition();
814 TransferDataToWindow();
819 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
822 void wxRichTextListStylePage::OnLevelDown( wxSpinEvent
& event
)
826 m_currentLevel
= event
.GetPosition();
827 TransferDataToWindow();
832 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
835 void wxRichTextListStylePage::OnLevelTextUpdated( wxCommandEvent
& event
)
837 // Can cause problems
841 m_currentLevel
= event
.GetInt();
842 TransferDataToWindow();
848 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL
851 void wxRichTextListStylePage::OnLevelUIUpdate( wxUpdateUIEvent
& event
)
853 ////@begin wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL in wxRichTextListStylePage.
854 // Before editing this code, remove the block markers.
856 ////@end wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL in wxRichTextListStylePage.
860 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX
863 void wxRichTextListStylePage::OnStylelistboxSelected( wxCommandEvent
& WXUNUSED(event
) )
865 TransferAndPreview();
869 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC
872 void wxRichTextListStylePage::OnSymbolstaticUpdate( wxUpdateUIEvent
& event
)
874 OnSymbolUpdate(event
);
878 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
881 void wxRichTextListStylePage::OnSymbolctrlSelected( wxCommandEvent
& WXUNUSED(event
) )
883 TransferAndPreview();
887 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
890 void wxRichTextListStylePage::OnSymbolctrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
892 TransferAndPreview();
896 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
899 void wxRichTextListStylePage::OnSymbolctrlUIUpdate( wxUpdateUIEvent
& event
)
901 OnSymbolUpdate(event
);
905 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
908 void wxRichTextListStylePage::OnChooseSymbolClick( wxCommandEvent
& WXUNUSED(event
) )
910 int sel
= m_styleListBox
->GetSelection();
913 wxString symbol
= m_symbolCtrl
->GetValue();
914 wxString fontName
= m_symbolFontCtrl
->GetValue();
915 wxSymbolPickerDialog
dlg(symbol
, fontName
, fontName
, this);
917 if (dlg
.ShowModal() == wxID_OK
)
921 m_symbolCtrl
->SetValue(dlg
.GetSymbol());
922 m_symbolFontCtrl
->SetValue(dlg
.GetFontName());
924 TransferAndPreview();
926 m_dontUpdate
= false;
932 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
935 void wxRichTextListStylePage::OnChooseSymbolUpdate( wxUpdateUIEvent
& event
)
937 OnSymbolUpdate(event
);
941 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
944 void wxRichTextListStylePage::OnSymbolfontctrlSelected( wxCommandEvent
& WXUNUSED(event
) )
946 TransferAndPreview();
950 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
953 void wxRichTextListStylePage::OnSymbolfontctrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
955 TransferAndPreview();
959 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL
962 void wxRichTextListStylePage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent
& event
)
964 OnSymbolUpdate(event
);
968 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL
971 void wxRichTextListStylePage::OnParenthesesctrlClick( wxCommandEvent
& WXUNUSED(event
) )
973 TransferAndPreview();
977 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL
980 void wxRichTextListStylePage::OnParenthesesctrlUpdate( wxUpdateUIEvent
& event
)
982 ////@begin wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL in wxRichTextListStylePage.
983 // Before editing this code, remove the block markers.
985 ////@end wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL in wxRichTextListStylePage.
989 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
992 void wxRichTextListStylePage::OnPeriodctrlClick( wxCommandEvent
& WXUNUSED(event
) )
994 TransferAndPreview();
998 * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL
1001 void wxRichTextListStylePage::OnPeriodctrlUpdate( wxUpdateUIEvent
& event
)
1003 ////@begin wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL in wxRichTextListStylePage.
1004 // Before editing this code, remove the block markers.
1006 ////@end wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL in wxRichTextListStylePage.
1010 * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT
1013 void wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected( wxCommandEvent
& WXUNUSED(event
) )
1015 TransferAndPreview();
1019 * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT
1022 void wxRichTextListStylePage::OnRichtextliststylepageAlignrightSelected( wxCommandEvent
& WXUNUSED(event
) )
1024 TransferAndPreview();
1028 * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED
1031 void wxRichTextListStylePage::OnRichtextliststylepageJustifiedSelected( wxCommandEvent
& WXUNUSED(event
) )
1033 TransferAndPreview();
1037 * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED
1040 void wxRichTextListStylePage::OnRichtextliststylepageCenteredSelected( wxCommandEvent
& WXUNUSED(event
) )
1042 TransferAndPreview();
1046 * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE
1049 void wxRichTextListStylePage::OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent
& WXUNUSED(event
) )
1051 TransferAndPreview();
1055 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT
1058 void wxRichTextListStylePage::OnIndentLeftUpdated( wxCommandEvent
& WXUNUSED(event
) )
1060 TransferAndPreview();
1064 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE
1067 void wxRichTextListStylePage::OnIndentFirstLineUpdated( wxCommandEvent
& WXUNUSED(event
) )
1069 TransferAndPreview();
1073 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT
1076 void wxRichTextListStylePage::OnIndentRightUpdated( wxCommandEvent
& WXUNUSED(event
) )
1078 TransferAndPreview();
1082 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE
1085 void wxRichTextListStylePage::OnSpacingBeforeUpdated( wxCommandEvent
& WXUNUSED(event
) )
1087 TransferAndPreview();
1091 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER
1094 void wxRichTextListStylePage::OnSpacingAfterUpdated( wxCommandEvent
& WXUNUSED(event
) )
1096 TransferAndPreview();
1100 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING
1103 void wxRichTextListStylePage::OnLineSpacingSelected( wxCommandEvent
& WXUNUSED(event
) )
1105 TransferAndPreview();
1109 * Should we show tooltips?
1112 bool wxRichTextListStylePage::ShowToolTips()
1114 return wxRichTextFormattingDialog::ShowToolTips();
1118 * Get bitmap resources
1121 wxBitmap
wxRichTextListStylePage::GetBitmapResource( const wxString
& name
)
1124 ////@begin wxRichTextListStylePage bitmap retrieval
1126 return wxNullBitmap
;
1127 ////@end wxRichTextListStylePage bitmap retrieval
1131 * Get icon resources
1134 wxIcon
wxRichTextListStylePage::GetIconResource( const wxString
& name
)
1137 ////@begin wxRichTextListStylePage icon retrieval
1140 ////@end wxRichTextListStylePage icon retrieval
1143 /// Update for symbol-related controls
1144 void wxRichTextListStylePage::OnSymbolUpdate( wxUpdateUIEvent
& event
)
1146 int sel
= m_styleListBox
->GetSelection();
1147 event
.Enable(sel
== 6);
1150 /// Update for number-related controls
1151 void wxRichTextListStylePage::OnNumberUpdate( wxUpdateUIEvent
& event
)
1153 int sel
= m_styleListBox
->GetSelection();
1154 event
.Enable((sel
!= 6 && sel
!= 7 && sel
!= 0));
1158 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT
1161 void wxRichTextListStylePage::OnChooseFontClick( wxCommandEvent
& WXUNUSED(event
) )
1163 wxTextAttrEx
* attr
= GetAttributesForSelection();
1165 int pages
= wxRICHTEXT_FORMAT_FONT
;
1166 wxRichTextFormattingDialog formatDlg
;
1167 formatDlg
.SetStyle(*attr
, false);
1168 formatDlg
.Create(pages
, this);
1170 if (formatDlg
.ShowModal() == wxID_OK
)
1172 (*attr
) = formatDlg
.GetAttributes();
1173 TransferAndPreview();