From 652b4eb8ed940f1a57e38d4b9d949b34e886d53d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 Jan 2018 13:46:54 +0100 Subject: [PATCH] Add "hint" property to wxSearchCtrl XRC handler This is similar to wxTextCtrl property of the same name and maps naturally to wxSearchCtrl descriptive text attribute. --- docs/changes.txt | 1 + docs/doxygen/overviews/xrc_format.h | 3 +++ src/xrc/xh_srchctrl.cpp | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 27f23deb7e..421f13d163 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -176,6 +176,7 @@ All (GUI): - Add wxFontPickerCtrl::SetMinPointSize() (Andreas Falkenhahn). - Add Set/GetFooter/Text/Icon() to wxRichMessageDialog (Tobias Taschner) - Add wxFloatingPointValidator::SetFactor(). +- Add "hint" property to wxSearchCtrl XRC handler. wxGTK: diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index 75a9f54815..92cea1ff7c 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -1950,6 +1950,9 @@ child and the second one for right/bottom child window. @hdr3col{property, type, description} @row3col{value, @ref overview_xrcformat_type_text, Initial value of the control (default: empty).} +@row3col{hint, @ref overview_xrcformat_type_text, + Descriptive text shown in the empty control (default: "Search"). This + property is new since wxWidgets 3.1.1.} @endTable diff --git a/src/xrc/xh_srchctrl.cpp b/src/xrc/xh_srchctrl.cpp index dbaafdedde..122d38cfbc 100644 --- a/src/xrc/xh_srchctrl.cpp +++ b/src/xrc/xh_srchctrl.cpp @@ -49,6 +49,10 @@ wxObject *wxSearchCtrlXmlHandler::DoCreateResource() SetupWindow(ctrl); + const wxString& hint = GetText(wxS("hint")); + if ( !hint.empty() ) + ctrl->SetDescriptiveText(hint); + return ctrl; }