validators¶
Various validator classes
Classes:
|
A Validator that only allows the type of characters selected to be entered. |
|
A Validator that only allows numbers and decimal points to be entered. |
Base class for Validators. |
-
class
CharValidator(flag)[source]¶ Bases:
ValidatorBaseA Validator that only allows the type of characters selected to be entered.
The possible flags are:
int-only - only the numbers
0123456789can be entered.float-only - only numbers and decimal points can be entered.
Methods:
Clone()Clones the
CharValidator.OnChar(event)Event handler for text being entered in the control.
Validate(win)Validate the control.
-
Clone()[source]¶ Clones the
CharValidator.
-
class
FloatValidator(flag)[source]¶ Bases:
CharValidatorA Validator that only allows numbers and decimal points to be entered. If a decimal point has already been entered, a second one cannot be entered. The argument flag is used to limit the number of decimal places that can be entered.
Methods:
OnChar(event)Event handler for text being entered in the control.
-
class
ValidatorBase[source]¶ Bases:
ValidatorBase class for Validators.
Methods:
Clone()Clones the
wx.Validator.Transfer data from window to validator.
Transfer data from validator to window.
Resets the control’s background colour.
Set the control’s background colour to pink.
-
Clone()[source]¶ Clones the
wx.Validator.
-
TransferFromWindow()[source]¶ Transfer data from window to validator.
The default implementation returns
False, indicating that an error occurred. We simply returnTrue, as we don’t do any data transfer.- Return type
-