]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/valtext.tex
* Stream: update in doc, fix in code.
[wxWidgets.git] / docs / latex / wx / valtext.tex
CommitLineData
a660d684
KB
1\section{\class{wxTextValidator}}\label{wxtextvalidator}
2
3wxTextValidator validates text controls, providing a variety of filtering behaviours.
4
5For more information, please see \helpref{Validator overview}{validatoroverview}.
6
7\wxheading{Derived from}
8
9\helpref{wxValidator}{wxvalidator}\\
10\helpref{wxEvtHandler}{wxevthandler}\\
11\helpref{wxObject}{wxobject}
12
13\wxheading{See also}
14
89c684ef
JS
15\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator},
16\helpref{wxGenericValidator}{wxgenericvalidator}
a660d684
KB
17
18\latexignore{\rtfignore{\wxheading{Members}}}
19
20\membersection{wxTextValidator::wxTextValidator}\label{wxtextvalidatorconstr}
21
22\func{}{wxTextValidator}{\param{const wxTextValidator\&}{ validator}}
23
24Copy constructor.
25
eaaa6a06 26\func{}{wxTextValidator}{\param{long}{ style = wxFILTER\_NONE}, \param{wxString* }{valPtr = NULL}}
a660d684
KB
27
28Constructor, taking a style and optional pointer to a wxString variable.
29
30\wxheading{Parameters}
31
32\docparam{style}{A bitlist of flags, which can be:
33
34\twocolwidtha{5cm}
35\begin{twocollist}
36\twocolitem{{\bf wxFILTER\_NONE}}{No filtering takes place.}
37\twocolitem{{\bf wxFILTER\_ASCII}}{Non-ASCII characters are filtered out.}
38\twocolitem{{\bf wxFILTER\_ALPHA}}{Non-alpha characters are filtered out.}
39\twocolitem{{\bf wxFILTER\_ALPHANUMERIC}}{Non-alphanumeric characters are filtered out.}
40\twocolitem{{\bf wxFILTER\_NUMERIC}}{Non-numeric characters are filtered out.}
41\twocolitem{{\bf wxFILTER\_INCLUDE\_LIST}}{Use an include list. The validator
42checks if the user input is on the list, complaining if not.}
43\twocolitem{{\bf wxFILTER\_EXCLUDE\_LIST}}{Use an exclude list. The validator
44checks if the user input is on the list, complaining if it is.}
45\end{twocollist}
46}
47
48\docparam{valPtr}{A pointer to a wxString variable that contains the value. This variable
49should have a lifetime equal to or longer than the validator lifetime (which is usually
50determined by the lifetime of the window). If NULL, the validator uses its own internal
51storage for the value.}
52
53\membersection{wxTextValidator::\destruct{wxTextValidator}}
54
55\func{}{\destruct{wxTextValidator}}{\void}
56
57Destructor.
58
59\membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
60
89c684ef 61\constfunc{virtual wxValidator*}{Clone}{\void}
a660d684
KB
62
63Clones the text validator using the copy constructor.
64
65\membersection{wxTextValidator::GetExcludeList}\label{wxtextvalidatorgetexcludelist}
66
67\constfunc{wxStringList\&}{GetExcludeList}{\void}
68
69Returns a reference to the exclude list (the list of invalid values).
70
71\membersection{wxTextValidator::GetIncludeList}\label{wxtextvalidatorgetincludelist}
72
73\constfunc{wxStringList\&}{GetIncludeList}{\void}
74
75Returns a reference to the include list (the list of valid values).
76
77\membersection{wxTextValidator::GetStyle}\label{wxtextvalidatorgetstyle}
78
79\constfunc{long}{GetStyle}{\void}
80
81Returns the validator style.
82
83\membersection{wxTextValidator::OnChar}\label{wxtextvalidatoronchar}
84
85\func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
86
87Receives character input from the window and filters it according to the
88current validator style.
89
90\membersection{wxTextValidator::SetExcludeList}\label{wxtextvalidatorsetexcludelist}
91
92\func{void}{SetExcludeList}{\param{const wxStringList\&}{ stringList}}
93
94Sets the exclude list (invalid values for the user input).
95
96\membersection{wxTextValidator::SetIncludeList}\label{wxtextvalidatorsetincludelist}
97
98\func{void}{SetIncludeList}{\param{const wxStringList\&}{ stringList}}
99
100Sets the include list (valid values for the user input).
101
102\membersection{wxTextValidator::SetStyle}\label{wxtextvalidatorsetstyle}
103
104\func{void}{SetStyle}{\param{long}{ style}}
105
106Sets the validator style.
107
108\membersection{wxTextValidator::TransferFromWindow}\label{wxtextvalidatortransferfromwindow}
109
110\func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
111
112Transfers the string value to the window.
113
114\membersection{wxTextValidator::TransferToWindow}\label{wxtextvalidatortransfertowindow}
115
116\func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
117
118Transfers the window value to the string.
119
120\membersection{wxTextValidator::Validate}\label{wxtextvalidatorvalidate}
121
122\func{virtual bool}{Validate}{\param{wxWindow*}{ parent}}
123
124Validates the window contents against the include or exclude lists, depending
125on the validator style.
126