1998-05-20 14:25:30 +00: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 20:41:29 +00:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/valtext.h>
|
|
|
|
|
1998-05-20 14:25:30 +00:00
|
|
|
\wxheading{See also}
|
|
|
|
|
1999-09-30 07:13:40 +00:00
|
|
|
\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator},
|
1999-02-07 17:11:44 +00:00
|
|
|
\helpref{wxGenericValidator}{wxgenericvalidator}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-22 10:59:57 +00:00
|
|
|
\membersection{wxTextValidator::wxTextValidator}\label{wxtextvalidatorctor}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
\func{}{wxTextValidator}{\param{const wxTextValidator\&}{ validator}}
|
|
|
|
|
|
|
|
Copy constructor.
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{}{wxTextValidator}{\param{long}{ style = wxFILTER\_NONE}, \param{wxString* }{valPtr = NULL}}
|
1998-05-20 14:25:30 +00: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 07:53:46 +00:00
|
|
|
checks if the user input is on the list, complaining if not. See
|
2005-02-07 23:46:42 +00:00
|
|
|
\helpref{wxTextValidator::SetIncludes}{wxtextvalidatorsetincludes}.}
|
1998-05-20 14:25:30 +00:00
|
|
|
\twocolitem{{\bf wxFILTER\_EXCLUDE\_LIST}}{Use an exclude list. The validator
|
2003-05-06 07:53:46 +00:00
|
|
|
checks if the user input is on the list, complaining if it is. See
|
2005-02-07 23:46:42 +00:00
|
|
|
\helpref{wxTextValidator::SetExcludes}{wxtextvalidatorsetexcludes}.}
|
2002-04-14 11:05:18 +00:00
|
|
|
\twocolitem{{\bf wxFILTER\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
|
2003-05-06 07:53:46 +00:00
|
|
|
checks if each input character is in the list (one character per list element), complaining if not.
|
2005-02-07 23:46:42 +00:00
|
|
|
See \helpref{wxTextValidator::SetIncludes}{wxtextvalidatorsetincludes}.}
|
2002-04-17 11:48:11 +00:00
|
|
|
\twocolitem{{\bf wxFILTER\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
|
2003-05-06 07:53:46 +00:00
|
|
|
checks if each input character is in the list (one character per list element), complaining if it is.
|
2005-02-07 23:46:42 +00:00
|
|
|
See \helpref{wxTextValidator::SetExcludes}{wxtextvalidatorsetexcludes}.}
|
1998-05-20 14:25:30 +00: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-18 00:16:34 +00: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 14:11:26 +00:00
|
|
|
}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
\membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
|
|
|
|
|
1999-02-07 17:11:44 +00:00
|
|
|
\constfunc{virtual wxValidator*}{Clone}{\void}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Clones the text validator using the copy constructor.
|
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\membersection{wxTextValidator::GetExcludes}\label{wxtextvalidatorgetexcludes}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\constfunc{wxArrayString\&}{GetExcludes}{\void}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Returns a reference to the exclude list (the list of invalid values).
|
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\membersection{wxTextValidator::GetIncludes}\label{wxtextvalidatorgetincludes}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\constfunc{wxArrayString\&}{GetIncludes}{\void}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\membersection{wxTextValidator::SetExcludes}\label{wxtextvalidatorsetexcludes}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\func{void}{SetExcludes}{\param{const wxArrayString\&}{ stringList}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Sets the exclude list (invalid values for the user input).
|
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\membersection{wxTextValidator::SetIncludes}\label{wxtextvalidatorsetincludes}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
2005-02-07 23:46:42 +00:00
|
|
|
\func{void}{SetIncludes}{\param{const wxArrayString\&}{ stringList}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
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 07:13:40 +00:00
|
|
|
\func{virtual bool}{TransferFromWindow}{}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
2003-09-24 07:26:55 +00:00
|
|
|
Transfers the value in the text control to the string.
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
\membersection{wxTextValidator::TransferToWindow}\label{wxtextvalidatortransfertowindow}
|
|
|
|
|
1999-09-30 07:13:40 +00:00
|
|
|
\func{virtual bool}{TransferToWindow}{}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
2003-09-24 07:26:55 +00:00
|
|
|
Transfers the string value to the text control.
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|