1
1
#include " WXAS_ParameterDialog.hpp"
2
+ #include " WXAS_ControlUtilities.hpp"
2
3
#include " NUIE_NodeParameters.hpp"
3
4
#include " NE_SingleValues.hpp"
4
5
#include " NE_Debug.hpp"
@@ -18,19 +19,6 @@ static size_t ControlIdToParamId (wxWindowID controlId)
18
19
return (size_t ) controlId - FirstControlId;
19
20
}
20
21
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
-
34
22
ParameterDialog::ParameterDialog (wxWindow* parent, NUIE::ParameterInterfacePtr& paramInterface) :
35
23
wxDialog (parent, wxID_ANY, L" Set Parameters" , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
36
24
paramInterface (paramInterface),
@@ -56,19 +44,19 @@ ParameterDialog::ParameterDialog (wxWindow* parent, NUIE::ParameterInterfacePtr&
56
44
} else if (type == NUIE::ParameterType::Integer) {
57
45
if (DBGVERIFY (NE::Value::IsType<NE::IntValue> (value))) {
58
46
wxTextCtrl* textControl = new wxTextCtrl (this , controlId, NUIE::ParameterValueToString (value, type));
59
- SetTextValidator (textControl, L" 0123456789-" );
47
+ SetTextControlValidator (textControl, L" 0123456789-" );
60
48
control = textControl;
61
49
}
62
50
} else if (type == NUIE::ParameterType::Float) {
63
51
if (DBGVERIFY (NE::Value::IsType<NE::FloatValue> (value))) {
64
52
wxTextCtrl* textControl = new wxTextCtrl (this , controlId, NUIE::ParameterValueToString (value, type));
65
- SetTextValidator (textControl, L" 0123456789.-" );
53
+ SetTextControlValidator (textControl, L" 0123456789.-" );
66
54
control = textControl;
67
55
}
68
56
} else if (type == NUIE::ParameterType::Double) {
69
57
if (DBGVERIFY (NE::Value::IsType<NE::DoubleValue> (value))) {
70
58
wxTextCtrl* textControl = new wxTextCtrl (this , controlId, NUIE::ParameterValueToString (value, type));
71
- SetTextValidator (textControl, L" 0123456789.-" );
59
+ SetTextControlValidator (textControl, L" 0123456789.-" );
72
60
control = textControl;
73
61
}
74
62
} else if (type == NUIE::ParameterType::String) {
0 commit comments