.. include:: headings.inc .. currentmodule:: lib.intctrl .. highlight:: python .. _lib.intctrl.IntValidator: ========================================================================================================================================== |phoenix_title| **IntValidator** ========================================================================================================================================== Validator class used with IntCtrl; handles all validation of input prior to changing the value of the underlying wx.TextCtrl. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **IntValidator** .. raw:: html

Inheritance diagram of IntValidator

| |super_classes| Known Superclasses ================================== :class:`PyValidator` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~lib.intctrl.IntValidator.__init__` :meth:`~lib.intctrl.IntValidator.Clone` :meth:`~lib.intctrl.IntValidator.OnChar` Validates keystrokes to make sure the resulting value will a legal :meth:`~lib.intctrl.IntValidator.TransferFromWindow` Transfer data from window to validator. :meth:`~lib.intctrl.IntValidator.TransferToWindow` Transfer data from validator to window. :meth:`~lib.intctrl.IntValidator.Validate` Because each operation on the control is vetted as it's made, ================================================================================ ================================================================================ | |api| Class API =============== .. class:: IntValidator( PyValidator ) Validator class used with IntCtrl; handles all validation of input prior to changing the value of the underlying wx.TextCtrl. .. method:: __init__(self) .. method:: Clone (self) .. method:: OnChar(self, event) Validates keystrokes to make sure the resulting value will a legal value. Erasing the value causes it to be set to 0, with the value selected, so it can be replaced. Similarly, replacing the value with a '-' sign causes the value to become -1, with the value selected. Leading zeros are removed if introduced by selection, and are prevented from being inserted. .. method:: TransferFromWindow(self) Transfer data from window to validator. The default implementation returns False, indicating that an error occurred. We simply return True, as we don't do any data transfer. .. method:: TransferToWindow(self) Transfer data from validator to window. The default implementation returns False, indicating that an error occurred. We simply return True, as we don't do any data transfer. .. method:: Validate(self, window) Because each operation on the control is vetted as it's made, the value of the control is always valid.