From 60c2b96aef18b48cb6750450a165a6c3168a7d9e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 25 Nov 2015 17:12:35 +0100 Subject: [PATCH] Add support for "forceupper" attribute to wxTextCtrl in XRC Call ForceUpper() if this attribute is specified. Currently this is done only for wxTextCtrl but could be extended to wxComboBox later too if necessary. --- docs/doxygen/overviews/xrc_format.h | 3 +++ misc/schema/xrc_schema.rnc | 1 + src/xrc/xh_text.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index bfa79ffe64..22ca541d52 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -1900,6 +1900,9 @@ No additional properties. Initial value of the control (default: empty).} @row3col{maxlength, integer, Maximum length of the text which can be entered by user (default: unlimited).} +@row3col{forceupper, @ref overview_xrcformat_type_bool, + If true, use wxTextEntry::ForceUpper() to force the control contents to be + upper case.} @row3col{hint, @ref overview_xrcformat_type_text, Hint shown in empty control (new since wxWidgets 3.0.1).} @endTable diff --git a/misc/schema/xrc_schema.rnc b/misc/schema/xrc_schema.rnc index fa56779c8a..5485c6efc4 100644 --- a/misc/schema/xrc_schema.rnc +++ b/misc/schema/xrc_schema.rnc @@ -1432,6 +1432,7 @@ wxTextCtrl = stdWindowProperties & [xrc:p="o"] element value {_, t_text }* & [xrc:p="o"] element maxlength {_, t_integer }* & + [xrc:p="o"] element forceupper{_, t_bool }* & [xrc:p="o"] element hint {_, t_text }* } diff --git a/src/xrc/xh_text.cpp b/src/xrc/xh_text.cpp index 6bedf8610d..f9e96d9173 100644 --- a/src/xrc/xh_text.cpp +++ b/src/xrc/xh_text.cpp @@ -68,6 +68,8 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource() if (HasParam(wxT("maxlength"))) text->SetMaxLength(GetLong(wxT("maxlength"))); + if (GetBool(wxS("forceupper"))) + text->ForceUpper(); const wxString hint = GetText(wxS("hint")); if (!hint.empty())