11#include " WXAS_ParameterDialog.hpp"
2+ #include " WXAS_ControlUtilities.hpp"
23#include " NUIE_NodeParameters.hpp"
34#include " NE_SingleValues.hpp"
45#include " NE_Debug.hpp"
@@ -18,19 +19,6 @@ static size_t ControlIdToParamId (wxWindowID controlId)
1819 return (size_t ) controlId - FirstControlId;
1920}
2021
21- static void SetTextValidator (wxTextCtrl* textCtrl, const std::wstring& validChars)
22- {
23- wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST);
24- wxArrayString includeList;
25-
26- for (const wchar_t & character : validChars) {
27- includeList.Add (character);
28- }
29-
30- validator.SetIncludes (includeList);
31- textCtrl->SetValidator (validator);
32- }
33-
3422ParameterDialog::ParameterDialog (wxWindow* parent, NUIE ::ParameterInterfacePtr& paramInterface) :
3523 wxDialog (parent, wxID_ANY, L" Set Parameters" , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
3624 paramInterface (paramInterface),
@@ -56,19 +44,19 @@ ParameterDialog::ParameterDialog (wxWindow* parent, NUIE::ParameterInterfacePtr&
5644 } else if (type == NUIE ::ParameterType::Integer) {
5745 if (DBGVERIFY (NE ::Value::IsType<NE ::IntValue> (value))) {
5846 wxTextCtrl* textControl = new wxTextCtrl (this , controlId, NUIE::ParameterValueToString (value, type));
59- SetTextValidator (textControl, L" 0123456789-" );
47+ SetTextControlValidator (textControl, L" 0123456789-" );
6048 control = textControl;
6149 }
6250 } else if (type == NUIE ::ParameterType::Float) {
6351 if (DBGVERIFY (NE ::Value::IsType<NE ::FloatValue> (value))) {
6452 wxTextCtrl* textControl = new wxTextCtrl (this , controlId, NUIE::ParameterValueToString (value, type));
65- SetTextValidator (textControl, L" 0123456789.-" );
53+ SetTextControlValidator (textControl, L" 0123456789.-" );
6654 control = textControl;
6755 }
6856 } else if (type == NUIE ::ParameterType::Double) {
6957 if (DBGVERIFY (NE ::Value::IsType<NE ::DoubleValue> (value))) {
7058 wxTextCtrl* textControl = new wxTextCtrl (this , controlId, NUIE::ParameterValueToString (value, type));
71- SetTextValidator (textControl, L" 0123456789.-" );
59+ SetTextControlValidator (textControl, L" 0123456789.-" );
7260 control = textControl;
7361 }
7462 } else if (type == NUIE ::ParameterType::String) {
0 commit comments