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{wxCore
}{librarieslist
}
23 \helpref{Validator overview
}{validatoroverview
},
\helpref{wxValidator
}{wxvalidator
},
24 \helpref{wxGenericValidator
}{wxgenericvalidator
}
26 \latexignore{\rtfignore{\wxheading{Members
}}}
28 \membersection{wxTextValidator::wxTextValidator
}\label{wxtextvalidatorctor
}
30 \func{}{wxTextValidator
}{\param{const wxTextValidator\&
}{ validator
}}
34 \func{}{wxTextValidator
}{\param{long
}{ style = wxFILTER
\_NONE},
\param{wxString*
}{valPtr = NULL
}}
36 Constructor, taking a style and optional pointer to a wxString variable.
38 \wxheading{Parameters
}
40 \docparam{style
}{A bitlist of flags, which can be:
44 \twocolitem{{\bf wxFILTER
\_NONE}}{No filtering takes place.
}
45 \twocolitem{{\bf wxFILTER
\_ASCII}}{Non-ASCII characters are filtered out.
}
46 \twocolitem{{\bf wxFILTER
\_ALPHA}}{Non-alpha characters are filtered out.
}
47 \twocolitem{{\bf wxFILTER
\_ALPHANUMERIC}}{Non-alphanumeric characters are filtered out.
}
48 \twocolitem{{\bf wxFILTER
\_NUMERIC}}{Non-numeric characters are filtered out.
}
49 \twocolitem{{\bf wxFILTER
\_INCLUDE\_LIST}}{Use an include list. The validator
50 checks if the user input is on the list, complaining if not. See
51 \helpref{wxTextValidator::SetIncludes
}{wxtextvalidatorsetincludes
}.
}
52 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_LIST}}{Use an exclude list. The validator
53 checks if the user input is on the list, complaining if it is. See
54 \helpref{wxTextValidator::SetExcludes
}{wxtextvalidatorsetexcludes
}.
}
55 \twocolitem{{\bf wxFILTER
\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
56 checks if each input character is in the list (one character per list element), complaining if not.
57 See
\helpref{wxTextValidator::SetIncludes
}{wxtextvalidatorsetincludes
}.
}
58 \twocolitem{{\bf wxFILTER
\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
59 checks if each input character is in the list (one character per list element), complaining if it is.
60 See
\helpref{wxTextValidator::SetExcludes
}{wxtextvalidatorsetexcludes
}.
}
64 \docparam{valPtr
}{A pointer to a wxString variable that contains the value. This variable
65 should have a lifetime equal to or longer than the validator lifetime (which is usually
66 determined by the lifetime of the window).
% If NULL, the validator uses its own internal storage for the value. NOT true
69 \membersection{wxTextValidator::Clone
}\label{wxtextvalidatorclone
}
71 \constfunc{virtual wxValidator*
}{Clone
}{\void}
73 Clones the text validator using the copy constructor.
75 \membersection{wxTextValidator::GetExcludes
}\label{wxtextvalidatorgetexcludes
}
77 \constfunc{wxArrayString\&
}{GetExcludes
}{\void}
79 Returns a reference to the exclude list (the list of invalid values).
81 \membersection{wxTextValidator::GetIncludes
}\label{wxtextvalidatorgetincludes
}
83 \constfunc{wxArrayString\&
}{GetIncludes
}{\void}
85 Returns a reference to the include list (the list of valid values).
87 \membersection{wxTextValidator::GetStyle
}\label{wxtextvalidatorgetstyle
}
89 \constfunc{long
}{GetStyle
}{\void}
91 Returns the validator style.
93 \membersection{wxTextValidator::OnChar
}\label{wxtextvalidatoronchar
}
95 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
97 Receives character input from the window and filters it according to the
98 current validator style.
100 \membersection{wxTextValidator::SetExcludes
}\label{wxtextvalidatorsetexcludes
}
102 \func{void
}{SetExcludes
}{\param{const wxArrayString\&
}{ stringList
}}
104 Sets the exclude list (invalid values for the user input).
106 \membersection{wxTextValidator::SetIncludes
}\label{wxtextvalidatorsetincludes
}
108 \func{void
}{SetIncludes
}{\param{const wxArrayString\&
}{ stringList
}}
110 Sets the include list (valid values for the user input).
112 \membersection{wxTextValidator::SetStyle
}\label{wxtextvalidatorsetstyle
}
114 \func{void
}{SetStyle
}{\param{long
}{ style
}}
116 Sets the validator style.
118 \membersection{wxTextValidator::TransferFromWindow
}\label{wxtextvalidatortransferfromwindow
}
120 \func{virtual bool
}{TransferFromWindow
}{}
122 Transfers the value in the text control to the string.
124 \membersection{wxTextValidator::TransferToWindow
}\label{wxtextvalidatortransfertowindow
}
126 \func{virtual bool
}{TransferToWindow
}{}
128 Transfers the string value to the text control.
130 \membersection{wxTextValidator::Validate
}\label{wxtextvalidatorvalidate
}
132 \func{virtual bool
}{Validate
}{\param{wxWindow*
}{ parent
}}
134 Validates the window contents against the include or exclude lists, depending
135 on the validator style.