Page Contents

This Page

BoundedTime

class enaml.widgets.bounded_time.BoundedTime(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A base class for use with widgets that edit a Python datetime.time object bounded between minimum and maximum values. This class is not meant to be used directly.

minimum = None

The minimum time available in the control. If not defined then the default value is midnight.

maximum = None

The maximum time available in the control. If not defined then the default value is the second before midnight.

time = None

The currently selected time. Default is datetime.now().time(). The value is bounded between minimum and maximum.

snapshot()[source]

Return a dictionary which contains all the state necessary to initialize a client widget.

bind()[source]

A method called after initialization which allows the widget to bind any event handlers necessary.

on_action_time_changed(content)[source]

The handler for the ‘time_changed’ action sent from the client widget.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_bounded_time.QtBoundedTime

class enaml.qt.qt_bounded_time.QtBoundedTime(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A base class for implementing Qt-Enaml time widgets.

create(tree)[source]

Create and initialize the underyling time widget.

on_action_set_time(content)[source]

Handle the ‘set_time’ action from the Enaml widget.

on_action_set_minimum(content)[source]

Handle the ‘set_minimum’ action from the Enaml widget.

on_action_set_maximum(content)[source]

Handle the ‘set_maximum’ action from the Enaml widget.

on_time_changed()[source]

A signal handler to connect to the time changed signal of the underlying widget.

This will convert the QTime to iso format and send the Enaml widget the ‘time_changed’ action.

get_time()[source]

Return the current time in the control.

Returns:result (QTime) – The current control time as a QTime object.
set_time(time)[source]

Set the widget’s current time.

Implementations should enter the loopback guard using the key ‘time’ before setting the time.

Parameters:time (QTime) – The QTime object to use for setting the time.
set_max_time(time)[source]

Set the widget’s maximum time.

Parameters:time (QTime) – The QTime object to use for setting the maximum time.
set_min_time(time)[source]

Set the widget’s minimum time.

Parameters:time (QTime) – The QTime object to use for setting the minimum time.

Wx