1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/richtext/richtextfontpage.cpp
3 // Purpose: Font page for wxRichTextFormattingDialog
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/richtext/richtextfontpage.h"
14 * wxRichTextFontPage type definition
17 IMPLEMENT_DYNAMIC_CLASS( wxRichTextFontPage
, wxRichTextDialogPage
)
20 * wxRichTextFontPage event table definition
23 BEGIN_EVENT_TABLE( wxRichTextFontPage
, wxRichTextDialogPage
)
24 EVT_LISTBOX( ID_RICHTEXTFONTPAGE_FACELISTBOX
, wxRichTextFontPage::OnFaceListBoxSelected
)
25 EVT_BUTTON( ID_RICHTEXTFONTPAGE_COLOURCTRL
, wxRichTextFontPage::OnColourClicked
)
26 EVT_BUTTON( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL
, wxRichTextFontPage::OnColourClicked
)
28 ////@begin wxRichTextFontPage event table entries
29 EVT_IDLE( wxRichTextFontPage::OnIdle
)
31 EVT_TEXT( ID_RICHTEXTFONTPAGE_FACETEXTCTRL
, wxRichTextFontPage::OnFaceTextCtrlUpdated
)
33 EVT_TEXT( ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
, wxRichTextFontPage::OnSizeTextCtrlUpdated
)
35 EVT_SPIN_UP( ID_RICHTEXTFONTPAGE_SPINBUTTONS
, wxRichTextFontPage::OnRichtextfontpageSpinbuttonsUp
)
36 EVT_SPIN_DOWN( ID_RICHTEXTFONTPAGE_SPINBUTTONS
, wxRichTextFontPage::OnRichtextfontpageSpinbuttonsDown
)
38 EVT_CHOICE( ID_RICHTEXTFONTPAGE_SIZE_UNITS
, wxRichTextFontPage::OnRichtextfontpageSizeUnitsSelected
)
40 EVT_LISTBOX( ID_RICHTEXTFONTPAGE_SIZELISTBOX
, wxRichTextFontPage::OnSizeListBoxSelected
)
42 EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_STYLECTRL
, wxRichTextFontPage::OnStyleCtrlSelected
)
44 EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_WEIGHTCTRL
, wxRichTextFontPage::OnWeightCtrlSelected
)
46 EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
, wxRichTextFontPage::OnUnderliningCtrlSelected
)
48 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL
, wxRichTextFontPage::OnUnderliningCtrlSelected
)
50 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL
, wxRichTextFontPage::OnUnderliningCtrlSelected
)
52 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
, wxRichTextFontPage::OnStrikethroughctrlClick
)
54 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_CAPSCTRL
, wxRichTextFontPage::OnCapsctrlClick
)
56 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL
, wxRichTextFontPage::OnCapsctrlClick
)
58 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUPERSCRIPT
, wxRichTextFontPage::OnRichtextfontpageSuperscriptClick
)
60 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUBSCRIPT
, wxRichTextFontPage::OnRichtextfontpageSubscriptClick
)
62 ////@end wxRichTextFontPage event table entries
66 IMPLEMENT_HELP_PROVISION(wxRichTextFontPage
)
68 * wxRichTextFontPage constructors
71 wxRichTextFontPage::wxRichTextFontPage( )
76 wxRichTextFontPage::wxRichTextFontPage( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
79 Create(parent
, id
, pos
, size
, style
);
86 void wxRichTextFontPage::Init()
89 m_colourPresent
= false;
90 m_bgColourPresent
= false;
92 ////@begin wxRichTextFontPage member initialisation
93 m_faceTextCtrl
= NULL
;
94 m_sizeTextCtrl
= NULL
;
95 m_fontSizeSpinButtons
= NULL
;
96 m_sizeUnitsCtrl
= NULL
;
97 m_fontListBoxParent
= NULL
;
102 m_underliningCtrl
= NULL
;
103 m_textColourLabel
= NULL
;
105 m_bgColourLabel
= NULL
;
106 m_bgColourCtrl
= NULL
;
107 m_strikethroughCtrl
= NULL
;
108 m_capitalsCtrl
= NULL
;
109 m_smallCapitalsCtrl
= NULL
;
110 m_superscriptCtrl
= NULL
;
111 m_subscriptCtrl
= NULL
;
112 m_previewCtrl
= NULL
;
113 ////@end wxRichTextFontPage member initialisation
117 * wxRichTextFontPage creator
120 bool wxRichTextFontPage::Create( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
122 ////@begin wxRichTextFontPage creation
123 wxRichTextDialogPage::Create( parent
, id
, pos
, size
, style
);
128 GetSizer()->SetSizeHints(this);
131 ////@end wxRichTextFontPage creation
136 * Control creation for wxRichTextFontPage
139 void wxRichTextFontPage::CreateControls()
141 ////@begin wxRichTextFontPage content construction
142 wxRichTextFontPage
* itemRichTextDialogPage1
= this;
144 wxBoxSizer
* itemBoxSizer2
= new wxBoxSizer(wxVERTICAL
);
145 itemRichTextDialogPage1
->SetSizer(itemBoxSizer2
);
147 wxBoxSizer
* itemBoxSizer3
= new wxBoxSizer(wxVERTICAL
);
148 itemBoxSizer2
->Add(itemBoxSizer3
, 1, wxGROW
|wxALL
, 5);
150 wxBoxSizer
* itemBoxSizer4
= new wxBoxSizer(wxHORIZONTAL
);
151 itemBoxSizer3
->Add(itemBoxSizer4
, 1, wxGROW
, 5);
153 wxBoxSizer
* itemBoxSizer5
= new wxBoxSizer(wxVERTICAL
);
154 itemBoxSizer4
->Add(itemBoxSizer5
, 1, wxGROW
, 5);
156 wxStaticText
* itemStaticText6
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Font:"), wxDefaultPosition
, wxDefaultSize
, 0 );
157 itemBoxSizer5
->Add(itemStaticText6
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
159 m_faceTextCtrl
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_FACETEXTCTRL
, wxEmptyString
, wxDefaultPosition
, wxDefaultSize
, 0 );
160 m_faceTextCtrl
->SetHelpText(_("Type a font name."));
161 if (wxRichTextFontPage::ShowToolTips())
162 m_faceTextCtrl
->SetToolTip(_("Type a font name."));
163 itemBoxSizer5
->Add(m_faceTextCtrl
, 0, wxGROW
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
165 wxBoxSizer
* itemBoxSizer8
= new wxBoxSizer(wxVERTICAL
);
166 itemBoxSizer4
->Add(itemBoxSizer8
, 0, wxGROW
, 5);
168 wxStaticText
* itemStaticText9
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Size:"), wxDefaultPosition
, wxDefaultSize
, 0 );
169 itemBoxSizer8
->Add(itemStaticText9
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
171 wxBoxSizer
* itemBoxSizer10
= new wxBoxSizer(wxHORIZONTAL
);
172 itemBoxSizer8
->Add(itemBoxSizer10
, 0, wxGROW
, 5);
174 m_sizeTextCtrl
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(50, -1), 0 );
175 m_sizeTextCtrl
->SetHelpText(_("Type a size in points."));
176 if (wxRichTextFontPage::ShowToolTips())
177 m_sizeTextCtrl
->SetToolTip(_("Type a size in points."));
178 itemBoxSizer10
->Add(m_sizeTextCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
, 5);
180 m_fontSizeSpinButtons
= new wxSpinButton( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SPINBUTTONS
, wxDefaultPosition
, wxSize(-1, 20), wxSP_VERTICAL
);
181 m_fontSizeSpinButtons
->SetRange(0, 100);
182 m_fontSizeSpinButtons
->SetValue(0);
183 itemBoxSizer10
->Add(m_fontSizeSpinButtons
, 0, wxALIGN_CENTER_VERTICAL
|wxRIGHT
|wxTOP
, 5);
185 wxArrayString m_sizeUnitsCtrlStrings
;
186 m_sizeUnitsCtrlStrings
.Add(_("pt"));
187 m_sizeUnitsCtrlStrings
.Add(_("px"));
188 m_sizeUnitsCtrl
= new wxChoice( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SIZE_UNITS
, wxDefaultPosition
, wxDefaultSize
, m_sizeUnitsCtrlStrings
, 0 );
189 m_sizeUnitsCtrl
->SetStringSelection(_("pt"));
190 m_sizeUnitsCtrl
->SetHelpText(_("The font size units, points or pixels."));
191 if (wxRichTextFontPage::ShowToolTips())
192 m_sizeUnitsCtrl
->SetToolTip(_("The font size units, points or pixels."));
193 itemBoxSizer10
->Add(m_sizeUnitsCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxRIGHT
|wxTOP
, 5);
195 m_fontListBoxParent
= new wxBoxSizer(wxHORIZONTAL
);
196 itemBoxSizer3
->Add(m_fontListBoxParent
, 0, wxGROW
, 5);
198 m_faceListBox
= new wxRichTextFontListBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_FACELISTBOX
, wxDefaultPosition
, wxSize(200, 100), 0 );
199 m_faceListBox
->SetHelpText(_("Lists the available fonts."));
200 if (wxRichTextFontPage::ShowToolTips())
201 m_faceListBox
->SetToolTip(_("Lists the available fonts."));
202 m_fontListBoxParent
->Add(m_faceListBox
, 1, wxALIGN_CENTER_VERTICAL
|wxALL
|wxFIXED_MINSIZE
, 5);
204 wxArrayString m_sizeListBoxStrings
;
205 m_sizeListBox
= new wxListBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SIZELISTBOX
, wxDefaultPosition
, wxSize(50, -1), m_sizeListBoxStrings
, wxLB_SINGLE
);
206 m_sizeListBox
->SetHelpText(_("Lists font sizes in points."));
207 if (wxRichTextFontPage::ShowToolTips())
208 m_sizeListBox
->SetToolTip(_("Lists font sizes in points."));
209 m_fontListBoxParent
->Add(m_sizeListBox
, 0, wxGROW
|wxALL
|wxFIXED_MINSIZE
, 5);
211 wxBoxSizer
* itemBoxSizer17
= new wxBoxSizer(wxHORIZONTAL
);
212 itemBoxSizer3
->Add(itemBoxSizer17
, 0, wxGROW
, 5);
214 wxBoxSizer
* itemBoxSizer18
= new wxBoxSizer(wxVERTICAL
);
215 itemBoxSizer17
->Add(itemBoxSizer18
, 0, wxGROW
, 5);
217 wxStaticText
* itemStaticText19
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Font st&yle:"), wxDefaultPosition
, wxDefaultSize
, 0 );
218 itemBoxSizer18
->Add(itemStaticText19
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
220 wxArrayString m_styleCtrlStrings
;
221 m_styleCtrl
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_STYLECTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(110, -1), m_styleCtrlStrings
, wxCB_READONLY
);
222 m_styleCtrl
->SetHelpText(_("Select regular or italic style."));
223 if (wxRichTextFontPage::ShowToolTips())
224 m_styleCtrl
->SetToolTip(_("Select regular or italic style."));
225 itemBoxSizer18
->Add(m_styleCtrl
, 0, wxGROW
|wxALL
, 5);
227 wxBoxSizer
* itemBoxSizer21
= new wxBoxSizer(wxVERTICAL
);
228 itemBoxSizer17
->Add(itemBoxSizer21
, 0, wxGROW
, 5);
230 wxStaticText
* itemStaticText22
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Font &weight:"), wxDefaultPosition
, wxDefaultSize
, 0 );
231 itemBoxSizer21
->Add(itemStaticText22
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
233 wxArrayString m_weightCtrlStrings
;
234 m_weightCtrl
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_WEIGHTCTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(110, -1), m_weightCtrlStrings
, wxCB_READONLY
);
235 m_weightCtrl
->SetHelpText(_("Select regular or bold."));
236 if (wxRichTextFontPage::ShowToolTips())
237 m_weightCtrl
->SetToolTip(_("Select regular or bold."));
238 itemBoxSizer21
->Add(m_weightCtrl
, 0, wxGROW
|wxALL
, 5);
240 wxBoxSizer
* itemBoxSizer24
= new wxBoxSizer(wxVERTICAL
);
241 itemBoxSizer17
->Add(itemBoxSizer24
, 0, wxGROW
, 5);
243 wxStaticText
* itemStaticText25
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Underlining:"), wxDefaultPosition
, wxDefaultSize
, 0 );
244 itemBoxSizer24
->Add(itemStaticText25
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
246 wxArrayString m_underliningCtrlStrings
;
247 m_underliningCtrl
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(110, -1), m_underliningCtrlStrings
, wxCB_READONLY
);
248 m_underliningCtrl
->SetHelpText(_("Select underlining or no underlining."));
249 if (wxRichTextFontPage::ShowToolTips())
250 m_underliningCtrl
->SetToolTip(_("Select underlining or no underlining."));
251 itemBoxSizer24
->Add(m_underliningCtrl
, 0, wxGROW
|wxALL
, 5);
253 itemBoxSizer17
->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL
|wxBOTTOM
, 5);
255 wxBoxSizer
* itemBoxSizer28
= new wxBoxSizer(wxVERTICAL
);
256 itemBoxSizer17
->Add(itemBoxSizer28
, 0, wxGROW
, 5);
258 m_textColourLabel
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL
, _("&Colour:"), wxDefaultPosition
, wxDefaultSize
, 0 );
259 m_textColourLabel
->SetValue(false);
260 itemBoxSizer28
->Add(m_textColourLabel
, 0, wxALIGN_CENTER_HORIZONTAL
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
262 m_colourCtrl
= new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_COLOURCTRL
, wxDefaultPosition
, wxSize(40, 20), 0 );
263 m_colourCtrl
->SetHelpText(_("Click to change the text colour."));
264 if (wxRichTextFontPage::ShowToolTips())
265 m_colourCtrl
->SetToolTip(_("Click to change the text colour."));
266 itemBoxSizer28
->Add(m_colourCtrl
, 0, wxGROW
|wxALL
, 5);
268 wxBoxSizer
* itemBoxSizer31
= new wxBoxSizer(wxVERTICAL
);
269 itemBoxSizer17
->Add(itemBoxSizer31
, 0, wxGROW
, 5);
271 m_bgColourLabel
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL
, _("&Bg colour:"), wxDefaultPosition
, wxDefaultSize
, 0 );
272 m_bgColourLabel
->SetValue(false);
273 itemBoxSizer31
->Add(m_bgColourLabel
, 0, wxALIGN_CENTER_HORIZONTAL
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
275 m_bgColourCtrl
= new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL
, wxDefaultPosition
, wxSize(40, 20), 0 );
276 m_bgColourCtrl
->SetHelpText(_("Click to change the text background colour."));
277 if (wxRichTextFontPage::ShowToolTips())
278 m_bgColourCtrl
->SetToolTip(_("Click to change the text background colour."));
279 itemBoxSizer31
->Add(m_bgColourCtrl
, 0, wxGROW
|wxALL
, 5);
281 wxBoxSizer
* itemBoxSizer34
= new wxBoxSizer(wxHORIZONTAL
);
282 itemBoxSizer3
->Add(itemBoxSizer34
, 0, wxGROW
, 5);
284 m_strikethroughCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
, _("&Strikethrough"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
285 m_strikethroughCtrl
->SetValue(false);
286 m_strikethroughCtrl
->SetHelpText(_("Check to show a line through the text."));
287 if (wxRichTextFontPage::ShowToolTips())
288 m_strikethroughCtrl
->SetToolTip(_("Check to show a line through the text."));
289 itemBoxSizer34
->Add(m_strikethroughCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
291 m_capitalsCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_CAPSCTRL
, _("Ca&pitals"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
292 m_capitalsCtrl
->SetValue(false);
293 m_capitalsCtrl
->SetHelpText(_("Check to show the text in capitals."));
294 if (wxRichTextFontPage::ShowToolTips())
295 m_capitalsCtrl
->SetToolTip(_("Check to show the text in capitals."));
296 itemBoxSizer34
->Add(m_capitalsCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
298 m_smallCapitalsCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL
, _("Small C&apitals"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
299 m_smallCapitalsCtrl
->SetValue(false);
300 m_smallCapitalsCtrl
->SetHelpText(_("Check to show the text in small capitals."));
301 if (wxRichTextFontPage::ShowToolTips())
302 m_smallCapitalsCtrl
->SetToolTip(_("Check to show the text in small capitals."));
303 itemBoxSizer34
->Add(m_smallCapitalsCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
305 m_superscriptCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SUPERSCRIPT
, _("Supe&rscript"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
306 m_superscriptCtrl
->SetValue(false);
307 m_superscriptCtrl
->SetHelpText(_("Check to show the text in superscript."));
308 if (wxRichTextFontPage::ShowToolTips())
309 m_superscriptCtrl
->SetToolTip(_("Check to show the text in superscript."));
310 itemBoxSizer34
->Add(m_superscriptCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
312 m_subscriptCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SUBSCRIPT
, _("Subscrip&t"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
313 m_subscriptCtrl
->SetValue(false);
314 m_subscriptCtrl
->SetHelpText(_("Check to show the text in subscript."));
315 if (wxRichTextFontPage::ShowToolTips())
316 m_subscriptCtrl
->SetToolTip(_("Check to show the text in subscript."));
317 itemBoxSizer34
->Add(m_subscriptCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
319 itemBoxSizer3
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
, 5);
321 m_previewCtrl
= new wxRichTextFontPreviewCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_PREVIEWCTRL
, wxDefaultPosition
, wxSize(100, 60), 0 );
322 m_previewCtrl
->SetHelpText(_("Shows a preview of the font settings."));
323 if (wxRichTextFontPage::ShowToolTips())
324 m_previewCtrl
->SetToolTip(_("Shows a preview of the font settings."));
325 itemBoxSizer3
->Add(m_previewCtrl
, 0, wxGROW
|wxALL
, 5);
327 ////@end wxRichTextFontPage content construction
329 m_faceListBox
->UpdateFonts();
331 m_styleCtrl
->Append(_("(none)"));
332 m_styleCtrl
->Append(_("Regular"));
333 m_styleCtrl
->Append(_("Italic"));
335 m_weightCtrl
->Append(_("(none)"));
336 m_weightCtrl
->Append(_("Regular"));
337 m_weightCtrl
->Append(_("Bold"));
339 m_underliningCtrl
->Append(_("(none)"));
340 m_underliningCtrl
->Append(_("Not underlined"));
341 m_underliningCtrl
->Append(_("Underlined"));
345 for (i
= 8; i
< 40; i
++)
347 nStr
.Printf(wxT("%d"), i
);
348 m_sizeListBox
->Append(nStr
);
350 m_sizeListBox
->Append(wxT("48"));
351 m_sizeListBox
->Append(wxT("72"));
354 /// Transfer data from/to window
355 bool wxRichTextFontPage::TransferDataFromWindow()
357 wxPanel::TransferDataFromWindow();
359 wxRichTextAttr
* attr
= GetAttributes();
361 if (!m_faceTextCtrl
->GetValue().IsEmpty())
363 wxString faceName
= m_faceTextCtrl
->GetValue();
364 attr
->SetFontFaceName(faceName
);
367 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_FACE
));
369 wxString strSize
= m_sizeTextCtrl
->GetValue();
370 if (!strSize
.IsEmpty())
372 int sz
= wxAtoi(strSize
);
375 if (m_sizeUnitsCtrl
->GetSelection() == 0)
376 attr
->SetFontPointSize(sz
);
378 attr
->SetFontPixelSize(sz
);
382 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_SIZE
));
384 if (m_styleCtrl
->GetSelection() != wxNOT_FOUND
&& m_styleCtrl
->GetSelection() != 0)
387 if (m_styleCtrl
->GetSelection() == 2)
388 style
= wxFONTSTYLE_ITALIC
;
390 style
= wxFONTSTYLE_NORMAL
;
392 attr
->SetFontStyle(style
);
395 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_ITALIC
));
397 if (m_weightCtrl
->GetSelection() != wxNOT_FOUND
&& m_weightCtrl
->GetSelection() != 0)
400 if (m_weightCtrl
->GetSelection() == 2)
401 weight
= wxFONTWEIGHT_BOLD
;
403 weight
= wxFONTWEIGHT_NORMAL
;
405 attr
->SetFontWeight(weight
);
408 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_WEIGHT
));
410 if (m_underliningCtrl
->GetSelection() != wxNOT_FOUND
&& m_underliningCtrl
->GetSelection() != 0)
413 if (m_underliningCtrl
->GetSelection() == 2)
418 attr
->SetFontUnderlined(underlined
);
421 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_UNDERLINE
));
423 if (m_textColourLabel
->GetValue())
425 attr
->SetTextColour(m_colourCtrl
->GetColour());
428 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_TEXT_COLOUR
));
430 if (m_bgColourLabel
->GetValue())
432 attr
->SetBackgroundColour(m_bgColourCtrl
->GetColour());
435 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_BACKGROUND_COLOUR
));
437 if (m_strikethroughCtrl
->Get3StateValue() != wxCHK_UNDETERMINED
)
439 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
441 if (m_strikethroughCtrl
->Get3StateValue() == wxCHK_CHECKED
)
442 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
444 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
448 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
449 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
452 if (m_capitalsCtrl
->Get3StateValue() != wxCHK_UNDETERMINED
)
454 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_CAPITALS
);
456 if (m_capitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
457 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_CAPITALS
);
459 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS
);
463 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_CAPITALS
);
464 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS
);
467 if (m_smallCapitalsCtrl
->Get3StateValue() != wxCHK_UNDETERMINED
)
469 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
471 if (m_smallCapitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
472 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
474 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
478 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
479 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
482 if (m_superscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
484 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT
);
485 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT
);
486 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SUBSCRIPT
);
488 else if (m_subscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
490 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUBSCRIPT
);
491 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_SUBSCRIPT
);
492 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SUPERSCRIPT
);
496 // If they are undetermined, we don't want to include these flags in the text effects - the objects
497 // should retain their original style.
498 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT
|wxTEXT_ATTR_EFFECT_SUPERSCRIPT
) );
499 attr
->SetTextEffects(attr
->GetTextEffects() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT
|wxTEXT_ATTR_EFFECT_SUPERSCRIPT
) );
502 if (attr
->GetTextEffectFlags() == 0)
503 attr
->SetFlags(attr
->GetFlags() & ~wxTEXT_ATTR_EFFECTS
);
508 bool wxRichTextFontPage::TransferDataToWindow()
510 wxPanel::TransferDataToWindow();
513 wxRichTextAttr
* attr
= GetAttributes();
515 if (attr
->HasFontFaceName())
517 m_faceTextCtrl
->SetValue(attr
->GetFontFaceName());
518 m_faceListBox
->SetFaceNameSelection(attr
->GetFont().GetFaceName());
522 m_faceTextCtrl
->SetValue(wxEmptyString
);
523 m_faceListBox
->SetFaceNameSelection(wxEmptyString
);
526 if (attr
->HasFontPointSize())
528 wxString strSize
= wxString::Format(wxT("%d"), attr
->GetFontSize());
529 m_sizeTextCtrl
->SetValue(strSize
);
530 m_sizeUnitsCtrl
->SetSelection(0);
531 if (m_sizeListBox
->FindString(strSize
) != wxNOT_FOUND
)
532 m_sizeListBox
->SetStringSelection(strSize
);
534 else if (attr
->HasFontPixelSize())
536 wxString strSize
= wxString::Format(wxT("%d"), attr
->GetFontSize());
537 m_sizeTextCtrl
->SetValue(strSize
);
538 m_sizeUnitsCtrl
->SetSelection(1);
539 m_sizeListBox
->SetSelection(wxNOT_FOUND
);
543 m_sizeTextCtrl
->SetValue(wxEmptyString
);
544 m_sizeListBox
->SetSelection(wxNOT_FOUND
);
547 if (attr
->HasFontWeight())
549 if (attr
->GetFontWeight() == wxFONTWEIGHT_BOLD
)
550 m_weightCtrl
->SetSelection(2);
552 m_weightCtrl
->SetSelection(1);
556 m_weightCtrl
->SetSelection(0);
559 if (attr
->HasFontItalic())
561 if (attr
->GetFontStyle() == wxFONTSTYLE_ITALIC
)
562 m_styleCtrl
->SetSelection(2);
564 m_styleCtrl
->SetSelection(1);
568 m_styleCtrl
->SetSelection(0);
571 if (attr
->HasFontUnderlined())
573 if (attr
->GetFontUnderlined())
574 m_underliningCtrl
->SetSelection(2);
576 m_underliningCtrl
->SetSelection(1);
580 m_underliningCtrl
->SetSelection(0);
583 if (attr
->HasTextColour())
585 m_colourCtrl
->SetColour(attr
->GetTextColour());
586 m_textColourLabel
->SetValue(true);
587 m_colourPresent
= true;
591 m_colourCtrl
->SetColour(*wxBLACK
);
592 m_textColourLabel
->SetValue(false);
595 if (attr
->HasBackgroundColour())
597 m_bgColourCtrl
->SetColour(attr
->GetBackgroundColour());
598 m_bgColourLabel
->SetValue(true);
599 m_bgColourPresent
= true;
603 m_bgColourCtrl
->SetColour(*wxWHITE
);
604 m_bgColourLabel
->SetValue(false);
607 if (attr
->HasTextEffects())
609 if (attr
->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH
)
611 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH
)
612 m_strikethroughCtrl
->Set3StateValue(wxCHK_CHECKED
);
614 m_strikethroughCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
617 m_strikethroughCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
619 if (attr
->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_CAPITALS
)
621 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS
)
622 m_capitalsCtrl
->Set3StateValue(wxCHK_CHECKED
);
624 m_capitalsCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
627 m_capitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
629 if (attr
->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
)
631 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
)
632 m_smallCapitalsCtrl
->Set3StateValue(wxCHK_CHECKED
);
634 m_smallCapitalsCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
637 m_capitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
639 if ( attr
->GetTextEffectFlags() & (wxTEXT_ATTR_EFFECT_SUPERSCRIPT
| wxTEXT_ATTR_EFFECT_SUBSCRIPT
) )
641 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT
)
643 m_superscriptCtrl
->Set3StateValue(wxCHK_CHECKED
);
644 m_subscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
646 else if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT
)
648 m_superscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
649 m_subscriptCtrl
->Set3StateValue(wxCHK_CHECKED
);
653 m_superscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
654 m_subscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
659 m_superscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
660 m_subscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
665 m_strikethroughCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
666 m_capitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
667 m_smallCapitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
668 m_superscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
669 m_subscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
674 m_dontUpdate
= false;
679 wxRichTextAttr
* wxRichTextFontPage::GetAttributes()
681 return wxRichTextFormattingDialog::GetDialogAttributes(this);
684 /// Updates the font preview
685 void wxRichTextFontPage::UpdatePreview()
689 if (m_textColourLabel
->GetValue())
690 m_previewCtrl
->SetForegroundColour(m_colourCtrl
->GetColour());
693 m_previewCtrl
->SetForegroundColour(*wxBLACK
);
694 if (!(m_colourCtrl
->GetColour() == *wxBLACK
))
696 m_colourCtrl
->SetColour(*wxBLACK
);
697 m_colourCtrl
->Refresh();
701 if (m_bgColourLabel
->GetValue())
702 m_previewCtrl
->SetBackgroundColour(m_bgColourCtrl
->GetColour());
705 m_previewCtrl
->SetBackgroundColour(*wxWHITE
);
707 if (!(m_bgColourCtrl
->GetColour() == *wxWHITE
))
709 m_bgColourCtrl
->SetColour(*wxWHITE
);
710 m_bgColourCtrl
->Refresh();
714 if (m_faceListBox
->GetSelection() != wxNOT_FOUND
)
716 wxString faceName
= m_faceListBox
->GetFaceName(m_faceListBox
->GetSelection());
717 attr
.SetFontFaceName(faceName
);
720 wxString strSize
= m_sizeTextCtrl
->GetValue();
721 if (!strSize
.IsEmpty())
723 int sz
= wxAtoi(strSize
);
726 if (m_sizeUnitsCtrl
->GetSelection() == 1)
727 attr
.SetFontPixelSize(sz
);
729 attr
.SetFontPointSize(sz
);
733 if (m_styleCtrl
->GetSelection() != wxNOT_FOUND
&& m_styleCtrl
->GetSelection() != 0)
736 if (m_styleCtrl
->GetSelection() == 2)
737 style
= wxFONTSTYLE_ITALIC
;
739 style
= wxFONTSTYLE_NORMAL
;
741 attr
.SetFontStyle(style
);
744 if (m_weightCtrl
->GetSelection() != wxNOT_FOUND
&& m_weightCtrl
->GetSelection() != 0)
747 if (m_weightCtrl
->GetSelection() == 2)
748 weight
= wxFONTWEIGHT_BOLD
;
750 weight
= wxFONTWEIGHT_NORMAL
;
752 attr
.SetFontWeight(weight
);
755 if (m_underliningCtrl
->GetSelection() != wxNOT_FOUND
&& m_underliningCtrl
->GetSelection() != 0)
758 if (m_underliningCtrl
->GetSelection() == 2)
763 attr
.SetFontUnderlined(underlined
);
768 if (m_strikethroughCtrl
->Get3StateValue() == wxCHK_CHECKED
)
770 textEffects
|= wxTEXT_ATTR_EFFECT_STRIKETHROUGH
;
773 if (m_capitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
775 textEffects
|= wxTEXT_ATTR_EFFECT_CAPITALS
;
778 if (m_smallCapitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
780 textEffects
|= wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
;
783 if ( m_superscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
784 textEffects
|= wxTEXT_ATTR_EFFECT_SUPERSCRIPT
;
785 else if ( m_subscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
786 textEffects
|= wxTEXT_ATTR_EFFECT_SUBSCRIPT
;
788 wxFont font
= attr
.GetFont();
789 m_previewCtrl
->SetFont(font
);
790 m_previewCtrl
->SetTextEffects(textEffects
);
791 m_previewCtrl
->Refresh();
795 * Should we show tooltips?
798 bool wxRichTextFontPage::ShowToolTips()
800 return wxRichTextFormattingDialog::ShowToolTips();
804 * Get bitmap resources
807 wxBitmap
wxRichTextFontPage::GetBitmapResource( const wxString
& name
)
810 ////@begin wxRichTextFontPage bitmap retrieval
813 ////@end wxRichTextFontPage bitmap retrieval
820 wxIcon
wxRichTextFontPage::GetIconResource( const wxString
& name
)
823 ////@begin wxRichTextFontPage icon retrieval
826 ////@end wxRichTextFontPage icon retrieval
830 * wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
833 void wxRichTextFontPage::OnFaceTextCtrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
838 wxString facename
= m_faceTextCtrl
->GetValue();
839 if (!facename
.IsEmpty())
841 if (m_faceListBox
->HasFaceName(facename
))
843 m_faceListBox
->SetFaceNameSelection(facename
);
848 // Try to find a partial match
849 const wxArrayString
& arr
= m_faceListBox
->GetFaceNames();
851 for (i
= 0; i
< arr
.GetCount(); i
++)
853 if (arr
[i
].Mid(0, facename
.Length()).Lower() == facename
.Lower())
855 m_faceListBox
->ScrollToRow(i
);
865 * wxEVT_TEXT event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
868 void wxRichTextFontPage::OnSizeTextCtrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
873 wxString strSize
= m_sizeTextCtrl
->GetValue();
874 if (!strSize
.IsEmpty() && m_sizeListBox
->FindString(strSize
) != wxNOT_FOUND
)
875 m_sizeListBox
->SetStringSelection(strSize
);
881 * wxEVT_LISTBOX event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
884 void wxRichTextFontPage::OnSizeListBoxSelected( wxCommandEvent
& event
)
886 bool oldDontUpdate
= m_dontUpdate
;
889 m_sizeTextCtrl
->SetValue(event
.GetString());
891 m_dontUpdate
= oldDontUpdate
;
900 * wxEVT_LISTBOX event handler for ID_RICHTEXTFONTPAGE_FACELISTBOX
903 void wxRichTextFontPage::OnFaceListBoxSelected( wxCommandEvent
& WXUNUSED(event
) )
905 bool oldDontUpdate
= m_dontUpdate
;
908 m_faceTextCtrl
->SetValue(m_faceListBox
->GetFaceName(m_faceListBox
->GetSelection()));
910 m_dontUpdate
= oldDontUpdate
;
919 * wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
922 void wxRichTextFontPage::OnStyleCtrlSelected( wxCommandEvent
& WXUNUSED(event
) )
932 * wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
935 void wxRichTextFontPage::OnUnderliningCtrlSelected( wxCommandEvent
& WXUNUSED(event
) )
945 * wxEVT_COMBOBOX event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
948 void wxRichTextFontPage::OnWeightCtrlSelected( wxCommandEvent
& WXUNUSED(event
) )
956 void wxRichTextFontPage::OnColourClicked( wxCommandEvent
& event
)
958 if (event
.GetId() == m_colourCtrl
->GetId())
959 m_colourPresent
= true;
960 else if (event
.GetId() == m_bgColourCtrl
->GetId())
961 m_bgColourPresent
= true;
965 if (event
.GetId() == m_colourCtrl
->GetId())
967 m_textColourLabel
->SetValue(true);
969 else if (event
.GetId() == m_bgColourCtrl
->GetId())
971 m_bgColourLabel
->SetValue(true);
974 m_dontUpdate
= false;
979 * wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
982 void wxRichTextFontPage::OnStrikethroughctrlClick( wxCommandEvent
& WXUNUSED(event
) )
991 * wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
994 void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent
& WXUNUSED(event
) )
1003 * wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
1006 void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent
& WXUNUSED(event
) )
1011 if ( m_superscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
1012 m_subscriptCtrl
->Set3StateValue( wxCHK_UNCHECKED
);
1018 * wxEVT_CHECKBOX event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
1021 void wxRichTextFontPage::OnRichtextfontpageSubscriptClick( wxCommandEvent
& WXUNUSED(event
) )
1026 if ( m_subscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
1027 m_superscriptCtrl
->Set3StateValue( wxCHK_UNCHECKED
);
1033 * wxEVT_CHOICE event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
1036 void wxRichTextFontPage::OnRichtextfontpageSizeUnitsSelected( wxCommandEvent
& WXUNUSED(event
) )
1045 * wxEVT_SPINCTRL event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
1048 void wxRichTextFontPage::OnRichtextfontpageSpinbuttonsUp( wxSpinEvent
& WXUNUSED(event
) )
1050 wxString text
= m_sizeTextCtrl
->GetValue();
1051 if (!text
.IsEmpty())
1053 int size
= wxAtoi(text
);
1057 m_sizeTextCtrl
->SetValue(wxString::Format(wxT("%d"), size
));
1064 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
1067 void wxRichTextFontPage::OnRichtextfontpageSpinbuttonsDown( wxSpinEvent
& WXUNUSED(event
) )
1069 wxString text
= m_sizeTextCtrl
->GetValue();
1070 if (!text
.IsEmpty())
1072 int size
= wxAtoi(text
);
1076 m_sizeTextCtrl
->SetValue(wxString::Format(wxT("%d"), size
));
1083 * wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
1086 void wxRichTextFontPage::OnIdle( wxIdleEvent
& WXUNUSED(event
) )
1088 if (!m_sizeUnitsCtrl
)
1091 if (m_sizeUnitsCtrl
->GetSelection() == 1 && m_sizeListBox
->IsShown())
1093 m_fontListBoxParent
->Show(m_sizeListBox
, false);
1096 else if (m_sizeUnitsCtrl
->GetSelection() == 0 && !m_sizeListBox
->IsShown())
1098 m_fontListBoxParent
->Show(m_sizeListBox
, true);
1101 if (!wxRichTextFormattingDialog::GetDialog(this)->HasOption(wxRichTextFormattingDialog::Option_AllowPixelFontSize
) &&
1102 m_sizeUnitsCtrl
->IsEnabled())
1104 m_sizeUnitsCtrl
->Disable();