1 \section{\class{wxTextValidator
}}\label{wxtextvalidator
}
3 wxTextValidator validates text controls, providing a variety of filtering behaviours.
5 For more information, please see
\helpref{Validator overview
}{validatoroverview
}.
7 \wxheading{Derived from
}
9 \helpref{wxValidator
}{wxvalidator
}\\
10 \helpref{wxEvtHandler
}{wxevthandler
}\\
11 \helpref{wxObject
}{wxobject
}
13 \wxheading{Include files
}
19 \helpref{Validator overview
}{validatoroverview
},
\helpref{wxValidator
}{wxvalidator
},
20 \helpref{wxGenericValidator
}{wxgenericvalidator
}
22 \latexignore{\rtfignore{\wxheading{Members
}}}
24 \membersection{wxTextValidator::wxTextValidator
}\label{wxtextvalidatorctor
}
26 \func{}{wxTextValidator
}{\param{const wxTextValidator\&
}{ validator
}}
30 \func{}{wxTextValidator
}{\param{long
}{ style = wxFILTER
\_NONE},
\param{wxString*
}{valPtr = NULL
}}
32 Constructor, taking a style and optional pointer to a wxString variable.
34 \wxheading{Parameters
}
36 \docparam{style
}{A bitlist of flags, which can be:
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. See
47 \helpref{wxTextValidator::SetIncludeList
}{wxtextvalidatorsetincludelist
}.
}
48 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_LIST}}{Use an exclude list. The validator
49 checks if the user input is on the list, complaining if it is. See
50 \helpref{wxTextValidator::SetExcludeList
}{wxtextvalidatorsetexcludelist
}.
}
51 \twocolitem{{\bf wxFILTER
\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
52 checks if each input character is in the list (one character per list element), complaining if not.
53 See
\helpref{wxTextValidator::SetIncludeList
}{wxtextvalidatorsetincludelist
}.
}
54 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
55 checks if each input character is in the list (one character per list element), complaining if it is.
56 See
\helpref{wxTextValidator::SetExcludeList
}{wxtextvalidatorsetexcludelist
}.
}
60 \docparam{valPtr
}{A pointer to a wxString variable that contains the value. This variable
61 should have a lifetime equal to or longer than the validator lifetime (which is usually
62 determined by the lifetime of the window).
% If NULL, the validator uses its own internal storage for the value. NOT true
65 \membersection{wxTextValidator::
\destruct{wxTextValidator
}}\label{wxtextvalidatordtor
}
67 \func{}{\destruct{wxTextValidator
}}{\void}
71 \membersection{wxTextValidator::Clone
}\label{wxtextvalidatorclone
}
73 \constfunc{virtual wxValidator*
}{Clone
}{\void}
75 Clones the text validator using the copy constructor.
77 \membersection{wxTextValidator::GetExcludeList
}\label{wxtextvalidatorgetexcludelist
}
79 \constfunc{wxStringList\&
}{GetExcludeList
}{\void}
81 Returns a reference to the exclude list (the list of invalid values).
83 \membersection{wxTextValidator::GetIncludeList
}\label{wxtextvalidatorgetincludelist
}
85 \constfunc{wxStringList\&
}{GetIncludeList
}{\void}
87 Returns a reference to the include list (the list of valid values).
89 \membersection{wxTextValidator::GetStyle
}\label{wxtextvalidatorgetstyle
}
91 \constfunc{long
}{GetStyle
}{\void}
93 Returns the validator style.
95 \membersection{wxTextValidator::OnChar
}\label{wxtextvalidatoronchar
}
97 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
99 Receives character input from the window and filters it according to the
100 current validator style.
102 \membersection{wxTextValidator::SetExcludeList
}\label{wxtextvalidatorsetexcludelist
}
104 \func{void
}{SetExcludeList
}{\param{const wxStringList\&
}{ stringList
}}
106 Sets the exclude list (invalid values for the user input).
108 \membersection{wxTextValidator::SetIncludeList
}\label{wxtextvalidatorsetincludelist
}
110 \func{void
}{SetIncludeList
}{\param{const wxStringList\&
}{ stringList
}}
112 Sets the include list (valid values for the user input).
114 \membersection{wxTextValidator::SetStyle
}\label{wxtextvalidatorsetstyle
}
116 \func{void
}{SetStyle
}{\param{long
}{ style
}}
118 Sets the validator style.
120 \membersection{wxTextValidator::TransferFromWindow
}\label{wxtextvalidatortransferfromwindow
}
122 \func{virtual bool
}{TransferFromWindow
}{}
124 Transfers the value in the text control to the string.
126 \membersection{wxTextValidator::TransferToWindow
}\label{wxtextvalidatortransfertowindow
}
128 \func{virtual bool
}{TransferToWindow
}{}
130 Transfers the string value to the text control.
132 \membersection{wxTextValidator::Validate
}\label{wxtextvalidatorvalidate
}
134 \func{virtual bool
}{Validate
}{\param{wxWindow*
}{ parent
}}
136 Validates the window contents against the include or exclude lists, depending
137 on the validator style.