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:
committed by
Vadim Zeitlin
parent
697125dc03
commit
36f6f8ad49
@@ -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
|
||||
|
Reference in New Issue
Block a user