git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62051
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
/// Updates the font preview
void wxRichTextFontPage::UpdatePreview()
{
/// Updates the font preview
void wxRichTextFontPage::UpdatePreview()
{
- wxFont font(*wxNORMAL_FONT);
if (m_colourPresent)
m_previewCtrl->SetForegroundColour(m_colourCtrl->GetBackgroundColour());
if (m_colourPresent)
m_previewCtrl->SetForegroundColour(m_colourCtrl->GetBackgroundColour());
if (m_faceListBox->GetSelection() != wxNOT_FOUND)
{
wxString faceName = m_faceListBox->GetFaceName(m_faceListBox->GetSelection());
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();
}
wxString strSize = m_sizeTextCtrl->GetValue();
{
int sz = wxAtoi(strSize);
if (sz > 0)
{
int sz = wxAtoi(strSize);
if (sz > 0)
}
if (m_styleCtrl->GetSelection() != wxNOT_FOUND)
{
}
if (m_styleCtrl->GetSelection() != wxNOT_FOUND)
{
if (m_styleCtrl->GetStringSelection() == _("Italic"))
if (m_styleCtrl->GetStringSelection() == _("Italic"))
+ style = wxFONTSTYLE_ITALIC;
+ style = wxFONTSTYLE_NORMAL;
+ attr.SetFontStyle(style);
}
if (m_weightCtrl->GetSelection() != wxNOT_FOUND)
{
}
if (m_weightCtrl->GetSelection() != wxNOT_FOUND)
{
if (m_weightCtrl->GetStringSelection() == _("Bold"))
if (m_weightCtrl->GetStringSelection() == _("Bold"))
+ weight = wxFONTWEIGHT_BOLD;
+ weight = wxFONTWEIGHT_NORMAL;
- font.SetWeight(weight);
+ attr.SetFontWeight(weight);
}
if (m_underliningCtrl->GetSelection() != wxNOT_FOUND)
}
if (m_underliningCtrl->GetSelection() != wxNOT_FOUND)
- font.SetUnderlined(underlined);
+ attr.SetFontUnderlined(underlined);
else if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED )
textEffects |= wxTEXT_ATTR_EFFECT_SUBSCRIPT;
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();
m_previewCtrl->SetFont(font);
m_previewCtrl->SetTextEffects(textEffects);
m_previewCtrl->Refresh();