wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
+ m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
m_faceTextCtrl->SetHelpText(_("Type a font name."));
if (wxRichTextFontPage::ShowToolTips())
m_faceTextCtrl->SetToolTip(_("Type a font name."));
wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_sizeTextCtrl->SetHelpText(_("Type a size in points."));
if (wxRichTextFontPage::ShowToolTips())
m_sizeTextCtrl->SetToolTip(_("Type a size in points."));
itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_styleCtrlStrings;
- m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY );
+ m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY );
m_styleCtrl->SetHelpText(_("Select regular or italic style."));
if (wxRichTextFontPage::ShowToolTips())
m_styleCtrl->SetToolTip(_("Select regular or italic style."));
itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_weightCtrlStrings;
- m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY );
+ m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY );
m_weightCtrl->SetHelpText(_("Select regular or bold."));
if (wxRichTextFontPage::ShowToolTips())
m_weightCtrl->SetToolTip(_("Select regular or bold."));
itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_underliningCtrlStrings;
- m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY );
+ m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY );
m_underliningCtrl->SetHelpText(_("Select underlining or no underlining."));
if (wxRichTextFontPage::ShowToolTips())
m_underliningCtrl->SetToolTip(_("Select underlining or no underlining."));
/// Updates the font preview
void wxRichTextFontPage::UpdatePreview()
{
- wxFont font(*wxNORMAL_FONT);
+ wxTextAttr attr;
if (m_colourPresent)
m_previewCtrl->SetForegroundColour(m_colourCtrl->GetBackgroundColour());
if (m_faceListBox->GetSelection() != wxNOT_FOUND)
{
wxString faceName = m_faceListBox->GetFaceName(m_faceListBox->GetSelection());
- font.SetFaceName(faceName);
+ attr.SetFontFaceName(faceName);
}
wxString strSize = m_sizeTextCtrl->GetValue();
{
int sz = wxAtoi(strSize);
if (sz > 0)
- font.SetPointSize(sz);
+ attr.SetFontSize(sz);
}
if (m_styleCtrl->GetSelection() != wxNOT_FOUND)
{
- int style;
+ wxFontStyle style;
if (m_styleCtrl->GetStringSelection() == _("Italic"))
- style = wxITALIC;
+ style = wxFONTSTYLE_ITALIC;
else
- style = wxNORMAL;
+ style = wxFONTSTYLE_NORMAL;
- font.SetStyle(style);
+ attr.SetFontStyle(style);
}
if (m_weightCtrl->GetSelection() != wxNOT_FOUND)
{
- int weight;
+ wxFontWeight weight;
if (m_weightCtrl->GetStringSelection() == _("Bold"))
- weight = wxBOLD;
+ weight = wxFONTWEIGHT_BOLD;
else
- weight = wxNORMAL;
+ weight = wxFONTWEIGHT_NORMAL;
- font.SetWeight(weight);
+ attr.SetFontWeight(weight);
}
if (m_underliningCtrl->GetSelection() != wxNOT_FOUND)
else
underlined = false;
- font.SetUnderlined(underlined);
+ attr.SetFontUnderlined(underlined);
}
int textEffects = 0;
else if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED )
textEffects |= wxTEXT_ATTR_EFFECT_SUBSCRIPT;
+ wxFont font = attr.GetFont();
m_previewCtrl->SetFont(font);
m_previewCtrl->SetTextEffects(textEffects);
m_previewCtrl->Refresh();