Page Contents

This Page

BoundedDatetime

class enaml.widgets.bounded_datetime.BoundedDatetime(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

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

minimum = None

The minimum datetime available in the datetime edit. If not defined then the default value is midnight September 14, 1752.

maximum = None

The maximum datetime available in the datetime edit. If not defined then the default value is the second before midnight December 31, 7999.

datetime = None

The currently selected date. Default is datetime.now(). 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_datetime_changed(content)[source]

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

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_bounded_datetime.QtBoundedDatetime

class enaml.qt.qt_bounded_datetime.QtBoundedDatetime(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A base class for implementing Qt-Enaml datetime widgets.

create(create)[source]

Create and initialize the underlying datetime widget.

on_action_set_datetime(content)[source]

Handle the ‘set_datetime’ 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_datetime_changed()[source]

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

This will convert the QDateTime to iso format and send the Enaml widget the ‘event-changed’ action.

get_datetime()[source]

Return the current datetime in the control.

Returns:result (QDateTime) – The current control datetime as a QDateTime object.
set_datetime(datetime)[source]

Set the widget’s current datetime.

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

Parameters:datetime (QDateTime) – The QDateTime object to use for setting the datetime.
set_max_datetime(datetime)[source]

Set the widget’s maximum datetime.

Parameters:datetime (QDateTime) – The QDateTime object to use for setting the maximum datetime.
set_min_datetime(datetime)[source]

Set the widget’s minimum datetime.

Parameters:datetime (QDateTime) – The QDateTime object to use for setting the minimum datetime.

Wx