From 21fd108d23c34b10d80072e1c3e92e56fed3cdac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 May 2014 16:35:58 +0000 Subject: [PATCH] Add support for "hint" property in wxTextCtrl XRC handler. It is convenient to allow specifying the hints directly in the resources. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/doxygen/overviews/xrc_format.h | 2 ++ misc/schema/xrc_schema.rnc | 3 ++- src/xrc/xh_text.cpp | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index 5e7190977d..0a4b3d7452 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -1864,6 +1864,8 @@ 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{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 942b9f988b..6646d78632 100644 --- a/misc/schema/xrc_schema.rnc +++ b/misc/schema/xrc_schema.rnc @@ -1234,7 +1234,8 @@ wxRichTextCtrl = stdObjectNodeAttributes & stdWindowProperties & [xrc:p="o"] element value {_, t_text }* & - [xrc:p="o"] element maxlength {_, t_integer }* + [xrc:p="o"] element maxlength {_, t_integer }* & + [xrc:p="o"] element hint {_, t_text }* } diff --git a/src/xrc/xh_text.cpp b/src/xrc/xh_text.cpp index ae081c2dab..99a7b97f47 100644 --- a/src/xrc/xh_text.cpp +++ b/src/xrc/xh_text.cpp @@ -69,6 +69,8 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource() if (HasParam(wxT("maxlength"))) text->SetMaxLength(GetLong(wxT("maxlength"))); + text->SetHint(GetText(wxS("hint"))); + return text; }