#include </home/zeitlin/src/wx/github/interface/wx/valnum.h>
wxNumValidator is the common base class for numeric validator classes.
This class is never used directly, but only as a base class for wxIntegerValidator and wxFloatingPointValidator.
T | Type of the values used with this validator. |
Public Types | |
typedef T | ValueType |
Type of the values this validator is used with. | |
Public Member Functions | |
void | SetMin (ValueType min) |
Sets the minimal value accepted by the validator. | |
void | SetMax (ValueType max) |
Sets the maximal value accepted by the validator. | |
void | SetRange (ValueType min, ValueType max) |
Sets both minimal and maximal values accepted by the validator. | |
void | SetStyle (int style) |
Change the validator style. | |
virtual bool | TransferToWindow () |
Override base class method to format the control contents. | |
virtual bool | TransferFromWindow () |
Override base class method to validate the control contents. |
typedef T wxNumValidator< T >::ValueType |
Type of the values this validator is used with.
Reimplemented in wxIntegerValidator< T >, and wxFloatingPointValidator< T >.
void wxNumValidator< T >::SetMax | ( | ValueType | max | ) |
Sets the maximal value accepted by the validator.
This value is inclusive, i.e. the value equal to max is accepted.
void wxNumValidator< T >::SetMin | ( | ValueType | min | ) |
Sets the minimal value accepted by the validator.
This value is inclusive, i.e. the value equal to min is accepted.
void wxNumValidator< T >::SetRange | ( | ValueType | min, |
ValueType | max | ||
) |
void wxNumValidator< T >::SetStyle | ( | int | style | ) |
Change the validator style.
Can be used to change the style of the validator after its creation. The style parameter must be a combination of the values from wxNumValidatorStyle enum.
virtual bool wxNumValidator< T >::TransferFromWindow | ( | ) | [virtual] |
Override base class method to validate the control contents.
This method is called to check the correctness of user input and fill the associated variable with the controls numeric value. It returns false if it is not a number in the configured range or if the control contents is empty for a validator without wxNUM_VAL_ZERO_AS_BLANK style.
It does nothing if there is no associated variable.
Reimplemented from wxValidator.
virtual bool wxNumValidator< T >::TransferToWindow | ( | ) | [virtual] |
Override base class method to format the control contents.
This method is called when the associated window is shown and it fills it with the contents of the associated variable, if any, formatted according to the validator style.
It does nothing if there is no associated variable.
Reimplemented from wxValidator.