1998-05-20 10:25:30 -04:00
|
|
|
\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}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/valtext.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
1999-09-30 03:13:40 -04:00
|
|
|
\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator},
|
1999-02-07 12:11:44 -05:00
|
|
|
\helpref{wxGenericValidator}{wxgenericvalidator}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxTextValidator::wxTextValidator}\label{wxtextvalidatorconstr}
|
|
|
|
|
|
|
|
\func{}{wxTextValidator}{\param{const wxTextValidator\&}{ validator}}
|
|
|
|
|
|
|
|
Copy constructor.
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{}{wxTextValidator}{\param{long}{ style = wxFILTER\_NONE}, \param{wxString* }{valPtr = NULL}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
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
|
2003-05-06 03:53:46 -04:00
|
|
|
checks if the user input is on the list, complaining if not. See
|
|
|
|
\helpref{wxTextValidator::SetIncludeList}{wxtextvalidatorsetincludelist}.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\twocolitem{{\bf wxFILTER\_EXCLUDE\_LIST}}{Use an exclude list. The validator
|
2003-05-06 03:53:46 -04:00
|
|
|
checks if the user input is on the list, complaining if it is. See
|
|
|
|
\helpref{wxTextValidator::SetExcludeList}{wxtextvalidatorsetexcludelist}.}
|
2002-04-14 07:05:18 -04:00
|
|
|
\twocolitem{{\bf wxFILTER\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
|
2003-05-06 03:53:46 -04:00
|
|
|
checks if each input character is in the list (one character per list element), complaining if not.
|
|
|
|
See \helpref{wxTextValidator::SetIncludeList}{wxtextvalidatorsetincludelist}.}
|
2002-04-17 07:48:11 -04:00
|
|
|
\twocolitem{{\bf wxFILTER\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
|
2003-05-06 03:53:46 -04:00
|
|
|
checks if each input character is in the list (one character per list element), complaining if it is.
|
|
|
|
See \helpref{wxTextValidator::SetExcludeList}{wxtextvalidatorsetexcludelist}.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\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
|
2003-01-17 19:16:34 -05:00
|
|
|
determined by the lifetime of the window). % If NULL, the validator uses its own internal storage for the value. NOT true
|
2002-12-04 09:11:26 -05:00
|
|
|
}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxTextValidator::\destruct{wxTextValidator}}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxTextValidator}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
|
|
|
\membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
|
|
|
|
|
1999-02-07 12:11:44 -05:00
|
|
|
\constfunc{virtual wxValidator*}{Clone}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Clones the text validator using the copy constructor.
|
|
|
|
|
|
|
|
\membersection{wxTextValidator::GetExcludeList}\label{wxtextvalidatorgetexcludelist}
|
|
|
|
|
|
|
|
\constfunc{wxStringList\&}{GetExcludeList}{\void}
|
|
|
|
|
|
|
|
Returns a reference to the exclude list (the list of invalid values).
|
|
|
|
|
|
|
|
\membersection{wxTextValidator::GetIncludeList}\label{wxtextvalidatorgetincludelist}
|
|
|
|
|
|
|
|
\constfunc{wxStringList\&}{GetIncludeList}{\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::SetExcludeList}\label{wxtextvalidatorsetexcludelist}
|
|
|
|
|
|
|
|
\func{void}{SetExcludeList}{\param{const wxStringList\&}{ stringList}}
|
|
|
|
|
|
|
|
Sets the exclude list (invalid values for the user input).
|
|
|
|
|
|
|
|
\membersection{wxTextValidator::SetIncludeList}\label{wxtextvalidatorsetincludelist}
|
|
|
|
|
|
|
|
\func{void}{SetIncludeList}{\param{const wxStringList\&}{ 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}
|
|
|
|
|
1999-09-30 03:13:40 -04:00
|
|
|
\func{virtual bool}{TransferFromWindow}{}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Transfers the string value to the window.
|
|
|
|
|
|
|
|
\membersection{wxTextValidator::TransferToWindow}\label{wxtextvalidatortransfertowindow}
|
|
|
|
|
1999-09-30 03:13:40 -04:00
|
|
|
\func{virtual bool}{TransferToWindow}{}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Transfers the window value to the string.
|
|
|
|
|
|
|
|
\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.
|
|
|
|
|