From 9bc6c3c2347453e6255bf2e4d10f95f4c243934d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 5 Nov 2020 01:39:20 +0100 Subject: [PATCH] Add support for wxDatePickerCtrl::SetNullText() to XRC Recognize null-text element. --- misc/schema/xrc_schema.rnc | 3 ++- src/xrc/xh_datectrl.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/schema/xrc_schema.rnc b/misc/schema/xrc_schema.rnc index 8b63cbe642..23a132f74b 100644 --- a/misc/schema/xrc_schema.rnc +++ b/misc/schema/xrc_schema.rnc @@ -894,7 +894,8 @@ wxDatePickerCtrl = element object { attribute class { "wxDatePickerCtrl" } & stdObjectNodeAttributes & - stdWindowProperties + stdWindowProperties & + [xrc:p="o"] element null-text {_, t_text }* } diff --git a/src/xrc/xh_datectrl.cpp b/src/xrc/xh_datectrl.cpp index 5255e75864..6ee4f99f51 100644 --- a/src/xrc/xh_datectrl.cpp +++ b/src/xrc/xh_datectrl.cpp @@ -42,6 +42,10 @@ wxObject *wxDateCtrlXmlHandler::DoCreateResource() SetupWindow(picker); + // Note that we want to set this one even if it's empty. + if ( HasParam(wxS("null-text")) ) + picker->SetNullText(GetText(wxS("null-text"))); + return picker; }