]>
git.saurik.com Git - wxWidgets.git/blob - interface/valtext.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxTextValidator class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxTextValidator
13 wxTextValidator validates text controls, providing a variety of filtering
16 For more information, please see @ref overview_validatoroverview "Validator
23 @ref overview_validatoroverview "Validator overview", wxValidator,
26 class wxTextValidator
: public wxValidator
31 Constructor, taking a style and optional pointer to a wxString variable.
34 A bitlist of flags, which can be:
40 No filtering takes place.
45 Non-ASCII characters are filtered out.
50 Non-alpha characters are filtered out.
55 Non-alphanumeric characters are filtered out.
60 Non-numeric characters are filtered out.
65 Use an include list. The validator
66 checks if the user input is on the list, complaining if not. See
72 Use an exclude list. The validator
73 checks if the user input is on the list, complaining if it is. See
76 wxFILTER_INCLUDE_CHAR_LIST
79 Use an include list. The validator
80 checks if each input character is in the list (one character per list element),
84 wxFILTER_EXCLUDE_CHAR_LIST
87 Use an include list. The validator
88 checks if each input character is in the list (one character per list element),
93 A pointer to a wxString variable that contains the value. This variable
94 should have a lifetime equal to or longer than the validator lifetime (which is
96 determined by the lifetime of the window).
98 wxTextValidator(const wxTextValidator
& validator
);
99 wxTextValidator(long style
= wxFILTER_NONE
,
100 wxString
* valPtr
= @NULL
);
104 Clones the text validator using the copy constructor.
106 virtual wxValidator
* Clone();
109 Returns a reference to the exclude list (the list of invalid values).
111 wxArrayString
GetExcludes();
114 Returns a reference to the include list (the list of valid values).
116 wxArrayString
GetIncludes();
119 Returns the validator style.
124 Receives character input from the window and filters it according to the
125 current validator style.
127 void OnChar(wxKeyEvent
& event
);
130 Sets the exclude list (invalid values for the user input).
132 void SetExcludes(const wxArrayString
& stringList
);
135 Sets the include list (valid values for the user input).
137 void SetIncludes(const wxArrayString
& stringList
);
140 Sets the validator style.
142 void SetStyle(long style
);
145 Transfers the value in the text control to the string.
147 virtual bool TransferFromWindow();
150 Transfers the string value to the text control.
152 virtual bool TransferToWindow();
155 Validates the window contents against the include or exclude lists, depending
156 on the validator style.
158 virtual bool Validate(wxWindow
* parent
);