wxTextValidator improvements

Improve char inclusion/exclusion support; update the sample to show more
features of this class and add a unit test for it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1093
This commit is contained in:
ali kettab
2019-01-01 00:55:14 +01:00
committed by Vadim Zeitlin
parent 697125dc03
commit 36f6f8ad49
18 changed files with 1000 additions and 247 deletions

View File

@@ -650,16 +650,12 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const
#if wxUSE_VALIDATORS
WX_PG_DOGETVALIDATOR_ENTRY()
wxTextValidator* validator = new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST);
wxTextValidator* validator =
new wxNumericPropertyValidator(wxNumericPropertyValidator::Float);
// Accept characters for numeric elements
wxNumericPropertyValidator numValidator(wxNumericPropertyValidator::Float);
wxArrayString incChars(numValidator.GetIncludes());
// Accept also a delimiter and space character
incChars.Add(m_delimiter);
incChars.Add(" ");
validator->SetIncludes(incChars);
validator->AddCharIncludes(m_delimiter);
validator->AddCharIncludes(" ");
WX_PG_DOGETVALIDATOR_EXIT(validator)
#else