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
}
15 \helpref{Validator overview
}{validatoroverview
},
\helpref{wxValidator
}{wxvalidator
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxTextValidator::wxTextValidator
}\label{wxtextvalidatorconstr
}
21 \func{}{wxTextValidator
}{\param{const wxTextValidator\&
}{ validator
}}
25 \func{}{wxTextValidator
}{\param{long
}{ style = wxFILTER
\_NONE},
\param{wxString*
}{valPtr = NULL
}}
27 Constructor, taking a style and optional pointer to a wxString variable.
29 \wxheading{Parameters
}
31 \docparam{style
}{A bitlist of flags, which can be:
35 \twocolitem{{\bf wxFILTER
\_NONE}}{No filtering takes place.
}
36 \twocolitem{{\bf wxFILTER
\_ASCII}}{Non-ASCII characters are filtered out.
}
37 \twocolitem{{\bf wxFILTER
\_ALPHA}}{Non-alpha characters are filtered out.
}
38 \twocolitem{{\bf wxFILTER
\_ALPHANUMERIC}}{Non-alphanumeric characters are filtered out.
}
39 \twocolitem{{\bf wxFILTER
\_NUMERIC}}{Non-numeric characters are filtered out.
}
40 \twocolitem{{\bf wxFILTER
\_INCLUDE\_LIST}}{Use an include list. The validator
41 checks if the user input is on the list, complaining if not.
}
42 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_LIST}}{Use an exclude list. The validator
43 checks if the user input is on the list, complaining if it is.
}
47 \docparam{valPtr
}{A pointer to a wxString variable that contains the value. This variable
48 should have a lifetime equal to or longer than the validator lifetime (which is usually
49 determined by the lifetime of the window). If NULL, the validator uses its own internal
50 storage for the value.
}
52 \membersection{wxTextValidator::
\destruct{wxTextValidator
}}
54 \func{}{\destruct{wxTextValidator
}}{\void}
58 \membersection{wxTextValidator::Clone
}\label{wxtextvalidatorclone
}
60 \constfunc{virtual wxTextValidator*
}{Clone
}{\void}
62 Clones the text validator using the copy constructor.
64 \membersection{wxTextValidator::GetExcludeList
}\label{wxtextvalidatorgetexcludelist
}
66 \constfunc{wxStringList\&
}{GetExcludeList
}{\void}
68 Returns a reference to the exclude list (the list of invalid values).
70 \membersection{wxTextValidator::GetIncludeList
}\label{wxtextvalidatorgetincludelist
}
72 \constfunc{wxStringList\&
}{GetIncludeList
}{\void}
74 Returns a reference to the include list (the list of valid values).
76 \membersection{wxTextValidator::GetStyle
}\label{wxtextvalidatorgetstyle
}
78 \constfunc{long
}{GetStyle
}{\void}
80 Returns the validator style.
82 \membersection{wxTextValidator::OnChar
}\label{wxtextvalidatoronchar
}
84 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
86 Receives character input from the window and filters it according to the
87 current validator style.
89 \membersection{wxTextValidator::SetExcludeList
}\label{wxtextvalidatorsetexcludelist
}
91 \func{void
}{SetExcludeList
}{\param{const wxStringList\&
}{ stringList
}}
93 Sets the exclude list (invalid values for the user input).
95 \membersection{wxTextValidator::SetIncludeList
}\label{wxtextvalidatorsetincludelist
}
97 \func{void
}{SetIncludeList
}{\param{const wxStringList\&
}{ stringList
}}
99 Sets the include list (valid values for the user input).
101 \membersection{wxTextValidator::SetStyle
}\label{wxtextvalidatorsetstyle
}
103 \func{void
}{SetStyle
}{\param{long
}{ style
}}
105 Sets the validator style.
107 \membersection{wxTextValidator::TransferFromWindow
}\label{wxtextvalidatortransferfromwindow
}
109 \func{virtual bool
}{TransferToWindow
}{\param{wxWindow*
}{ parent
}}
111 Transfers the string value to the window.
113 \membersection{wxTextValidator::TransferToWindow
}\label{wxtextvalidatortransfertowindow
}
115 \func{virtual bool
}{TransferToWindow
}{\param{wxWindow*
}{ parent
}}
117 Transfers the window value to the string.
119 \membersection{wxTextValidator::Validate
}\label{wxtextvalidatorvalidate
}
121 \func{virtual bool
}{Validate
}{\param{wxWindow*
}{ parent
}}
123 Validates the window contents against the include or exclude lists, depending
124 on the validator style.