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__ (self, empty=True)
 Constructor. More...
def Clone (self)
 Standard cloner. More...
def Validate (self, unused)
 Validate the contents of the given text control. More...
def OnChar (self, event)
 Check key events for valid characters. More...
- Public Member Functions inherited from gui.controls.BaseValidator
def __init__ (self)
 Constructor. More...
def TransferToWindow (self)
 Transfer data from validator to window. More...
def TransferFromWindow (self)
 Transfer data from window to validator. More...

Public Attributes


Static Public Attributes

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

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

◆ __init__()

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


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

Member Function Documentation

◆ Clone()

def gui.controls.DecimalValidator.Clone (   self)

Standard cloner.

Every validator must implement the Clone() method.

Reimplemented from gui.controls.BaseValidator.

References gui.controls.DecimalValidator.empty.

◆ OnChar()

def gui.controls.DecimalValidator.OnChar (   self,

Check key events for valid characters.

See also

References gui.controls.DecimalValidator.validCharacters.

◆ Validate()

def gui.controls.DecimalValidator.Validate (   self,

Validate the contents of the given text control.

Reimplemented from gui.controls.BaseValidator.

References gui.controls.DecimalValidator.empty, and gui.controls.DecimalValidator.RE_DecimalPattern.

Member Data Documentation

◆ empty


Allow empty widget (True) or not (False)

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

◆ RE_DecimalPattern

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

Compiled regular expression to match decimal values.

A comma will be used as decimal point.

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

◆ validCharacters

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

Set of valid characters.

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

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