From cf966718e6ca7ce52593393237a04db9dc896b78 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Jul 2018 14:38:29 +0200 Subject: [PATCH] Add "hint" property support to XRC for wxComboBox too It supports hints, as any/most wxTextEntry-derived classes. --- docs/changes.txt | 1 + misc/schema/xrc_schema.rnc | 1 + src/xrc/xh_combo.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 850405d9ca..4762e4888a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -100,6 +100,7 @@ All (GUI): - Make wxRibbonButtonBar buttons more customizable (Max Maisel). - Add wxHtmlEasyPrinting::SetPromptMode() (pavel-t). - Fix possible infinite loop in wxHtmlWindow layout (trivia21). +- Add "hint" property support to XRC for wxComboBox and wxSearchCtrl. wxGTK: diff --git a/misc/schema/xrc_schema.rnc b/misc/schema/xrc_schema.rnc index aecec55134..c0d60d10ef 100644 --- a/misc/schema/xrc_schema.rnc +++ b/misc/schema/xrc_schema.rnc @@ -829,6 +829,7 @@ wxComboBox = stdWindowProperties & [xrc:p="o"] element selection {_, t_integer }* & [xrc:p="o"] element value {_, t_string }* & + [xrc:p="o"] element hint {_, t_text }* & element content { platform, element item {_, t_text }* diff --git a/src/xrc/xh_combo.cpp b/src/xrc/xh_combo.cpp index e0f672ebe4..ceda6f003e 100644 --- a/src/xrc/xh_combo.cpp +++ b/src/xrc/xh_combo.cpp @@ -67,6 +67,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource() SetupWindow(control); + const wxString hint = GetText(wxS("hint")); + if ( !hint.empty() ) + control->SetHint(hint); + strList.Clear(); // dump the strings return control;