Package wx :: Package lib :: Package masked :: Module timectrl :: Class TimeCtrl

[frames | no frames]

## Type TimeCtrl

               MaskedEditMixin --+
                                 |
    object --+                   |
             |                   |
        Object --+               |
                 |               |
        EvtHandler --+           |
                     |           |
                Window --+       |
                         |       |
                   Control --+   |
                             |   |
                      TextCtrl --+
                                 |
                BaseMaskedTextCtrl --+
                                     |
                                    TimeCtrl

Masked control providing several time formats and manipulation of time values.

Method Summary
| `__init__(self, parent, id, value, pos, size, fmt24hr, spinButton, style, validator, name, **kwargs)`
| `__repr__(self)`
| ``BindSpinButton`(self, sb)` This function binds an externally created spin button to the control, so that up/down events from the button automatically change the control.
| ``GetBounds`(self, as_string)` This function returns a two-tuple (min,max), indicating the current bounds of the control.
| `GetFormat(self)`
| ``GetMax`(self, as_string)` Gets the minimum value of the control.
| ``GetMin`(self, as_string)` Gets the minimum value of the control.
| ``GetMxDateTime`(self, value)` Returns the value of the control as an mx.DateTime, with the date portion set to January 1, 1970.
| ``GetValue`(self, as_wxDateTime, as_mxDateTime, as_wxTimeSpan, as_mxDateTimeDelta)` This function returns the value of the display as a string by default, but supports return as a wx.DateTime, mx.DateTime, wx.TimeSpan, or mx.DateTimeDelta, if requested.
| ``GetWxDateTime`(self, value)` This function is the conversion engine for TimeCtrl; it takes one of the following types: time string wxDateTime wxTimeSpan mxDateTime mxDateTimeDelta and converts it to a wx.DateTime that always has Jan 1, 1970 as its date portion, so that range comparisons around values can work using wx.DateTime's built-in comparison function.
| ``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 any current bounds.
| ``IsValid`(self, value)` Can be used to determine if a given value would be a legal and in-bounds value for the control.
| ``SetBounds`(self, min, max)` This function is a convenience function for setting the min and max values at the same time.
| `SetFormat(self, format)`
| ``SetInsertionPoint`(self, pos)` This override records the specified position and associated cell before calling base class' function.
| ``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.
| ``SetMxDateTime`(self, mxdt)` Because SetValue can take an mx.DateTime, (if DateTime is importable), this is now just an alias.
| ``SetParameters`(self, **kwargs)` Function providing access to the parameters governing TimeCtrl display and bounds.
| `SetSelection(self, sel_start, sel_to)`
| ``SetValue`(self, value)` Validating SetValue function for time values: This function will do dynamic type checking on the value argument, and convert wxDateTime, mxDateTime, or 12/24 format time string into the appropriate format string for the control.
| ``SetWxDateTime`(self, wxdt)` Because SetValue can take a wx.DateTime, this is now just an alias.

Property Summary

Class Variable Summary
`dict` | `valid_ctrl_params` = `{'limited': False, 'displaySeconds':...`

Instance Method Details

### BindSpinButton(self, sb)

This function binds an externally created spin button to the control, so that up/down events from the button automatically change the control.

### GetBounds(self, as_string=False)

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.

### GetMax(self, as_string=False)

Gets the minimum value of the control. If None, it will return None. Otherwise it will return the current minimum bound on the control, as a wxDateTime by default, or as a string if as_string argument is True.

### GetMin(self, as_string=False)

Gets the minimum value of the control. If None, it will return None. Otherwise it will return the current minimum bound on the control, as a wxDateTime by default, or as a string if as_string argument is True.

### GetMxDateTime(self, value=None)

Returns the value of the control as an mx.DateTime, with the date portion set to January 1, 1970.

### GetValue(self, as_wxDateTime=False, as_mxDateTime=False, as_wxTimeSpan=False, as_mxDateTimeDelta=False)

This function returns the value of the display as a string by default, but supports return as a wx.DateTime, mx.DateTime, wx.TimeSpan, or mx.DateTimeDelta, if requested. (Evaluated in the order above-- first one wins!)

  Overrides:
    `wx.TextCtrl.GetValue`

### GetWxDateTime(self, value=None)

    This function is the conversion engine for TimeCtrl; it takes
    one of the following types:
        time string
        wxDateTime
        wxTimeSpan
        mxDateTime
        mxDateTimeDelta
    and converts it to a wx.DateTime that always has Jan 1, 1970 as its date
    portion, so that range comparisons around values can work using
    wx.DateTime's built-in comparison function.  If a value is not
    provided to convert, the string value of the control will be used.
    If the value is not one of the accepted types, a ValueError will be
    raised.

### IsInBounds(self, value=None)

Returns True if no value is specified and the current value of the control falls within the current bounds. As the clock is a "circle", both minimum and maximum bounds must be set for a value to ever be considered "out of 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 any current bounds. Note: can be set even if there are no current bounds.

### IsValid(self, value)

Can be used to determine if a given value would be a legal and in-bounds value for the control.

  Overrides:
    `wx.lib.masked.maskededit.MaskedEditMixin.IsValid`

### 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.

### SetInsertionPoint(self, pos)

This override records the specified position and associated cell before calling base class' function. This is necessary to handle the optional spin button, because the insertion point is lost when the focus shifts to the spin button.

  Overrides:
    `wx.TextCtrl.SetInsertionPoint`

### 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 0, 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.

### 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 0 and the minimum will not change from its current setting. On success, the function returns 1.

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.

### SetMxDateTime(self, mxdt)

Because SetValue can take an mx.DateTime, (if DateTime is importable), this is now just an alias.

### SetParameters(self, **kwargs)

Function providing access to the parameters governing TimeCtrl display and bounds.

### SetValue(self, value)

Validating SetValue function for time values: This function will do dynamic type checking on the value argument, and convert wxDateTime, mxDateTime, or 12/24 format time string into the appropriate format string for the control.

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

### SetWxDateTime(self, wxdt)

Because SetValue can take a wx.DateTime, this is now just an alias.

Class Variable Details

### valid_ctrl_params

  Type:
    `dict`
  Value:

        {'displaySeconds': True,
         'format': 'HHMMSS',
         'limited': False,
         'max': None,
         'min': None,
         'oob_color': 'Yellow',
         'useFixedWidthFont': True}

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:11:51 2007 | http://epydoc.sf.net