1 \section{\class{wxTextValidator
}}\label{wxtextvalidator
}
3 wxTextValidator validates text controls, providing a variety of filtering behaviours.
5 For more information, please see
\helpref{Validator overview
}{validatoroverview
}.
7 \wxheading{Derived from
}
9 \helpref{wxValidator
}{wxvalidator
}\\
10 \helpref{wxEvtHandler
}{wxevthandler
}\\
11 \helpref{wxObject
}{wxobject
}
13 \wxheading{Include files
}
19 \helpref{Validator overview
}{validatoroverview
},
\helpref{wxValidator
}{wxvalidator
},
20 \helpref{wxGenericValidator
}{wxgenericvalidator
}
22 \latexignore{\rtfignore{\wxheading{Members
}}}
24 \membersection{wxTextValidator::wxTextValidator
}\label{wxtextvalidatorconstr
}
26 \func{}{wxTextValidator
}{\param{const wxTextValidator\&
}{ validator
}}
30 \func{}{wxTextValidator
}{\param{long
}{ style = wxFILTER
\_NONE},
\param{wxString*
}{valPtr = NULL
}}
32 Constructor, taking a style and optional pointer to a wxString variable.
34 \wxheading{Parameters
}
36 \docparam{style
}{A bitlist of flags, which can be:
40 \twocolitem{{\bf wxFILTER
\_NONE}}{No filtering takes place.
}
41 \twocolitem{{\bf wxFILTER
\_ASCII}}{Non-ASCII characters are filtered out.
}
42 \twocolitem{{\bf wxFILTER
\_ALPHA}}{Non-alpha characters are filtered out.
}
43 \twocolitem{{\bf wxFILTER
\_ALPHANUMERIC}}{Non-alphanumeric characters are filtered out.
}
44 \twocolitem{{\bf wxFILTER
\_NUMERIC}}{Non-numeric characters are filtered out.
}
45 \twocolitem{{\bf wxFILTER
\_INCLUDE\_LIST}}{Use an include list. The validator
46 checks if the user input is on the list, complaining if not.
}
47 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_LIST}}{Use an exclude list. The validator
48 checks if the user input is on the list, complaining if it is.
}
49 \twocolitem{{\bf wxFILTER
\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
50 checks if each input character is in the list (one character per list element), complaining if not.
}
51 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
52 checks if each input character is in the list (one character per list element), complaining if it is.
}
56 \docparam{valPtr
}{A pointer to a wxString variable that contains the value. This variable
57 should have a lifetime equal to or longer than the validator lifetime (which is usually
58 determined by the lifetime of the window). If NULL, the validator uses its own internal
59 storage for the value.
}
61 \membersection{wxTextValidator::
\destruct{wxTextValidator
}}
63 \func{}{\destruct{wxTextValidator
}}{\void}
67 \membersection{wxTextValidator::Clone
}\label{wxtextvalidatorclone
}
69 \constfunc{virtual wxValidator*
}{Clone
}{\void}
71 Clones the text validator using the copy constructor.
73 \membersection{wxTextValidator::GetExcludeList
}\label{wxtextvalidatorgetexcludelist
}
75 \constfunc{wxStringList\&
}{GetExcludeList
}{\void}
77 Returns a reference to the exclude list (the list of invalid values).
79 \membersection{wxTextValidator::GetIncludeList
}\label{wxtextvalidatorgetincludelist
}
81 \constfunc{wxStringList\&
}{GetIncludeList
}{\void}
83 Returns a reference to the include list (the list of valid values).
85 \membersection{wxTextValidator::GetStyle
}\label{wxtextvalidatorgetstyle
}
87 \constfunc{long
}{GetStyle
}{\void}
89 Returns the validator style.
91 \membersection{wxTextValidator::OnChar
}\label{wxtextvalidatoronchar
}
93 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
95 Receives character input from the window and filters it according to the
96 current validator style.
98 \membersection{wxTextValidator::SetExcludeList
}\label{wxtextvalidatorsetexcludelist
}
100 \func{void
}{SetExcludeList
}{\param{const wxStringList\&
}{ stringList
}}
102 Sets the exclude list (invalid values for the user input).
104 \membersection{wxTextValidator::SetIncludeList
}\label{wxtextvalidatorsetincludelist
}
106 \func{void
}{SetIncludeList
}{\param{const wxStringList\&
}{ stringList
}}
108 Sets the include list (valid values for the user input).
110 \membersection{wxTextValidator::SetStyle
}\label{wxtextvalidatorsetstyle
}
112 \func{void
}{SetStyle
}{\param{long
}{ style
}}
114 Sets the validator style.
116 \membersection{wxTextValidator::TransferFromWindow
}\label{wxtextvalidatortransferfromwindow
}
118 \func{virtual bool
}{TransferFromWindow
}{}
120 Transfers the string value to the window.
122 \membersection{wxTextValidator::TransferToWindow
}\label{wxtextvalidatortransfertowindow
}
124 \func{virtual bool
}{TransferToWindow
}{}
126 Transfers the window value to the string.
128 \membersection{wxTextValidator::Validate
}\label{wxtextvalidatorvalidate
}
130 \func{virtual bool
}{Validate
}{\param{wxWindow*
}{ parent
}}
132 Validates the window contents against the include or exclude lists, depending
133 on the validator style.