]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/valtext.tex
* Stream doc update.
[wxWidgets.git] / docs / latex / wx / valtext.tex
1 \section{\class{wxTextValidator}}\label{wxtextvalidator}
2
3 wxTextValidator validates text controls, providing a variety of filtering behaviours.
4
5 For 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
15 \helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator}
16
17 \latexignore{\rtfignore{\wxheading{Members}}}
18
19 \membersection{wxTextValidator::wxTextValidator}\label{wxtextvalidatorconstr}
20
21 \func{}{wxTextValidator}{\param{const wxTextValidator\&}{ validator}}
22
23 Copy constructor.
24
25 \func{}{wxTextValidator}{\param{long}{ style = wxFILTER\_NONE}, \param{wxString* }{valPtr = NULL}}
26
27 Constructor, taking a style and optional pointer to a wxString variable.
28
29 \wxheading{Parameters}
30
31 \docparam{style}{A bitlist of flags, which can be:
32
33 \twocolwidtha{5cm}
34 \begin{twocollist}
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.}
44 \end{twocollist}
45 }
46
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.}
51
52 \membersection{wxTextValidator::\destruct{wxTextValidator}}
53
54 \func{}{\destruct{wxTextValidator}}{\void}
55
56 Destructor.
57
58 \membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
59
60 \constfunc{virtual wxTextValidator*}{Clone}{\void}
61
62 Clones the text validator using the copy constructor.
63
64 \membersection{wxTextValidator::GetExcludeList}\label{wxtextvalidatorgetexcludelist}
65
66 \constfunc{wxStringList\&}{GetExcludeList}{\void}
67
68 Returns a reference to the exclude list (the list of invalid values).
69
70 \membersection{wxTextValidator::GetIncludeList}\label{wxtextvalidatorgetincludelist}
71
72 \constfunc{wxStringList\&}{GetIncludeList}{\void}
73
74 Returns a reference to the include list (the list of valid values).
75
76 \membersection{wxTextValidator::GetStyle}\label{wxtextvalidatorgetstyle}
77
78 \constfunc{long}{GetStyle}{\void}
79
80 Returns the validator style.
81
82 \membersection{wxTextValidator::OnChar}\label{wxtextvalidatoronchar}
83
84 \func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
85
86 Receives character input from the window and filters it according to the
87 current validator style.
88
89 \membersection{wxTextValidator::SetExcludeList}\label{wxtextvalidatorsetexcludelist}
90
91 \func{void}{SetExcludeList}{\param{const wxStringList\&}{ stringList}}
92
93 Sets the exclude list (invalid values for the user input).
94
95 \membersection{wxTextValidator::SetIncludeList}\label{wxtextvalidatorsetincludelist}
96
97 \func{void}{SetIncludeList}{\param{const wxStringList\&}{ stringList}}
98
99 Sets the include list (valid values for the user input).
100
101 \membersection{wxTextValidator::SetStyle}\label{wxtextvalidatorsetstyle}
102
103 \func{void}{SetStyle}{\param{long}{ style}}
104
105 Sets the validator style.
106
107 \membersection{wxTextValidator::TransferFromWindow}\label{wxtextvalidatortransferfromwindow}
108
109 \func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
110
111 Transfers the string value to the window.
112
113 \membersection{wxTextValidator::TransferToWindow}\label{wxtextvalidatortransfertowindow}
114
115 \func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
116
117 Transfers the window value to the string.
118
119 \membersection{wxTextValidator::Validate}\label{wxtextvalidatorvalidate}
120
121 \func{virtual bool}{Validate}{\param{wxWindow*}{ parent}}
122
123 Validates the window contents against the include or exclude lists, depending
124 on the validator style.
125