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;
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;
attr->SetFontWeight(weight);
}
}
else
{
- attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUBSCRIPT | wxTEXT_ATTR_EFFECT_SUPERSCRIPT );
- attr->SetTextEffects(attr->GetTextEffects() & ~( wxTEXT_ATTR_EFFECT_SUPERSCRIPT | wxTEXT_ATTR_EFFECT_SUBSCRIPT));
+ // If they are undetermined, we don't want to include these flags in the text effects - the objects
+ // should retain their original style.
+ attr->SetTextEffectFlags(attr->GetTextEffectFlags() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT|wxTEXT_ATTR_EFFECT_SUPERSCRIPT) );
}
return true;
}
else
{
- m_superscriptCtrl->Set3StateValue(wxCHK_UNCHECKED);
- m_subscriptCtrl->Set3StateValue(wxCHK_UNCHECKED);
+ m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED);
+ m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED);
}
}
else
{
m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED);
m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
- m_superscriptCtrl->Set3StateValue(wxCHK_UNCHECKED);
- m_subscriptCtrl->Set3StateValue(wxCHK_UNCHECKED);
+ m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED);
+ m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED);
}
UpdatePreview();
void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent& WXUNUSED(event) )
{
- if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED && m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED )
+ if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED)
m_subscriptCtrl->Set3StateValue( wxCHK_UNCHECKED );
+
UpdatePreview();
}
void wxRichTextFontPage::OnRichtextfontpageSubscriptClick( wxCommandEvent& WXUNUSED(event) )
{
- if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED && m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED )
+ if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED)
m_superscriptCtrl->Set3StateValue( wxCHK_UNCHECKED );
+
UpdatePreview();
}