Add strikethrough support for fonts defined in XRC
Handle this attribute as well as "underlined" for completeness.
This commit is contained in:
@@ -115,6 +115,7 @@ All (GUI):
|
||||
- Support strike-through in wxDataViewItem attributes (approach, Igor Korot).
|
||||
- Allow distinguishing between user- and script-opened windows in wxWebView.
|
||||
- Allow binding to events generated by their items in submenus too.
|
||||
- Add strikethrough support for fonts defined in XRC.
|
||||
|
||||
wxGTK:
|
||||
|
||||
|
@@ -422,6 +422,9 @@ and can be one of the following "sub-properties":
|
||||
(default: default).}
|
||||
@row3col{underlined, @ref overview_xrcformat_type_bool,
|
||||
Whether the font should be underlined (default: 0).}
|
||||
@row3col{strikethrough, @ref overview_xrcformat_type_bool,
|
||||
Whether the strikethrough font should be used (default: 0). This property
|
||||
is only supported since wxWidgets 3.1.2.}
|
||||
@row3col{face, ,
|
||||
Comma-separated list of face names; the first one available is used
|
||||
(default: unspecified).}
|
||||
|
@@ -462,6 +462,7 @@ t_font = (
|
||||
[xrc:p="o"] element family {_, ("roman" | "script" | "decorative" | "swiss" |
|
||||
"modern" | "teletype") }* &
|
||||
[xrc:p="o"] element underlined {_, t_bool }* &
|
||||
[xrc:p="o"] element strikethrough{_, t_bool }* &
|
||||
[xrc:p="o"] element face {_, t_text }* &
|
||||
[xrc:p="o"] element encoding {_, t_text }* &
|
||||
[xrc:p="o"] element sysfont {_, ("wxSYS_OEM_FIXED_FONT" | "wxSYS_ANSI_FIXED_FONT" |
|
||||
|
@@ -1099,7 +1099,7 @@ lay them out using wxSizers, absolute positioning, everything you like!
|
||||
<flag>wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxALL</flag>
|
||||
<border>5</border>
|
||||
<object class="wxStaticText" name="wxID_STATIC">
|
||||
<label>Slightly larger font:</label>
|
||||
<label>Slightly larger strikethrough font:</label>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
@@ -1109,6 +1109,7 @@ lay them out using wxSizers, absolute positioning, everything you like!
|
||||
<label>It was a dark and stormy night.</label>
|
||||
<font>
|
||||
<size>12.5</size>
|
||||
<strikethrough>1</strikethrough>
|
||||
</font>
|
||||
</object>
|
||||
</object>
|
||||
|
@@ -2349,6 +2349,10 @@ wxFont wxXmlResourceHandlerImpl::GetFont(const wxString& param, wxWindow* parent
|
||||
bool hasUnderlined = HasParam(wxT("underlined"));
|
||||
bool underlined = hasUnderlined ? GetBool(wxT("underlined"), false) : false;
|
||||
|
||||
// strikethrough
|
||||
bool hasStrikethrough = HasParam(wxT("strikethrough"));
|
||||
bool strikethrough = hasStrikethrough ? GetBool(wxT("strikethrough"), false) : false;
|
||||
|
||||
// family and facename
|
||||
wxFontFamily ifamily = wxFONTFAMILY_DEFAULT;
|
||||
bool hasFamily = HasParam(wxT("family"));
|
||||
@@ -2466,6 +2470,8 @@ wxFont wxXmlResourceHandlerImpl::GetFont(const wxString& param, wxWindow* parent
|
||||
font.SetNumericWeight(iweight);
|
||||
if (hasUnderlined)
|
||||
font.SetUnderlined(underlined);
|
||||
if (hasStrikethrough)
|
||||
font.SetStrikethrough(strikethrough);
|
||||
if (hasFamily)
|
||||
font.SetFamily(ifamily);
|
||||
if (hasFacename)
|
||||
@@ -2481,6 +2487,7 @@ wxFont wxXmlResourceHandlerImpl::GetFont(const wxString& param, wxWindow* parent
|
||||
.Style(istyle)
|
||||
.Weight(iweight)
|
||||
.Underlined(underlined)
|
||||
.Strikethrough(strikethrough)
|
||||
.Encoding(enc)
|
||||
;
|
||||
}
|
||||
|
Reference in New Issue
Block a user