]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/valtext.tex
* wxStream doc updates
[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 \helpref{wxGenericValidator}{wxgenericvalidator}
17
18 \latexignore{\rtfignore{\wxheading{Members}}}
19
20 \membersection{wxTextValidator::wxTextValidator}\label{wxtextvalidatorconstr}
21
22 \func{}{wxTextValidator}{\param{const wxTextValidator\&}{ validator}}
23
24 Copy constructor.
25
26 \func{}{wxTextValidator}{\param{long}{ style = wxFILTER\_NONE}, \param{wxString* }{valPtr = NULL}}
27
28 Constructor, 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
42 checks if the user input is on the list, complaining if not.}
43 \twocolitem{{\bf wxFILTER\_EXCLUDE\_LIST}}{Use an exclude list. The validator
44 checks 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
49 should have a lifetime equal to or longer than the validator lifetime (which is usually
50 determined by the lifetime of the window). If NULL, the validator uses its own internal
51 storage for the value.}
52
53 \membersection{wxTextValidator::\destruct{wxTextValidator}}
54
55 \func{}{\destruct{wxTextValidator}}{\void}
56
57 Destructor.
58
59 \membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
60
61 \constfunc{virtual wxValidator*}{Clone}{\void}
62
63 Clones the text validator using the copy constructor.
64
65 \membersection{wxTextValidator::GetExcludeList}\label{wxtextvalidatorgetexcludelist}
66
67 \constfunc{wxStringList\&}{GetExcludeList}{\void}
68
69 Returns 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
75 Returns 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
81 Returns the validator style.
82
83 \membersection{wxTextValidator::OnChar}\label{wxtextvalidatoronchar}
84
85 \func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
86
87 Receives character input from the window and filters it according to the
88 current validator style.
89
90 \membersection{wxTextValidator::SetExcludeList}\label{wxtextvalidatorsetexcludelist}
91
92 \func{void}{SetExcludeList}{\param{const wxStringList\&}{ stringList}}
93
94 Sets 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
100 Sets 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
106 Sets the validator style.
107
108 \membersection{wxTextValidator::TransferFromWindow}\label{wxtextvalidatortransferfromwindow}
109
110 \func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
111
112 Transfers the string value to the window.
113
114 \membersection{wxTextValidator::TransferToWindow}\label{wxtextvalidatortransfertowindow}
115
116 \func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
117
118 Transfers the window value to the string.
119
120 \membersection{wxTextValidator::Validate}\label{wxtextvalidatorvalidate}
121
122 \func{virtual bool}{Validate}{\param{wxWindow*}{ parent}}
123
124 Validates the window contents against the include or exclude lists, depending
125 on the validator style.
126