Add support for stricken-through fonts.
Support stricken-through fonts in wxMSW and wxGTK (including special support in wxStaticText and wxTextCtrl). Closes #9907. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -403,6 +403,10 @@ wxFont wxTextAttr::GetFont() const
|
||||
if (HasFontUnderlined())
|
||||
underlined = GetFontUnderlined();
|
||||
|
||||
bool strikethrough = false;
|
||||
if ( HasFontStrikethrough() )
|
||||
strikethrough = GetFontStrikethrough();
|
||||
|
||||
wxString fontFaceName;
|
||||
if (HasFontFaceName())
|
||||
fontFaceName = GetFontFaceName();
|
||||
@@ -416,6 +420,8 @@ wxFont wxTextAttr::GetFont() const
|
||||
fontFamily = GetFontFamily();
|
||||
|
||||
wxFont font(fontSize, fontFamily, fontStyle, fontWeight, underlined, fontFaceName, encoding);
|
||||
if ( strikethrough )
|
||||
font.SetStrikethrough( true );
|
||||
return font;
|
||||
}
|
||||
|
||||
@@ -437,6 +443,9 @@ bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags)
|
||||
if (flags & wxTEXT_ATTR_FONT_UNDERLINE)
|
||||
m_fontUnderlined = font.GetUnderlined();
|
||||
|
||||
if (flags & wxTEXT_ATTR_FONT_STRIKETHROUGH)
|
||||
m_fontStrikethrough = font.GetStrikethrough();
|
||||
|
||||
if (flags & wxTEXT_ATTR_FONT_FACE)
|
||||
m_fontFaceName = font.GetFaceName();
|
||||
|
||||
@@ -500,6 +509,12 @@ bool wxTextAttr::Apply(const wxTextAttr& style, const wxTextAttr* compareWith)
|
||||
destStyle.SetFontUnderlined(style.GetFontUnderlined());
|
||||
}
|
||||
|
||||
if (style.HasFontStrikethrough())
|
||||
{
|
||||
if (!(compareWith && compareWith->HasFontStrikethrough() && compareWith->GetFontStrikethrough() == style.GetFontStrikethrough()))
|
||||
destStyle.SetFontStrikethrough(style.GetFontStrikethrough());
|
||||
}
|
||||
|
||||
if (style.HasFontFaceName())
|
||||
{
|
||||
if (!(compareWith && compareWith->HasFontFaceName() && compareWith->GetFontFaceName() == style.GetFontFaceName()))
|
||||
|
Reference in New Issue
Block a user