Share and Money Management  0.16
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gui.controls.DecimalValidator Class Reference

Validator to check for valid decimal. More...

Inheritance diagram for gui.controls.DecimalValidator:

Public Member Functions

def __init__
 Constructor.
def Clone
 Standard cloner.
def Validate
 Validate the contents of the given text control.
def OnChar
 Check key events for valid characters.
- Public Member Functions inherited from gui.controls.BaseValidator
def __init__
 Constructor.
def TransferToWindow
 Transfer data from validator to window.
def TransferFromWindow
 Transfer data from window to validator.

Public Attributes

 empty
 Allow empty widget (True) or not (False)

Static Public Attributes

string validCharacters = '1234567890,'
 Set of valid characters.
tuple RE_DecimalPattern = re.compile('\d+,??\d*$')
 Compiled regular expression to match decimal values.

Detailed Description

Validator to check for valid decimal.

The key events will be checked for valid characters as well as the whole input is checked for valid decimal using a regular expression.

Constructor & Destructor Documentation

def gui.controls.DecimalValidator.__init__ (   self,
  empty = True 
)

Constructor.

Parameters
selfThe object instance itself
emptyCheck for empty widgets (see empty)

Member Function Documentation

def gui.controls.DecimalValidator.Clone (   self)

Standard cloner.

Note
Every validator must implement the Clone() method.

Reimplemented from gui.controls.BaseValidator.

References gui.controls.DecimalValidator.empty.

def gui.controls.DecimalValidator.OnChar (   self,
  event 
)

Check key events for valid characters.

See Also
validCharacters

References gui.controls.DecimalValidator.validCharacters.

def gui.controls.DecimalValidator.Validate (   self,
  unused 
)

Validate the contents of the given text control.

Reimplemented from gui.controls.BaseValidator.

References gui.controls.DecimalValidator.empty.

Member Data Documentation

gui.controls.DecimalValidator.empty

Allow empty widget (True) or not (False)

Referenced by gui.controls.DecimalValidator.Clone(), and gui.controls.DecimalValidator.Validate().

tuple gui.controls.DecimalValidator.RE_DecimalPattern = re.compile('\d+,??\d*$')
static

Compiled regular expression to match decimal values.

A comma will be used as decimal point.

string gui.controls.DecimalValidator.validCharacters = '1234567890,'
static

Set of valid characters.

Referenced by gui.controls.DecimalValidator.OnChar().


The documentation for this class was generated from the following file: