1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/richtext/richtextfontpage.cpp
3 // Purpose: Font page for wxRichTextFormattingDialog
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/richtext/richtextfontpage.h"
15 * wxRichTextFontPage type definition
18 IMPLEMENT_DYNAMIC_CLASS( wxRichTextFontPage
, wxRichTextDialogPage
)
21 * wxRichTextFontPage event table definition
24 BEGIN_EVENT_TABLE( wxRichTextFontPage
, wxRichTextDialogPage
)
25 EVT_LISTBOX( ID_RICHTEXTFONTPAGE_FACELISTBOX
, wxRichTextFontPage::OnFaceListBoxSelected
)
26 EVT_BUTTON( ID_RICHTEXTFONTPAGE_COLOURCTRL
, wxRichTextFontPage::OnColourClicked
)
27 EVT_BUTTON( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL
, wxRichTextFontPage::OnColourClicked
)
29 ////@begin wxRichTextFontPage event table entries
30 EVT_IDLE( wxRichTextFontPage::OnIdle
)
32 EVT_TEXT( ID_RICHTEXTFONTPAGE_FACETEXTCTRL
, wxRichTextFontPage::OnFaceTextCtrlUpdated
)
34 EVT_TEXT( ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
, wxRichTextFontPage::OnSizeTextCtrlUpdated
)
36 EVT_SPIN_UP( ID_RICHTEXTFONTPAGE_SPINBUTTONS
, wxRichTextFontPage::OnRichtextfontpageSpinbuttonsUp
)
37 EVT_SPIN_DOWN( ID_RICHTEXTFONTPAGE_SPINBUTTONS
, wxRichTextFontPage::OnRichtextfontpageSpinbuttonsDown
)
39 EVT_CHOICE( ID_RICHTEXTFONTPAGE_SIZE_UNITS
, wxRichTextFontPage::OnRichtextfontpageSizeUnitsSelected
)
41 EVT_LISTBOX( ID_RICHTEXTFONTPAGE_SIZELISTBOX
, wxRichTextFontPage::OnSizeListBoxSelected
)
43 EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_STYLECTRL
, wxRichTextFontPage::OnStyleCtrlSelected
)
45 EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_WEIGHTCTRL
, wxRichTextFontPage::OnWeightCtrlSelected
)
47 EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
, wxRichTextFontPage::OnUnderliningCtrlSelected
)
49 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL
, wxRichTextFontPage::OnUnderliningCtrlSelected
)
51 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL
, wxRichTextFontPage::OnUnderliningCtrlSelected
)
53 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
, wxRichTextFontPage::OnStrikethroughctrlClick
)
55 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_CAPSCTRL
, wxRichTextFontPage::OnCapsctrlClick
)
57 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL
, wxRichTextFontPage::OnCapsctrlClick
)
59 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUPERSCRIPT
, wxRichTextFontPage::OnRichtextfontpageSuperscriptClick
)
61 EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUBSCRIPT
, wxRichTextFontPage::OnRichtextfontpageSubscriptClick
)
63 ////@end wxRichTextFontPage event table entries
67 IMPLEMENT_HELP_PROVISION(wxRichTextFontPage
)
69 * wxRichTextFontPage constructors
72 wxRichTextFontPage::wxRichTextFontPage( )
77 wxRichTextFontPage::wxRichTextFontPage( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
80 Create(parent
, id
, pos
, size
, style
);
87 void wxRichTextFontPage::Init()
90 m_colourPresent
= false;
91 m_bgColourPresent
= false;
93 ////@begin wxRichTextFontPage member initialisation
94 m_faceTextCtrl
= NULL
;
95 m_sizeTextCtrl
= NULL
;
96 m_fontSizeSpinButtons
= NULL
;
97 m_sizeUnitsCtrl
= NULL
;
98 m_fontListBoxParent
= NULL
;
100 m_sizeListBox
= NULL
;
103 m_underliningCtrl
= NULL
;
104 m_textColourLabel
= NULL
;
106 m_bgColourLabel
= NULL
;
107 m_bgColourCtrl
= NULL
;
108 m_strikethroughCtrl
= NULL
;
109 m_capitalsCtrl
= NULL
;
110 m_smallCapitalsCtrl
= NULL
;
111 m_superscriptCtrl
= NULL
;
112 m_subscriptCtrl
= NULL
;
113 m_previewCtrl
= NULL
;
114 ////@end wxRichTextFontPage member initialisation
118 * wxRichTextFontPage creator
121 bool wxRichTextFontPage::Create( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
123 ////@begin wxRichTextFontPage creation
124 wxRichTextDialogPage::Create( parent
, id
, pos
, size
, style
);
129 GetSizer()->SetSizeHints(this);
132 ////@end wxRichTextFontPage creation
137 * Control creation for wxRichTextFontPage
140 void wxRichTextFontPage::CreateControls()
142 ////@begin wxRichTextFontPage content construction
143 wxRichTextFontPage
* itemRichTextDialogPage1
= this;
145 wxBoxSizer
* itemBoxSizer2
= new wxBoxSizer(wxVERTICAL
);
146 itemRichTextDialogPage1
->SetSizer(itemBoxSizer2
);
148 wxBoxSizer
* itemBoxSizer3
= new wxBoxSizer(wxVERTICAL
);
149 itemBoxSizer2
->Add(itemBoxSizer3
, 1, wxGROW
|wxALL
, 5);
151 wxBoxSizer
* itemBoxSizer4
= new wxBoxSizer(wxHORIZONTAL
);
152 itemBoxSizer3
->Add(itemBoxSizer4
, 1, wxGROW
, 5);
154 wxBoxSizer
* itemBoxSizer5
= new wxBoxSizer(wxVERTICAL
);
155 itemBoxSizer4
->Add(itemBoxSizer5
, 1, wxGROW
, 5);
157 wxStaticText
* itemStaticText6
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Font:"), wxDefaultPosition
, wxDefaultSize
, 0 );
158 itemBoxSizer5
->Add(itemStaticText6
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
160 m_faceTextCtrl
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_FACETEXTCTRL
, wxEmptyString
, wxDefaultPosition
, wxDefaultSize
, 0 );
161 m_faceTextCtrl
->SetHelpText(_("Type a font name."));
162 if (wxRichTextFontPage::ShowToolTips())
163 m_faceTextCtrl
->SetToolTip(_("Type a font name."));
164 itemBoxSizer5
->Add(m_faceTextCtrl
, 0, wxGROW
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
166 wxBoxSizer
* itemBoxSizer8
= new wxBoxSizer(wxVERTICAL
);
167 itemBoxSizer4
->Add(itemBoxSizer8
, 0, wxGROW
, 5);
169 wxStaticText
* itemStaticText9
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Size:"), wxDefaultPosition
, wxDefaultSize
, 0 );
170 itemBoxSizer8
->Add(itemStaticText9
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
172 wxBoxSizer
* itemBoxSizer10
= new wxBoxSizer(wxHORIZONTAL
);
173 itemBoxSizer8
->Add(itemBoxSizer10
, 0, wxGROW
, 5);
175 m_sizeTextCtrl
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(50, -1), 0 );
176 m_sizeTextCtrl
->SetHelpText(_("Type a size in points."));
177 if (wxRichTextFontPage::ShowToolTips())
178 m_sizeTextCtrl
->SetToolTip(_("Type a size in points."));
179 itemBoxSizer10
->Add(m_sizeTextCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
, 5);
181 m_fontSizeSpinButtons
= new wxSpinButton( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SPINBUTTONS
, wxDefaultPosition
, wxSize(-1, 20), wxSP_VERTICAL
);
182 m_fontSizeSpinButtons
->SetRange(0, 100);
183 m_fontSizeSpinButtons
->SetValue(0);
184 itemBoxSizer10
->Add(m_fontSizeSpinButtons
, 0, wxALIGN_CENTER_VERTICAL
|wxRIGHT
|wxTOP
, 5);
186 wxArrayString m_sizeUnitsCtrlStrings
;
187 m_sizeUnitsCtrlStrings
.Add(_("pt"));
188 m_sizeUnitsCtrlStrings
.Add(_("px"));
189 m_sizeUnitsCtrl
= new wxChoice( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SIZE_UNITS
, wxDefaultPosition
, wxDefaultSize
, m_sizeUnitsCtrlStrings
, 0 );
190 m_sizeUnitsCtrl
->SetStringSelection(_("pt"));
191 m_sizeUnitsCtrl
->SetHelpText(_("The font size units, points or pixels."));
192 if (wxRichTextFontPage::ShowToolTips())
193 m_sizeUnitsCtrl
->SetToolTip(_("The font size units, points or pixels."));
194 itemBoxSizer10
->Add(m_sizeUnitsCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxRIGHT
|wxTOP
, 5);
196 m_fontListBoxParent
= new wxBoxSizer(wxHORIZONTAL
);
197 itemBoxSizer3
->Add(m_fontListBoxParent
, 0, wxGROW
, 5);
199 m_faceListBox
= new wxRichTextFontListBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_FACELISTBOX
, wxDefaultPosition
, wxSize(200, 100), 0 );
200 m_faceListBox
->SetHelpText(_("Lists the available fonts."));
201 if (wxRichTextFontPage::ShowToolTips())
202 m_faceListBox
->SetToolTip(_("Lists the available fonts."));
203 m_fontListBoxParent
->Add(m_faceListBox
, 1, wxALIGN_CENTER_VERTICAL
|wxALL
|wxFIXED_MINSIZE
, 5);
205 wxArrayString m_sizeListBoxStrings
;
206 m_sizeListBox
= new wxListBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SIZELISTBOX
, wxDefaultPosition
, wxSize(50, -1), m_sizeListBoxStrings
, wxLB_SINGLE
);
207 m_sizeListBox
->SetHelpText(_("Lists font sizes in points."));
208 if (wxRichTextFontPage::ShowToolTips())
209 m_sizeListBox
->SetToolTip(_("Lists font sizes in points."));
210 m_fontListBoxParent
->Add(m_sizeListBox
, 0, wxGROW
|wxALL
|wxFIXED_MINSIZE
, 5);
212 wxBoxSizer
* itemBoxSizer17
= new wxBoxSizer(wxHORIZONTAL
);
213 itemBoxSizer3
->Add(itemBoxSizer17
, 0, wxGROW
, 5);
215 wxBoxSizer
* itemBoxSizer18
= new wxBoxSizer(wxVERTICAL
);
216 itemBoxSizer17
->Add(itemBoxSizer18
, 0, wxGROW
, 5);
218 wxStaticText
* itemStaticText19
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Font st&yle:"), wxDefaultPosition
, wxDefaultSize
, 0 );
219 itemBoxSizer18
->Add(itemStaticText19
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
221 wxArrayString m_styleCtrlStrings
;
222 m_styleCtrl
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_STYLECTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(110, -1), m_styleCtrlStrings
, wxCB_READONLY
);
223 m_styleCtrl
->SetHelpText(_("Select regular or italic style."));
224 if (wxRichTextFontPage::ShowToolTips())
225 m_styleCtrl
->SetToolTip(_("Select regular or italic style."));
226 itemBoxSizer18
->Add(m_styleCtrl
, 0, wxGROW
|wxALL
, 5);
228 wxBoxSizer
* itemBoxSizer21
= new wxBoxSizer(wxVERTICAL
);
229 itemBoxSizer17
->Add(itemBoxSizer21
, 0, wxGROW
, 5);
231 wxStaticText
* itemStaticText22
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Font &weight:"), wxDefaultPosition
, wxDefaultSize
, 0 );
232 itemBoxSizer21
->Add(itemStaticText22
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
234 wxArrayString m_weightCtrlStrings
;
235 m_weightCtrl
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_WEIGHTCTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(110, -1), m_weightCtrlStrings
, wxCB_READONLY
);
236 m_weightCtrl
->SetHelpText(_("Select regular or bold."));
237 if (wxRichTextFontPage::ShowToolTips())
238 m_weightCtrl
->SetToolTip(_("Select regular or bold."));
239 itemBoxSizer21
->Add(m_weightCtrl
, 0, wxGROW
|wxALL
, 5);
241 wxBoxSizer
* itemBoxSizer24
= new wxBoxSizer(wxVERTICAL
);
242 itemBoxSizer17
->Add(itemBoxSizer24
, 0, wxGROW
, 5);
244 wxStaticText
* itemStaticText25
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Underlining:"), wxDefaultPosition
, wxDefaultSize
, 0 );
245 itemBoxSizer24
->Add(itemStaticText25
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
247 wxArrayString m_underliningCtrlStrings
;
248 m_underliningCtrl
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
, wxEmptyString
, wxDefaultPosition
, wxSize(110, -1), m_underliningCtrlStrings
, wxCB_READONLY
);
249 m_underliningCtrl
->SetHelpText(_("Select underlining or no underlining."));
250 if (wxRichTextFontPage::ShowToolTips())
251 m_underliningCtrl
->SetToolTip(_("Select underlining or no underlining."));
252 itemBoxSizer24
->Add(m_underliningCtrl
, 0, wxGROW
|wxALL
, 5);
254 itemBoxSizer17
->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL
|wxBOTTOM
, 5);
256 wxBoxSizer
* itemBoxSizer28
= new wxBoxSizer(wxVERTICAL
);
257 itemBoxSizer17
->Add(itemBoxSizer28
, 0, wxGROW
, 5);
259 m_textColourLabel
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL
, _("&Colour:"), wxDefaultPosition
, wxDefaultSize
, 0 );
260 m_textColourLabel
->SetValue(false);
261 itemBoxSizer28
->Add(m_textColourLabel
, 0, wxALIGN_CENTER_HORIZONTAL
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
263 m_colourCtrl
= new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_COLOURCTRL
, wxDefaultPosition
, wxSize(40, 20), 0 );
264 m_colourCtrl
->SetHelpText(_("Click to change the text colour."));
265 if (wxRichTextFontPage::ShowToolTips())
266 m_colourCtrl
->SetToolTip(_("Click to change the text colour."));
267 itemBoxSizer28
->Add(m_colourCtrl
, 0, wxGROW
|wxALL
, 5);
269 wxBoxSizer
* itemBoxSizer31
= new wxBoxSizer(wxVERTICAL
);
270 itemBoxSizer17
->Add(itemBoxSizer31
, 0, wxGROW
, 5);
272 m_bgColourLabel
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL
, _("&Bg colour:"), wxDefaultPosition
, wxDefaultSize
, 0 );
273 m_bgColourLabel
->SetValue(false);
274 itemBoxSizer31
->Add(m_bgColourLabel
, 0, wxALIGN_CENTER_HORIZONTAL
|wxLEFT
|wxRIGHT
|wxTOP
, 5);
276 m_bgColourCtrl
= new wxRichTextColourSwatchCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL
, wxDefaultPosition
, wxSize(40, 20), 0 );
277 m_bgColourCtrl
->SetHelpText(_("Click to change the text background colour."));
278 if (wxRichTextFontPage::ShowToolTips())
279 m_bgColourCtrl
->SetToolTip(_("Click to change the text background colour."));
280 itemBoxSizer31
->Add(m_bgColourCtrl
, 0, wxGROW
|wxALL
, 5);
282 wxBoxSizer
* itemBoxSizer34
= new wxBoxSizer(wxHORIZONTAL
);
283 itemBoxSizer3
->Add(itemBoxSizer34
, 0, wxGROW
, 5);
285 m_strikethroughCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
, _("&Strikethrough"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
286 m_strikethroughCtrl
->SetValue(false);
287 m_strikethroughCtrl
->SetHelpText(_("Check to show a line through the text."));
288 if (wxRichTextFontPage::ShowToolTips())
289 m_strikethroughCtrl
->SetToolTip(_("Check to show a line through the text."));
290 itemBoxSizer34
->Add(m_strikethroughCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
292 m_capitalsCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_CAPSCTRL
, _("Ca&pitals"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
293 m_capitalsCtrl
->SetValue(false);
294 m_capitalsCtrl
->SetHelpText(_("Check to show the text in capitals."));
295 if (wxRichTextFontPage::ShowToolTips())
296 m_capitalsCtrl
->SetToolTip(_("Check to show the text in capitals."));
297 itemBoxSizer34
->Add(m_capitalsCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
299 m_smallCapitalsCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL
, _("Small C&apitals"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
300 m_smallCapitalsCtrl
->SetValue(false);
301 m_smallCapitalsCtrl
->SetHelpText(_("Check to show the text in small capitals."));
302 if (wxRichTextFontPage::ShowToolTips())
303 m_smallCapitalsCtrl
->SetToolTip(_("Check to show the text in small capitals."));
304 itemBoxSizer34
->Add(m_smallCapitalsCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
306 m_superscriptCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SUPERSCRIPT
, _("Supe&rscript"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
307 m_superscriptCtrl
->SetValue(false);
308 m_superscriptCtrl
->SetHelpText(_("Check to show the text in superscript."));
309 if (wxRichTextFontPage::ShowToolTips())
310 m_superscriptCtrl
->SetToolTip(_("Check to show the text in superscript."));
311 itemBoxSizer34
->Add(m_superscriptCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
313 m_subscriptCtrl
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_SUBSCRIPT
, _("Subscrip&t"), wxDefaultPosition
, wxDefaultSize
, wxCHK_3STATE
|wxCHK_ALLOW_3RD_STATE_FOR_USER
);
314 m_subscriptCtrl
->SetValue(false);
315 m_subscriptCtrl
->SetHelpText(_("Check to show the text in subscript."));
316 if (wxRichTextFontPage::ShowToolTips())
317 m_subscriptCtrl
->SetToolTip(_("Check to show the text in subscript."));
318 itemBoxSizer34
->Add(m_subscriptCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
320 itemBoxSizer3
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
, 5);
322 m_previewCtrl
= new wxRichTextFontPreviewCtrl( itemRichTextDialogPage1
, ID_RICHTEXTFONTPAGE_PREVIEWCTRL
, wxDefaultPosition
, wxSize(100, 60), 0 );
323 m_previewCtrl
->SetHelpText(_("Shows a preview of the font settings."));
324 if (wxRichTextFontPage::ShowToolTips())
325 m_previewCtrl
->SetToolTip(_("Shows a preview of the font settings."));
326 itemBoxSizer3
->Add(m_previewCtrl
, 0, wxGROW
|wxALL
, 5);
328 ////@end wxRichTextFontPage content construction
330 m_faceListBox
->UpdateFonts();
332 m_styleCtrl
->Append(_("(none)"));
333 m_styleCtrl
->Append(_("Regular"));
334 m_styleCtrl
->Append(_("Italic"));
336 m_weightCtrl
->Append(_("(none)"));
337 m_weightCtrl
->Append(_("Regular"));
338 m_weightCtrl
->Append(_("Bold"));
340 m_underliningCtrl
->Append(_("(none)"));
341 m_underliningCtrl
->Append(_("Not underlined"));
342 m_underliningCtrl
->Append(_("Underlined"));
346 for (i
= 8; i
< 40; i
++)
348 nStr
.Printf(wxT("%d"), i
);
349 m_sizeListBox
->Append(nStr
);
351 m_sizeListBox
->Append(wxT("48"));
352 m_sizeListBox
->Append(wxT("72"));
355 /// Transfer data from/to window
356 bool wxRichTextFontPage::TransferDataFromWindow()
358 wxPanel::TransferDataFromWindow();
360 wxRichTextAttr
* attr
= GetAttributes();
362 if (!m_faceTextCtrl
->GetValue().IsEmpty())
364 wxString faceName
= m_faceTextCtrl
->GetValue();
365 attr
->SetFontFaceName(faceName
);
368 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_FACE
));
370 wxString strSize
= m_sizeTextCtrl
->GetValue();
371 if (!strSize
.IsEmpty())
373 int sz
= wxAtoi(strSize
);
376 if (m_sizeUnitsCtrl
->GetSelection() == 0)
377 attr
->SetFontPointSize(sz
);
379 attr
->SetFontPixelSize(sz
);
383 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_SIZE
));
385 if (m_styleCtrl
->GetSelection() != wxNOT_FOUND
&& m_styleCtrl
->GetSelection() != 0)
388 if (m_styleCtrl
->GetSelection() == 2)
389 style
= wxFONTSTYLE_ITALIC
;
391 style
= wxFONTSTYLE_NORMAL
;
393 attr
->SetFontStyle(style
);
396 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_ITALIC
));
398 if (m_weightCtrl
->GetSelection() != wxNOT_FOUND
&& m_weightCtrl
->GetSelection() != 0)
401 if (m_weightCtrl
->GetSelection() == 2)
402 weight
= wxFONTWEIGHT_BOLD
;
404 weight
= wxFONTWEIGHT_NORMAL
;
406 attr
->SetFontWeight(weight
);
409 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_WEIGHT
));
411 if (m_underliningCtrl
->GetSelection() != wxNOT_FOUND
&& m_underliningCtrl
->GetSelection() != 0)
414 if (m_underliningCtrl
->GetSelection() == 2)
419 attr
->SetFontUnderlined(underlined
);
422 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_FONT_UNDERLINE
));
424 if (m_textColourLabel
->GetValue())
426 attr
->SetTextColour(m_colourCtrl
->GetColour());
429 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_TEXT_COLOUR
));
431 if (m_bgColourLabel
->GetValue())
433 attr
->SetBackgroundColour(m_bgColourCtrl
->GetColour());
436 attr
->SetFlags(attr
->GetFlags() & (~ wxTEXT_ATTR_BACKGROUND_COLOUR
));
438 if (m_strikethroughCtrl
->Get3StateValue() != wxCHK_UNDETERMINED
)
440 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
442 if (m_strikethroughCtrl
->Get3StateValue() == wxCHK_CHECKED
)
443 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
445 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
449 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
450 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH
);
453 if (m_capitalsCtrl
->Get3StateValue() != wxCHK_UNDETERMINED
)
455 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_CAPITALS
);
457 if (m_capitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
458 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_CAPITALS
);
460 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS
);
464 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_CAPITALS
);
465 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS
);
468 if (m_smallCapitalsCtrl
->Get3StateValue() != wxCHK_UNDETERMINED
)
470 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
472 if (m_smallCapitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
473 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
475 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
479 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
480 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
);
483 if (m_superscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
485 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT
);
486 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT
);
487 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SUBSCRIPT
);
489 else if (m_subscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
491 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUBSCRIPT
);
492 attr
->SetTextEffects(attr
->GetTextEffects() | wxTEXT_ATTR_EFFECT_SUBSCRIPT
);
493 attr
->SetTextEffects(attr
->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SUPERSCRIPT
);
497 // If they are undetermined, we don't want to include these flags in the text effects - the objects
498 // should retain their original style.
499 attr
->SetTextEffectFlags(attr
->GetTextEffectFlags() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT
|wxTEXT_ATTR_EFFECT_SUPERSCRIPT
) );
500 attr
->SetTextEffects(attr
->GetTextEffects() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT
|wxTEXT_ATTR_EFFECT_SUPERSCRIPT
) );
503 if (attr
->GetTextEffectFlags() == 0)
504 attr
->SetFlags(attr
->GetFlags() & ~wxTEXT_ATTR_EFFECTS
);
509 bool wxRichTextFontPage::TransferDataToWindow()
511 wxPanel::TransferDataToWindow();
514 wxRichTextAttr
* attr
= GetAttributes();
516 if (attr
->HasFontFaceName())
518 m_faceTextCtrl
->SetValue(attr
->GetFontFaceName());
519 m_faceListBox
->SetFaceNameSelection(attr
->GetFont().GetFaceName());
523 m_faceTextCtrl
->SetValue(wxEmptyString
);
524 m_faceListBox
->SetFaceNameSelection(wxEmptyString
);
527 if (attr
->HasFontPointSize())
529 wxString strSize
= wxString::Format(wxT("%d"), attr
->GetFontSize());
530 m_sizeTextCtrl
->SetValue(strSize
);
531 m_sizeUnitsCtrl
->SetSelection(0);
532 if (m_sizeListBox
->FindString(strSize
) != wxNOT_FOUND
)
533 m_sizeListBox
->SetStringSelection(strSize
);
535 else if (attr
->HasFontPixelSize())
537 wxString strSize
= wxString::Format(wxT("%d"), attr
->GetFontSize());
538 m_sizeTextCtrl
->SetValue(strSize
);
539 m_sizeUnitsCtrl
->SetSelection(1);
540 m_sizeListBox
->SetSelection(wxNOT_FOUND
);
544 m_sizeTextCtrl
->SetValue(wxEmptyString
);
545 m_sizeListBox
->SetSelection(wxNOT_FOUND
);
548 if (attr
->HasFontWeight())
550 if (attr
->GetFontWeight() == wxFONTWEIGHT_BOLD
)
551 m_weightCtrl
->SetSelection(2);
553 m_weightCtrl
->SetSelection(1);
557 m_weightCtrl
->SetSelection(0);
560 if (attr
->HasFontItalic())
562 if (attr
->GetFontStyle() == wxFONTSTYLE_ITALIC
)
563 m_styleCtrl
->SetSelection(2);
565 m_styleCtrl
->SetSelection(1);
569 m_styleCtrl
->SetSelection(0);
572 if (attr
->HasFontUnderlined())
574 if (attr
->GetFontUnderlined())
575 m_underliningCtrl
->SetSelection(2);
577 m_underliningCtrl
->SetSelection(1);
581 m_underliningCtrl
->SetSelection(0);
584 if (attr
->HasTextColour())
586 m_colourCtrl
->SetColour(attr
->GetTextColour());
587 m_textColourLabel
->SetValue(true);
588 m_colourPresent
= true;
592 m_colourCtrl
->SetColour(*wxBLACK
);
593 m_textColourLabel
->SetValue(false);
596 if (attr
->HasBackgroundColour())
598 m_bgColourCtrl
->SetColour(attr
->GetBackgroundColour());
599 m_bgColourLabel
->SetValue(true);
600 m_bgColourPresent
= true;
604 m_bgColourCtrl
->SetColour(*wxWHITE
);
605 m_bgColourLabel
->SetValue(false);
608 if (attr
->HasTextEffects())
610 if (attr
->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH
)
612 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH
)
613 m_strikethroughCtrl
->Set3StateValue(wxCHK_CHECKED
);
615 m_strikethroughCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
618 m_strikethroughCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
620 if (attr
->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_CAPITALS
)
622 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS
)
623 m_capitalsCtrl
->Set3StateValue(wxCHK_CHECKED
);
625 m_capitalsCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
628 m_capitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
630 if (attr
->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
)
632 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
)
633 m_smallCapitalsCtrl
->Set3StateValue(wxCHK_CHECKED
);
635 m_smallCapitalsCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
638 m_capitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
640 if ( attr
->GetTextEffectFlags() & (wxTEXT_ATTR_EFFECT_SUPERSCRIPT
| wxTEXT_ATTR_EFFECT_SUBSCRIPT
) )
642 if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT
)
644 m_superscriptCtrl
->Set3StateValue(wxCHK_CHECKED
);
645 m_subscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
647 else if (attr
->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT
)
649 m_superscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
650 m_subscriptCtrl
->Set3StateValue(wxCHK_CHECKED
);
654 m_superscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
655 m_subscriptCtrl
->Set3StateValue(wxCHK_UNCHECKED
);
660 m_superscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
661 m_subscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
666 m_strikethroughCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
667 m_capitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
668 m_smallCapitalsCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
669 m_superscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
670 m_subscriptCtrl
->Set3StateValue(wxCHK_UNDETERMINED
);
675 m_dontUpdate
= false;
680 wxRichTextAttr
* wxRichTextFontPage::GetAttributes()
682 return wxRichTextFormattingDialog::GetDialogAttributes(this);
685 /// Updates the font preview
686 void wxRichTextFontPage::UpdatePreview()
690 if (m_textColourLabel
->GetValue())
691 m_previewCtrl
->SetForegroundColour(m_colourCtrl
->GetColour());
694 m_previewCtrl
->SetForegroundColour(*wxBLACK
);
695 if (!(m_colourCtrl
->GetColour() == *wxBLACK
))
697 m_colourCtrl
->SetColour(*wxBLACK
);
698 m_colourCtrl
->Refresh();
702 if (m_bgColourLabel
->GetValue())
703 m_previewCtrl
->SetBackgroundColour(m_bgColourCtrl
->GetColour());
706 m_previewCtrl
->SetBackgroundColour(*wxWHITE
);
708 if (!(m_bgColourCtrl
->GetColour() == *wxWHITE
))
710 m_bgColourCtrl
->SetColour(*wxWHITE
);
711 m_bgColourCtrl
->Refresh();
715 if (m_faceListBox
->GetSelection() != wxNOT_FOUND
)
717 wxString faceName
= m_faceListBox
->GetFaceName(m_faceListBox
->GetSelection());
718 attr
.SetFontFaceName(faceName
);
721 wxString strSize
= m_sizeTextCtrl
->GetValue();
722 if (!strSize
.IsEmpty())
724 int sz
= wxAtoi(strSize
);
727 if (m_sizeUnitsCtrl
->GetSelection() == 1)
728 attr
.SetFontPixelSize(sz
);
730 attr
.SetFontPointSize(sz
);
734 if (m_styleCtrl
->GetSelection() != wxNOT_FOUND
&& m_styleCtrl
->GetSelection() != 0)
737 if (m_styleCtrl
->GetSelection() == 2)
738 style
= wxFONTSTYLE_ITALIC
;
740 style
= wxFONTSTYLE_NORMAL
;
742 attr
.SetFontStyle(style
);
745 if (m_weightCtrl
->GetSelection() != wxNOT_FOUND
&& m_weightCtrl
->GetSelection() != 0)
748 if (m_weightCtrl
->GetSelection() == 2)
749 weight
= wxFONTWEIGHT_BOLD
;
751 weight
= wxFONTWEIGHT_NORMAL
;
753 attr
.SetFontWeight(weight
);
756 if (m_underliningCtrl
->GetSelection() != wxNOT_FOUND
&& m_underliningCtrl
->GetSelection() != 0)
759 if (m_underliningCtrl
->GetSelection() == 2)
764 attr
.SetFontUnderlined(underlined
);
769 if (m_strikethroughCtrl
->Get3StateValue() == wxCHK_CHECKED
)
771 textEffects
|= wxTEXT_ATTR_EFFECT_STRIKETHROUGH
;
774 if (m_capitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
776 textEffects
|= wxTEXT_ATTR_EFFECT_CAPITALS
;
779 if (m_smallCapitalsCtrl
->Get3StateValue() == wxCHK_CHECKED
)
781 textEffects
|= wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
;
784 if ( m_superscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
785 textEffects
|= wxTEXT_ATTR_EFFECT_SUPERSCRIPT
;
786 else if ( m_subscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
787 textEffects
|= wxTEXT_ATTR_EFFECT_SUBSCRIPT
;
789 wxFont font
= attr
.GetFont();
790 m_previewCtrl
->SetFont(font
);
791 m_previewCtrl
->SetTextEffects(textEffects
);
792 m_previewCtrl
->Refresh();
796 * Should we show tooltips?
799 bool wxRichTextFontPage::ShowToolTips()
801 return wxRichTextFormattingDialog::ShowToolTips();
805 * Get bitmap resources
808 wxBitmap
wxRichTextFontPage::GetBitmapResource( const wxString
& name
)
811 ////@begin wxRichTextFontPage bitmap retrieval
814 ////@end wxRichTextFontPage bitmap retrieval
821 wxIcon
wxRichTextFontPage::GetIconResource( const wxString
& name
)
824 ////@begin wxRichTextFontPage icon retrieval
827 ////@end wxRichTextFontPage icon retrieval
831 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL
834 void wxRichTextFontPage::OnFaceTextCtrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
839 wxString facename
= m_faceTextCtrl
->GetValue();
840 if (!facename
.IsEmpty())
842 if (m_faceListBox
->HasFaceName(facename
))
844 m_faceListBox
->SetFaceNameSelection(facename
);
849 // Try to find a partial match
850 const wxArrayString
& arr
= m_faceListBox
->GetFaceNames();
852 for (i
= 0; i
< arr
.GetCount(); i
++)
854 if (arr
[i
].Mid(0, facename
.Length()).Lower() == facename
.Lower())
856 m_faceListBox
->ScrollToRow(i
);
866 * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL
869 void wxRichTextFontPage::OnSizeTextCtrlUpdated( wxCommandEvent
& WXUNUSED(event
) )
874 wxString strSize
= m_sizeTextCtrl
->GetValue();
875 if (!strSize
.IsEmpty() && m_sizeListBox
->FindString(strSize
) != wxNOT_FOUND
)
876 m_sizeListBox
->SetStringSelection(strSize
);
882 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX
885 void wxRichTextFontPage::OnSizeListBoxSelected( wxCommandEvent
& event
)
887 bool oldDontUpdate
= m_dontUpdate
;
890 m_sizeTextCtrl
->SetValue(event
.GetString());
892 m_dontUpdate
= oldDontUpdate
;
901 * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_FACELISTBOX
904 void wxRichTextFontPage::OnFaceListBoxSelected( wxCommandEvent
& WXUNUSED(event
) )
906 bool oldDontUpdate
= m_dontUpdate
;
909 m_faceTextCtrl
->SetValue(m_faceListBox
->GetFaceName(m_faceListBox
->GetSelection()));
911 m_dontUpdate
= oldDontUpdate
;
920 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL
923 void wxRichTextFontPage::OnStyleCtrlSelected( wxCommandEvent
& WXUNUSED(event
) )
933 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL
936 void wxRichTextFontPage::OnUnderliningCtrlSelected( wxCommandEvent
& WXUNUSED(event
) )
946 * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL
949 void wxRichTextFontPage::OnWeightCtrlSelected( wxCommandEvent
& WXUNUSED(event
) )
957 void wxRichTextFontPage::OnColourClicked( wxCommandEvent
& event
)
959 if (event
.GetId() == m_colourCtrl
->GetId())
960 m_colourPresent
= true;
961 else if (event
.GetId() == m_bgColourCtrl
->GetId())
962 m_bgColourPresent
= true;
966 if (event
.GetId() == m_colourCtrl
->GetId())
968 m_textColourLabel
->SetValue(true);
970 else if (event
.GetId() == m_bgColourCtrl
->GetId())
972 m_bgColourLabel
->SetValue(true);
975 m_dontUpdate
= false;
980 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL
983 void wxRichTextFontPage::OnStrikethroughctrlClick( wxCommandEvent
& WXUNUSED(event
) )
992 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL
995 void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent
& WXUNUSED(event
) )
1004 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT
1007 void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent
& WXUNUSED(event
) )
1012 if ( m_superscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
1013 m_subscriptCtrl
->Set3StateValue( wxCHK_UNCHECKED
);
1019 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT
1022 void wxRichTextFontPage::OnRichtextfontpageSubscriptClick( wxCommandEvent
& WXUNUSED(event
) )
1027 if ( m_subscriptCtrl
->Get3StateValue() == wxCHK_CHECKED
)
1028 m_superscriptCtrl
->Set3StateValue( wxCHK_UNCHECKED
);
1034 * wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZE_UNITS
1037 void wxRichTextFontPage::OnRichtextfontpageSizeUnitsSelected( wxCommandEvent
& WXUNUSED(event
) )
1046 * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
1049 void wxRichTextFontPage::OnRichtextfontpageSpinbuttonsUp( wxSpinEvent
& WXUNUSED(event
) )
1051 wxString text
= m_sizeTextCtrl
->GetValue();
1052 if (!text
.IsEmpty())
1054 int size
= wxAtoi(text
);
1058 m_sizeTextCtrl
->SetValue(wxString::Format(wxT("%d"), size
));
1065 * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTFONTPAGE_SPINBUTTONS
1068 void wxRichTextFontPage::OnRichtextfontpageSpinbuttonsDown( wxSpinEvent
& WXUNUSED(event
) )
1070 wxString text
= m_sizeTextCtrl
->GetValue();
1071 if (!text
.IsEmpty())
1073 int size
= wxAtoi(text
);
1077 m_sizeTextCtrl
->SetValue(wxString::Format(wxT("%d"), size
));
1084 * wxEVT_IDLE event handler for ID_RICHTEXTFONTPAGE
1087 void wxRichTextFontPage::OnIdle( wxIdleEvent
& WXUNUSED(event
) )
1089 if (!m_sizeUnitsCtrl
)
1092 if (m_sizeUnitsCtrl
->GetSelection() == 1 && m_sizeListBox
->IsShown())
1094 m_fontListBoxParent
->Show(m_sizeListBox
, false);
1097 else if (m_sizeUnitsCtrl
->GetSelection() == 0 && !m_sizeListBox
->IsShown())
1099 m_fontListBoxParent
->Show(m_sizeListBox
, true);
1102 if (!wxRichTextFormattingDialog::GetDialog(this)->HasOption(wxRichTextFormattingDialog::Option_AllowPixelFontSize
) &&
1103 m_sizeUnitsCtrl
->IsEnabled())
1105 m_sizeUnitsCtrl
->Disable();