]>
git.saurik.com Git - wxWidgets.git/blob - interface/valtext.h
7e9db73762490a3d390c7600990eebec92b80fa7
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:
47 No filtering takes place.
58 Non-ASCII characters are filtered out.
69 Non-alpha characters are filtered out.
80 Non-alphanumeric characters are filtered out.
91 Non-numeric characters are filtered out.
102 Use an include list. The validator
103 checks if the user input is on the list, complaining if not. See
110 wxFILTER_EXCLUDE_LIST
115 Use an exclude list. The validator
116 checks if the user input is on the list, complaining if it is. See
123 wxFILTER_INCLUDE_CHAR_LIST
128 Use an include list. The validator
129 checks if each input character is in the list (one character per list
130 element), complaining if not.
137 wxFILTER_EXCLUDE_CHAR_LIST
142 Use an include list. The validator
143 checks if each input character is in the list (one character per list
144 element), complaining if it is.
147 A pointer to a wxString variable that contains the value. This variable
148 should have a lifetime equal to or longer than the validator lifetime
150 determined by the lifetime of the window).
152 wxTextValidator(const wxTextValidator
& validator
);
153 wxTextValidator(long style
= wxFILTER_NONE
,
154 wxString
* valPtr
= NULL
);
158 Clones the text validator using the copy constructor.
160 virtual wxValidator
* Clone();
163 Returns a reference to the exclude list (the list of invalid values).
165 wxArrayString
GetExcludes();
168 Returns a reference to the include list (the list of valid values).
170 wxArrayString
GetIncludes();
173 Returns the validator style.
178 Receives character input from the window and filters it according to the
179 current validator style.
181 void OnChar(wxKeyEvent
& event
);
184 Sets the exclude list (invalid values for the user input).
186 void SetExcludes(const wxArrayString
& stringList
);
189 Sets the include list (valid values for the user input).
191 void SetIncludes(const wxArrayString
& stringList
);
194 Sets the validator style.
196 void SetStyle(long style
);
199 Transfers the value in the text control to the string.
201 virtual bool TransferFromWindow();
204 Transfers the string value to the text control.
206 virtual bool TransferToWindow();
209 Validates the window contents against the include or exclude lists, depending
210 on the validator style.
212 virtual bool Validate(wxWindow
* parent
);