Added support for wxTEXT_ATTR_EFFECT_SMALL_CAPITALS.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2012-09-12 18:58:30 +00:00
parent 0bfd90b3e7
commit d07f2e1918
4 changed files with 162 additions and 41 deletions

View File

@ -158,6 +158,7 @@ public:
wxRichTextColourSwatchCtrl* m_bgColourCtrl;
wxCheckBox* m_strikethroughCtrl;
wxCheckBox* m_capitalsCtrl;
wxCheckBox* m_smallCapitalsCtrl;
wxCheckBox* m_superscriptCtrl;
wxCheckBox* m_subscriptCtrl;
wxRichTextFontPreviewCtrl* m_previewCtrl;
@ -165,23 +166,24 @@ public:
enum {
ID_RICHTEXTFONTPAGE = 10000,
ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001,
ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10005,
ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10018,
ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10017,
ID_RICHTEXTFONTPAGE_FACELISTBOX = 10002,
ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10002,
ID_RICHTEXTFONTPAGE_SPINBUTTONS = 10003,
ID_RICHTEXTFONTPAGE_SIZE_UNITS = 10004,
ID_RICHTEXTFONTPAGE_FACELISTBOX = 10005,
ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006,
ID_RICHTEXTFONTPAGE_STYLECTRL = 10007,
ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004,
ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10008,
ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL = 10015,
ID_RICHTEXTFONTPAGE_COLOURCTRL = 10009,
ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL = 10016,
ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10014,
ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10010,
ID_RICHTEXTFONTPAGE_CAPSCTRL = 10011,
ID_RICHTEXTFONTPAGE_SUPERSCRIPT = 10012,
ID_RICHTEXTFONTPAGE_SUBSCRIPT = 10013,
ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10003
ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10008,
ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10009,
ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL = 10010,
ID_RICHTEXTFONTPAGE_COLOURCTRL = 10011,
ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL = 10012,
ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10013,
ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10014,
ID_RICHTEXTFONTPAGE_CAPSCTRL = 10015,
ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL = 10016,
ID_RICHTEXTFONTPAGE_SUPERSCRIPT = 10017,
ID_RICHTEXTFONTPAGE_SUBSCRIPT = 10018,
ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10019
};
////@end wxRichTextFontPage member variables

View File

@ -6280,7 +6280,7 @@ bool wxRichTextPlainText::Draw(wxDC& dc, wxRichTextDrawingContext& context, cons
wxString str = m_text;
wxString toRemove = wxRichTextLineBreakChar;
str.Replace(toRemove, wxT(" "));
if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & (wxTEXT_ATTR_EFFECT_CAPITALS|wxTEXT_ATTR_EFFECT_SMALL_CAPITALS)))
str.MakeUpper();
long len = range.GetLength();
@ -6296,6 +6296,13 @@ bool wxRichTextPlainText::Draw(wxDC& dc, wxRichTextDrawingContext& context, cons
int x, y;
if ( textFont.IsOk() )
{
if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS))
{
textFont.SetPointSize((int) (textFont.GetPointSize()*0.75));
wxCheckSetFont(dc, textFont);
charHeight = dc.GetCharHeight();
}
if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) )
{
if (textFont.IsUsingSizeInPixels())
@ -6634,6 +6641,13 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz
wxCheckSetFont(dc, textFont);
bScript = true;
}
else if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS))
{
wxFont textFont = font;
textFont.SetPointSize((int) (textFont.GetPointSize()*0.75));
wxCheckSetFont(dc, textFont);
bScript = true;
}
else
{
wxCheckSetFont(dc, font);
@ -6650,7 +6664,7 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz
wxString stringChunk = str.Mid(startPos, (size_t) len);
if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & (wxTEXT_ATTR_EFFECT_CAPITALS|wxTEXT_ATTR_EFFECT_SMALL_CAPITALS)))
stringChunk.MakeUpper();
wxCoord w, h;

View File

