diff --git a/docs/changes.txt b/docs/changes.txt
index 5237bdc894..d73e8f00e8 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -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:
diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h
index d8702ef93d..1590108815 100644
--- a/docs/doxygen/overviews/xrc_format.h
+++ b/docs/doxygen/overviews/xrc_format.h
@@ -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).}
diff --git a/misc/schema/xrc_schema.rnc b/misc/schema/xrc_schema.rnc
index 26e9efa7e7..46315e4491 100644
--- a/misc/schema/xrc_schema.rnc
+++ b/misc/schema/xrc_schema.rnc
@@ -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" |
diff --git a/samples/xrc/rc/controls.xrc b/samples/xrc/rc/controls.xrc
index e93a7ce0e8..40083a8379 100644
--- a/samples/xrc/rc/controls.xrc
+++ b/samples/xrc/rc/controls.xrc
@@ -1099,7 +1099,7 @@ lay them out using wxSizers, absolute positioning, everything you like!
wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxALL5
diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp
index 2bf281e37b..ccad3d1a46 100644
--- a/src/xrc/xmlres.cpp
+++ b/src/xrc/xmlres.cpp
@@ -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)
;
}