Hallo all,
Is there any possibility to define a filter with specific range?
e.g.
I only want to filter following chracters for my password in the wxTextCtrl
A - Z
a - z
0 - 9
wxTextValidator and Filter range Topic is solved
-
- Experienced Solver
- Posts: 96
- Joined: Fri Jun 17, 2005 1:53 pm
- Location: Germany
- Contact:
-
- Experienced Solver
- Posts: 96
- Joined: Fri Jun 17, 2005 1:53 pm
- Location: Germany
- Contact:
Code: Select all
wxArrayString includeList;
for (size_t i = 65; i <= 90 ; i++)
{
std::stringstream alpha;
alpha << (char) i;
includeList.Add( wxT(alpha.str()) );
}
for (size_t i = 97; i <= 122 ; i++)
{
std::stringstream alpha;
alpha << (char) i;
includeList.Add( wxT( alpha.str()) );
}
includeList.Add(wxT("0"));
includeList.Add(wxT("1"));
includeList.Add(wxT("2"));
includeList.Add(wxT("3"));
includeList.Add(wxT("4"));
includeList.Add(wxT("5"));
includeList.Add(wxT("6"));
includeList.Add(wxT("7"));
includeList.Add(wxT("8"));
includeList.Add(wxT("9"));
wxTextValidator validator(wxFILTER_INCLUDE_CHAR_LIST);
validator.SetIncludes(includeList);
Hi,
Can't you just use:
Otherwise the validator will have to search through the list of includes for every character entry. I assume the above uses the isalnum() macro instead which will be much more efficient.
Cheers
Nigel
Can't you just use:
Code: Select all
wxTextValidator validator(wxFILTER_ALPHANUMERIC);
Cheers
Nigel