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