wxvalidatorwxvalidator is the base class for a family of validator classes that mediate between a class of control, and application data. a validator has three major roles:
validators can be plugged into controls dynamically. to specify a default, 'null' validator, use the symbol wxdefaultvalidator. for more information, please see validator overview. wxpython note: if you wish to create a validator class in wxpython you should derive the class from wxpyvalidator in order to get python-aware capabilities for the various virtual methods. derived from include files <wx/validate.h> see also validator overview, wxtextvalidator, wxgenericvalidator, members
wxvalidator::wxvalidator
wxvalidator::wxvalidatorwxvalidator() constructor.
wxvalidator::~wxvalidator~wxvalidator() destructor.
wxvalidator::clonevirtual wxobject* clone() const all validator classes must implement the clone function, which returns an identical copy of itself. this is because validators are passed to control constructors as references which must be copied. unlike objects such as pens and brushes, it does not make sense to have a reference counting scheme to do this cloning, because all validators should have separate data. this base function returns null.
wxvalidator::getwindowwxwindow* getwindow() const returns the window associated with the validator.
wxvalidator::setbellonerrorvoid setbellonerror(bool doit = true) this functions switches on or turns off the error sound produced by the validators if an invalid key is pressed.
wxvalidator::setwindowvoid setwindow(wxwindow* window) associates a window with the validator.
wxvalidator::transferfromwindowvirtual bool transfertowindow() this overridable function is called when the value in the window must be transferred to the validator. return false if there is a problem.
wxvalidator::transfertowindowvirtual bool transfertowindow() this overridable function is called when the value associated with the validator must be transferred to the window. return false if there is a problem.
wxvalidator::validatevirtual bool validate(wxwindow* parent) this overridable function is called when the value in the associated window must be validated. return false if the value in the window is not valid; you may pop up an error dialog.
|