@ -308,14 +308,6 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
@ -683,7 +675,7 @@
<string name="proxy-type">"wbTextCtrlProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_TEXT_UPDATED|OnSizeTextCtrlUpdated"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZETEXTCTRL"</string>
<long name="proxy-Id value">10005</long>
<long name="proxy-Id value">10002</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxTextCtrl"</string>
<string name="proxy-Base class">"wxTextCtrl"</string>
@ -767,7 +759,7 @@
<string name="event-handler-0">"wxEVT_SCROLL_LINEUP|OnRichtextfontpageSpinbuttonsUp|NONE||wxRichTextFontPage"</string>
<string name="event-handler-1">"wxEVT_SCROLL_LINEDOWN|OnRichtextfontpageSpinbuttonsDown|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SPINBUTTONS"</string>
<long name="proxy-Id value">10018</long>
<long name="proxy-Id value">10003</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxSpinButton"</string>
<string name="proxy-Base class">"wxSpinButton"</string>
@ -839,7 +831,7 @@
<string name="proxy-type">"wbChoiceProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHOICE_SELECTED|OnRichtextfontpageSizeUnitsSelected|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SIZE_UNITS"</string>
<long name="proxy-Id value">10017</long>
<long name="proxy-Id value">10004</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxChoice"</string>
<string name="proxy-Base class">"wxChoice"</string>
@ -925,7 +917,7 @@
<long name="locked">0</long>
<string name="proxy-type">"wbForeignCtrlProxy"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_FACELISTBOX"</string>
<long name="proxy-Id value">10002</long>
<long name="proxy-Id value">10005</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxRichTextFontListBox"</string>
<string name="proxy-Base class">"wxWindow"</string>
@ -1356,7 +1348,7 @@
<string name="proxy-type">"wbComboBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_COMBOBOX_SELECTED|OnWeightCtrlSelected"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_WEIGHTCTRL"</string>
<long name="proxy-Id value">10004</long>
<long name="proxy-Id value">10008</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxComboBox"</string>
<string name="proxy-Base class">"wxComboBox"</string>
@ -1519,7 +1511,7 @@
<string name="proxy-type">"wbComboBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_COMBOBOX_SELECTED|OnUnderliningCtrlSelected"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL"</string>
<long name="proxy-Id value">10008</long>
<long name="proxy-Id value">10009</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxComboBox"</string>
<string name="proxy-Base class">"wxComboBox"</string>
@ -1635,7 +1627,7 @@
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnUnderliningCtrlSelected|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_COLOURCTRL_LABEL"</string>
<long name="proxy-Id value">10015</long>
<long name="proxy-Id value">10010</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
@ -1699,7 +1691,7 @@
<string name="created">"2/10/2006"</string>
<string name="proxy-type">"wbForeignCtrlProxy"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_COLOURCTRL"</string>
<long name="proxy-Id value">10009</long>
<long name="proxy-Id value">10011</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxRichTextColourSwatchCtrl"</string>
<string name="proxy-Base class">"wxWindow"</string>
@ -1795,7 +1787,7 @@
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnUnderliningCtrlSelected|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_BGCOLOURCTRL_LABEL"</string>
<long name="proxy-Id value">10016</long>
<long name="proxy-Id value">10012</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
@ -1858,7 +1850,7 @@
<long name="locked">0</long>
<string name="proxy-type">"wbForeignCtrlProxy"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_BGCOLOURCTRL"</string>
<long name="proxy-Id value">10014</long>
<long name="proxy-Id value">10013</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxRichTextColourSwatchCtrl"</string>
<string name="proxy-Base class">"wxWindow"</string>
@ -1955,9 +1947,9 @@
<long name="locked">0</long>
<string name="created">"8/11/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnStrikethroughctrlClick"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnStrikethroughctrlClick|||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL"</string>
<long name="proxy-Id value">10010</long>
<long name="proxy-Id value">10014</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
@ -2022,7 +2014,7 @@
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnCapsctrlClick"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_CAPSCTRL"</string>
<long name="proxy-Id value">10011</long>
<long name="proxy-Id value">10015</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
@ -2074,6 +2066,70 @@
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnCapsctrlClick|||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL"</string>
<long name="proxy-Id value">10016</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_smallCapitalsCtrl"</string>
<string name="proxy-Label">"Small C&amp;apitals"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">"Check to show the text in small capitals."</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">0</bool>
<bool name="proxy-wxCHK_3STATE">1</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">1</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_RICHTEXTFONTPAGE_SUPERSCRIPT"</string>
<string name="type">"dialog-control-document"</string>
@ -2087,7 +2143,7 @@
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnRichtextfontpageSuperscriptClick|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SUPERSCRIPT"</string>
<long name="proxy-Id value">10012</long>
<long name="proxy-Id value">10017</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
@ -2152,7 +2208,7 @@
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_CHECKBOX_CLICKED|OnRichtextfontpageSubscriptClick|NONE||wxRichTextFontPage"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_SUBSCRIPT"</string>
<long name="proxy-Id value">10013</long>
<long name="proxy-Id value">10018</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
@ -2243,7 +2299,7 @@
<string name="created">"2/10/2006"</string>
<string name="proxy-type">"wbForeignCtrlProxy"</string>
<string name="proxy-Id name">"ID_RICHTEXTFONTPAGE_PREVIEWCTRL"</string>
<long name="proxy-Id value">10003</long>
<long name="proxy-Id value">10019</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxRichTextFontPreviewCtrl"</string>
<string name="proxy-Base class">"wxWindow"</string>
@ -14824,6 +14880,14 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>

