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