Package wx :: Package lib :: Package masked :: Module numctrl :: Class NumCtrl
[frames | no frames]

Type NumCtrl

           MaskedEditMixin --+    
                             |    
object --+                   |    
         |                   |    
    Object --+               |    
             |               |    
    EvtHandler --+           |    
                 |           |    
            Window --+       |    
                     |       |    
               Control --+   |    
                         |   |    
                  TextCtrl --+    
                             |    
            BaseMaskedTextCtrl --+
                                 |
         NumCtrlAccessorsMixin --+
                                 |
                                NumCtrl


Masked edit control supporting "native" numeric values, ie. .SetValue(3), for example, and supporting a variety of formatting options, including automatic rounding specifiable precision, grouping and decimal place characters, etc.


Method Summary
  __init__(self, parent, id, value, pos, size, style, validator, name, **kwargs)
  GetAllowNegative(self)
(For regularization of property accessors)
  GetAllowNone(self)
(For regularization of property accessors)
  GetAutoSize(self)
  GetBounds(self)
This function returns a two-tuple (min,max), indicating the current bounds of the control.
  GetDecimalChar(self)
  GetFraction(self, candidate)
Returns the fractional portion of the value as a float.
  GetFractionWidth(self)
  GetGroupChar(self)
  GetGroupDigits(self)
(For regularization of property accessors)
  GetIntegerWidth(self)
  GetLimited(self)
(For regularization of property accessors)
  GetMax(self)
Gets the maximum value of the control.
  GetMin(self)
Gets the lower bound value of the control.
  GetSelectOnEntry(self)
  GetValue(self)
Returns the current numeric value of the control.
  IsGroupingAllowed(self)
  IsInBounds(self, value)
Returns True if no value is specified and the current value of the control falls within the current bounds.
  IsLimited(self)
Returns True if the control is currently limiting the value to fall within the current bounds.
  IsNegativeAllowed(self)
  IsNoneAllowed(self)
  OnTextChange(self, event)
Handles an event indicating that the text control's value has changed, and issue EVT_NUM event.
  SetAllowNegative(self, value)
  SetAllowNone(self, allow_none)
Change the behavior of the validation code, allowing control to have a value of None or not, as appropriate.
  SetAutoSize(self, value)
  SetBounds(self, min, max)
This function is a convenience function for setting the min and max values at the same time.
  SetDecimalChar(self, value)
  SetFractionWidth(self, value)
  SetGroupChar(self, value)
  SetGroupDigits(self, value)
  SetIntegerWidth(self, value)
  SetLimited(self, limited)
If called with a value of True, this function will cause the control to limit the value to fall within the bounds currently specified.
  SetMax(self, max)
Sets the maximum value of the control.
  SetMin(self, min)
Sets the minimum value of the control.
  SetParameters(self, **kwargs)
This function is used to initialize and reconfigure the control.
  SetSelectOnEntry(self, value)
  SetValue(self, value)
Sets the value of the control to the value specified.

Property Summary

Class Variable Summary
dict valid_ctrl_params = {'limited': False, 'autoSize': True,...

Instance Method Details

GetAllowNegative(self)

(For regularization of property accessors)

GetAllowNone(self)

(For regularization of property accessors)

GetBounds(self)

This function returns a two-tuple (min,max), indicating the current bounds of the control. Each value can be None if that bound is not set.

GetFraction(self, candidate=None)

Returns the fractional portion of the value as a float. If there is no fractional portion, the value returned will be 0.0.

GetGroupDigits(self)

(For regularization of property accessors)

GetLimited(self)

(For regularization of property accessors)

GetMax(self)

Gets the maximum value of the control. It will return the current maximum integer, or None if not specified.

GetMin(self)

Gets the lower bound value of the control. It will return None if not specified.

GetValue(self)

Returns the current numeric value of the control.

Overrides:
wx.TextCtrl.GetValue

IsInBounds(self, value=None)

Returns True if no value is specified and the current value of the control falls within the current bounds. This function can also be called with a value to see if that value would fall within the current bounds of the given control.

IsLimited(self)

Returns True if the control is currently limiting the value to fall within the current bounds.

OnTextChange(self, event)

Handles an event indicating that the text control's value has changed, and issue EVT_NUM event. NOTE: using wxTextCtrl.SetValue() to change the control's contents from within a EVT_CHAR handler can cause double text events. So we check for actual changes to the text before passing the events on.

SetAllowNone(self, allow_none)

Change the behavior of the validation code, allowing control to have a value of None or not, as appropriate. If the value of the control is currently None, and allow_none is False, the value of the control will be set to the minimum value of the control, or 0 if no lower bound is set.

SetBounds(self, min=None, max=None)

This function is a convenience function for setting the min and max values at the same time. The function only applies the maximum bound if setting the minimum bound is successful, and returns True only if both operations succeed. NOTE: leaving out an argument will remove the corresponding bound.

SetLimited(self, limited)

If called with a value of True, this function will cause the control to limit the value to fall within the bounds currently specified. If the control's value currently exceeds the bounds, it will then be limited accordingly.

If called with a value of False, this function will disable value limiting, but coloring of out-of-bounds values will still take place if bounds have been set for the control.

SetMax(self, max=None)

Sets the maximum value of the control. If a value of None is provided, then the control will have no explicit maximum value. If the value specified is less than the current minimum value, then the function returns False and the maximum will not change from its current setting. On success, the function returns True.

If successful and the current value is greater than the new upper bound, if the control is limited the value will be automatically adjusted to this maximum value; if not limited, the value in the control will be colored as invalid.

If max > the max value allowed by the width of the control, the function will return False, and the max will not be set.

SetMin(self, min=None)

Sets the minimum value of the control. If a value of None is provided, then the control will have no explicit minimum value. If the value specified is greater than the current maximum value, then the function returns False and the minimum will not change from its current setting. On success, the function returns True.

If successful and the current value is lower than the new lower bound, if the control is limited, the value will be automatically adjusted to the new minimum value; if not limited, the value in the control will be colored as invalid.

If min > the max value allowed by the width of the control, the function will return False, and the min will not be set.

SetParameters(self, **kwargs)

This function is used to initialize and reconfigure the control. See TimeCtrl module overview for available parameters.

SetValue(self, value)

Sets the value of the control to the value specified. The resulting actual value of the control may be altered to conform with the bounds set on the control if limited, or colored if not limited but the value is out-of-bounds. A ValueError exception will be raised if an invalid value is specified.

Overrides:
wx.lib.masked.textctrl.BaseMaskedTextCtrl.SetValue

Class Variable Details

valid_ctrl_params

Type:
dict
Value:
{'allowNegative': True,
 'allowNone': False,
 'autoSize': True,
 'decimalChar': '.',
 'emptyBackgroundColour': 'White',
 'foregroundColour': 'Black',
 'fractionWidth': 0,
 'groupChar': ',',
...                                                                    

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:08:16 2007 http://epydoc.sf.net