View File

@ -54,6 +54,8 @@ BEGIN_EVENT_TABLE( wxRichTextFontPage, wxRichTextDialogPage )
EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_CAPSCTRL, wxRichTextFontPage::OnCapsctrlClick )
EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL, wxRichTextFontPage::OnCapsctrlClick )
EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUPERSCRIPT, wxRichTextFontPage::OnRichtextfontpageSuperscriptClick )
EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUBSCRIPT, wxRichTextFontPage::OnRichtextfontpageSubscriptClick )
@ -105,6 +107,7 @@ void wxRichTextFontPage::Init()
m_bgColourCtrl = NULL;
m_strikethroughCtrl = NULL;
m_capitalsCtrl = NULL;
m_smallCapitalsCtrl = NULL;
m_superscriptCtrl = NULL;
m_subscriptCtrl = NULL;
m_previewCtrl = NULL;
@ -293,6 +296,13 @@ void wxRichTextFontPage::CreateControls()
m_capitalsCtrl->SetToolTip(_("Check to show the text in capitals."));
itemBoxSizer34->Add(m_capitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_smallCapitalsCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SMALLCAPSCTRL, _("Small C&apitals"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
m_smallCapitalsCtrl->SetValue(false);
m_smallCapitalsCtrl->SetHelpText(_("Check to show the text in small capitals."));
if (wxRichTextFontPage::ShowToolTips())
m_smallCapitalsCtrl->SetToolTip(_("Check to show the text in small capitals."));
itemBoxSizer34->Add(m_smallCapitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_superscriptCtrl = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXTFONTPAGE_SUPERSCRIPT, _("Supe&rscript"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
m_superscriptCtrl->SetValue(false);
m_superscriptCtrl->SetHelpText(_("Check to show the text in superscript."));
@ -455,6 +465,21 @@ bool wxRichTextFontPage::TransferDataFromWindow()
attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS);
}
if (m_smallCapitalsCtrl->Get3StateValue() != wxCHK_UNDETERMINED)
{
attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SMALL_CAPITALS);
if (m_smallCapitalsCtrl->Get3StateValue() == wxCHK_CHECKED)
attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_SMALL_CAPITALS);
else
attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS);
}
else
{
attr->SetTextEffectFlags(attr->GetTextEffectFlags() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS);
attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SMALL_CAPITALS);
}
if (m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED)
{
attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT);
@ -602,6 +627,16 @@ bool wxRichTextFontPage::TransferDataToWindow()
else
m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
if (attr->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS)
{
if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_SMALL_CAPITALS)
m_smallCapitalsCtrl->Set3StateValue(wxCHK_CHECKED);
else
m_smallCapitalsCtrl->Set3StateValue(wxCHK_UNCHECKED);
}
else
m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
if ( attr->GetTextEffectFlags() & (wxTEXT_ATTR_EFFECT_SUPERSCRIPT | wxTEXT_ATTR_EFFECT_SUBSCRIPT) )
{
if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT)
@ -630,6 +665,7 @@ bool wxRichTextFontPage::TransferDataToWindow()
{
m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED);
m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
m_smallCapitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED);
m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED);
m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED);
}
@ -740,6 +776,11 @@ void wxRichTextFontPage::UpdatePreview()
textEffects |= wxTEXT_ATTR_EFFECT_CAPITALS;
}
if (m_smallCapitalsCtrl->Get3StateValue() == wxCHK_CHECKED)
{
textEffects |= wxTEXT_ATTR_EFFECT_SMALL_CAPITALS;
}
if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED )
textEffects |= wxTEXT_ATTR_EFFECT_SUPERSCRIPT;
else if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED )