From a1a805d4fe5a762fa5293f160a572e5330e69138 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Sep 2014 11:31:04 +0000 Subject: [PATCH] Accept "default" as font family value in XRC. Map it to wxFONTFAMILY_DEFAULT, just as we do for all other wxFontFamily enum elements. Closes #16549. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77685 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + docs/doxygen/overviews/xrc_format.h | 4 ++-- src/xrc/xmlres.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index b08252e252..91489a2fb1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -592,6 +592,7 @@ All (GUI): - Add XRC handler for wxSimplebook. - Return correct value from wxCommandEvent::GetString() for programmatically generated wxEVT_TEXT events from wxComboBox. +- Accept "default" as font family value in XRC (pieleric). wxGTK: diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index f24ab95ac9..8c28a59407 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -401,8 +401,8 @@ and can be one of the following "sub-properties": @row3col{weight, enum, One of "normal", "bold" or "light" (default: normal).} @row3col{family, enum, - One of "roman", "script", "decorative", "swiss", "modern" or "teletype" - (default: roman).} + One of "default", "roman", "script", "decorative", "swiss", "modern" or "teletype" + (default: default).} @row3col{underlined, @ref overview_xrcformat_type_bool, Whether the font should be underlined (default: 0).} @row3col{face, , diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index d1cc96e219..da11cc9f0e 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -2268,7 +2268,8 @@ wxFont wxXmlResourceHandlerImpl::GetFont(const wxString& param, wxWindow* parent if (hasFamily) { wxString family = GetParamValue(wxT("family")); - if (family == wxT("decorative")) ifamily = wxDECORATIVE; + if (family == wxT("default")) ifamily = wxFONTFAMILY_DEFAULT; + else if (family == wxT("decorative")) ifamily = wxDECORATIVE; else if (family == wxT("roman")) ifamily = wxROMAN; else if (family == wxT("script")) ifamily = wxSCRIPT; else if (family == wxT("swiss")) ifamily = wxSWISS;