]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/valtext.tex
remove C++ comment
[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
954b8ae6
JS
13\wxheading{Include files}
14
15<wx/valtext.h>
16
a7af285d
VZ
17\wxheading{Library}
18
19\helpref{wxCore}{librarieslist}
20
a660d684
KB
21\wxheading{See also}
22
76e1c2de 23\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator},
89c684ef 24\helpref{wxGenericValidator}{wxgenericvalidator}
a660d684
KB
25
26\latexignore{\rtfignore{\wxheading{Members}}}
27
15d83f72 28\membersection{wxTextValidator::wxTextValidator}\label{wxtextvalidatorctor}
a660d684
KB
29
30\func{}{wxTextValidator}{\param{const wxTextValidator\&}{ validator}}
31
32Copy constructor.
33
eaaa6a06 34\func{}{wxTextValidator}{\param{long}{ style = wxFILTER\_NONE}, \param{wxString* }{valPtr = NULL}}
a660d684
KB
35
36Constructor, taking a style and optional pointer to a wxString variable.
37
38\wxheading{Parameters}
39
40\docparam{style}{A bitlist of flags, which can be:
41
42\twocolwidtha{5cm}
43\begin{twocollist}
44\twocolitem{{\bf wxFILTER\_NONE}}{No filtering takes place.}
45\twocolitem{{\bf wxFILTER\_ASCII}}{Non-ASCII characters are filtered out.}
46\twocolitem{{\bf wxFILTER\_ALPHA}}{Non-alpha characters are filtered out.}
47\twocolitem{{\bf wxFILTER\_ALPHANUMERIC}}{Non-alphanumeric characters are filtered out.}
48\twocolitem{{\bf wxFILTER\_NUMERIC}}{Non-numeric characters are filtered out.}
49\twocolitem{{\bf wxFILTER\_INCLUDE\_LIST}}{Use an include list. The validator
8161ba08 50checks if the user input is on the list, complaining if not. See
f94a790d 51\helpref{wxTextValidator::SetIncludes}{wxtextvalidatorsetincludes}.}
a660d684 52\twocolitem{{\bf wxFILTER\_EXCLUDE\_LIST}}{Use an exclude list. The validator
8161ba08 53checks if the user input is on the list, complaining if it is. See
f94a790d 54\helpref{wxTextValidator::SetExcludes}{wxtextvalidatorsetexcludes}.}
aaae8296 55\twocolitem{{\bf wxFILTER\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
8161ba08 56checks if each input character is in the list (one character per list element), complaining if not.
f94a790d 57See \helpref{wxTextValidator::SetIncludes}{wxtextvalidatorsetincludes}.}
387ebd3e 58\twocolitem{{\bf wxFILTER\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
8161ba08 59checks if each input character is in the list (one character per list element), complaining if it is.
f94a790d 60See \helpref{wxTextValidator::SetExcludes}{wxtextvalidatorsetexcludes}.}
a660d684
KB
61\end{twocollist}
62}
63
64\docparam{valPtr}{A pointer to a wxString variable that contains the value. This variable
65should have a lifetime equal to or longer than the validator lifetime (which is usually
cc81d32f 66determined by the lifetime of the window). % If NULL, the validator uses its own internal storage for the value. NOT true
2b5f62a0 67}
a660d684 68
a660d684
KB
69\membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
70
89c684ef 71\constfunc{virtual wxValidator*}{Clone}{\void}
a660d684
KB
72
73Clones the text validator using the copy constructor.
74
f94a790d 75\membersection{wxTextValidator::GetExcludes}\label{wxtextvalidatorgetexcludes}
a660d684 76
f94a790d 77\constfunc{wxArrayString\&}{GetExcludes}{\void}
a660d684
KB
78
79Returns a reference to the exclude list (the list of invalid values).
80
f94a790d 81\membersection{wxTextValidator::GetIncludes}\label{wxtextvalidatorgetincludes}
a660d684 82
f94a790d 83\constfunc{wxArrayString\&}{GetIncludes}{\void}
a660d684
KB
84
85Returns a reference to the include list (the list of valid values).
86
87\membersection{wxTextValidator::GetStyle}\label{wxtextvalidatorgetstyle}
88
89\constfunc{long}{GetStyle}{\void}
90
91Returns the validator style.
92
93\membersection{wxTextValidator::OnChar}\label{wxtextvalidatoronchar}
94
95\func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
96
97Receives character input from the window and filters it according to the
98current validator style.
99
f94a790d 100\membersection{wxTextValidator::SetExcludes}\label{wxtextvalidatorsetexcludes}
a660d684 101
f94a790d 102\func{void}{SetExcludes}{\param{const wxArrayString\&}{ stringList}}
a660d684
KB
103
104Sets the exclude list (invalid values for the user input).
105
f94a790d 106\membersection{wxTextValidator::SetIncludes}\label{wxtextvalidatorsetincludes}
a660d684 107
f94a790d 108\func{void}{SetIncludes}{\param{const wxArrayString\&}{ stringList}}
a660d684
KB
109
110Sets the include list (valid values for the user input).
111
112\membersection{wxTextValidator::SetStyle}\label{wxtextvalidatorsetstyle}
113
114\func{void}{SetStyle}{\param{long}{ style}}
115
116Sets the validator style.
117
118\membersection{wxTextValidator::TransferFromWindow}\label{wxtextvalidatortransferfromwindow}
119
76e1c2de 120\func{virtual bool}{TransferFromWindow}{}
a660d684 121
b853ebf6 122Transfers the value in the text control to the string.
a660d684
KB
123
124\membersection{wxTextValidator::TransferToWindow}\label{wxtextvalidatortransfertowindow}
125
76e1c2de 126\func{virtual bool}{TransferToWindow}{}
a660d684 127
b853ebf6 128Transfers the string value to the text control.
a660d684
KB
129
130\membersection{wxTextValidator::Validate}\label{wxtextvalidatorvalidate}
131
132\func{virtual bool}{Validate}{\param{wxWindow*}{ parent}}
133
134Validates the window contents against the include or exclude lists, depending
135on the validator style.
136