i am using WXv2.5.4. and using validator wxFILTER_EXCLUDE_LIST ,wxFILTER_INCLUDE_LIST in the wxTextControl but it is not working properly. is it a wxWidgtes Bug or should i do something else????
thanks[/u]
wxFILTER_EXCLUDE_LIST
-
- Experienced Solver
- Posts: 96
- Joined: Fri Jun 17, 2005 1:53 pm
- Location: Germany
- Contact:
Re: [b]wxFILTER_EXCLUDE_LIST[/b]
Could you post some code?Muhammad Sohail wrote:i am using WXv2.5.4. and using validator wxFILTER_EXCLUDE_LIST ,wxFILTER_INCLUDE_LIST in the wxTextControl but it is not working properly.
And what does "not working properly" mean?
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
-
- Experienced Solver
- Posts: 96
- Joined: Fri Jun 17, 2005 1:53 pm
- Location: Germany
- Contact:
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Well I Uses this:
Code: Select all
wxArrayString numberArray;
numberArray.Add(wxT("0"));
numberArray.Add(wxT("1"));
numberArray.Add(wxT("2"));
numberArray.Add(wxT("3"));
numberArray.Add(wxT("4"));
numberArray.Add(wxT("5"));
numberArray.Add(wxT("6"));
numberArray.Add(wxT("7"));
numberArray.Add(wxT("8"));
numberArray.Add(wxT("9"));
wxTextValidator textValidatorRelax(wxFILTER_INCLUDE_CHAR_LIST, &m_strRelax);
textValidatorRelax.SetIncludes(numberArray);
m_pRelaxEdit = new wxTextCtrl(this, ID_WXEDIT_RELAX, wxT(""), wxPoint(155,23), wxSize(45,20), wxTE_LEFT, textValidatorRelax, wxT("WxEditRelax"));
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
The last parameter doesn't contain the exclude list, but will store the value once it's validated.Muhammad Sohail wrote:wxTextCtrl(this, -1, wxString(""), wxPoint(-1, -1), wxSize(-1, -1), 0, wxTextValidator(wxFILTER_EXCLUDE_LIST , &wxString("*:")));
i dont want to write * and : in the text control . but its not functioning .
any solution???
Use priyank_bolia code, but set an exclude list.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
-
- Experienced Solver
- Posts: 96
- Joined: Fri Jun 17, 2005 1:53 pm
- Location: Germany
- Contact:
thanks , its working now
wxArrayString excludeList;
excludeList.Add(wxT("*"));
excludeList.Add(wxT(":"));
excludeList.Add(wxT("\\"));
excludeList.Add(wxT("/"));
excludeList.Add(wxT("?"));
excludeList.Add(wxT("\""));
excludeList.Add(wxT("<"));
excludeList.Add(wxT(">"));
excludeList.Add(wxT("|"));
excludeList.Add(wxT(" "));
wxTextValidator textValidator(wxFILTER_EXCLUDE_CHAR_LIST);
textValidator.SetExcludes(excludeList);
textCtrl = new wxTextCtrl(this, -1, wxString(""), wxPoint(-1, -1), wxSize(-1, -1), 0, textValidator);
this code doesnot permit the user to write the excludeList Characters.
thnaks again
wxArrayString excludeList;
excludeList.Add(wxT("*"));
excludeList.Add(wxT(":"));
excludeList.Add(wxT("\\"));
excludeList.Add(wxT("/"));
excludeList.Add(wxT("?"));
excludeList.Add(wxT("\""));
excludeList.Add(wxT("<"));
excludeList.Add(wxT(">"));
excludeList.Add(wxT("|"));
excludeList.Add(wxT(" "));
wxTextValidator textValidator(wxFILTER_EXCLUDE_CHAR_LIST);
textValidator.SetExcludes(excludeList);
textCtrl = new wxTextCtrl(this, -1, wxString(""), wxPoint(-1, -1), wxSize(-1, -1), 0, textValidator);
this code doesnot permit the user to write the excludeList Characters.
thnaks again