Page Contents

This Page

BoundedDate

class enaml.widgets.bounded_date.BoundedDate(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A base class for components which edit a Python datetime.date object bounded between minimum and maximum values.

This class is not meant to be used directly.

minimum = None

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

maximum = None

The maximum date available in the date edit. If not defined then the default value is December 31, 7999.

date = None

The currently selected date. Default is the current date. 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_date_changed(content)[source]

Handle the ‘date_changed’ action from the UI control.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_bounded_date.QtBoundedDate

class enaml.qt.qt_bounded_date.QtBoundedDate(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A base class for implementing Qt-Enaml date widgets.

create(tree)[source]

Create and initialize the underyling date widget.

on_action_set_date(content)[source]

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

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

This will convert the QDate to iso format and send the Enaml widget the ‘date_changed’ action.

get_date()[source]

Return the current date in the control.

Returns:result (QDate) – The current control date as a QDate object.
set_date(date)[source]

Set the widget’s current date.

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

Parameters:date (QDate) – The QDate object to use for setting the date.
set_max_date(date)[source]

Set the widget’s maximum date.

Parameters:date (QDate) – The QDate object to use for setting the maximum date.
set_min_date(date)[source]

Set the widget’s minimum date.

Parameters:date (QDate) – The QDate object to use for setting the minimum date.

Wx

Inheritance diagram of enaml.wx.wx_bounded_date.WxBoundedDate

class enaml.wx.wx_bounded_date.WxBoundedDate(object_id, parent, session)[source]

Bases: enaml.wx.wx_control.WxControl

A base class for use with Wx widgets implementing behavior for subclasses of BoundedDate.

create(tree)[source]

Create and initialize the bounded date widget.

on_action_set_date(content)[source]

Handle the ‘set_date’ action from the Enaml widget.

on_action_set_minimum(content)[source]

Hanlde the ‘set_minimum’ action from the Enaml widget.

on_action_set_maximum(content)[source]

Handle the ‘set_maximum’ action from the Enaml widget.

on_date_changed(event)[source]

An event handler to connect to the date changed signal of the underlying widget.

This will convert the wxDateTime to iso format and send the Enaml widget the ‘date_changed’ action.

get_date()[source]

Return the current date in the control.

Returns:result (wxDateTime) – The current control date as a wxDateTime object.
set_date(date)[source]

Set the widget’s current date.

Parameters:date (wxDateTime) – The wxDateTime object to use for setting the date.
set_max_date(date)[source]

Set the widget’s maximum date.

Parameters:date (wxDateTime) – The wxDateTime object to use for setting the maximum date.
set_min_date(date)[source]

Set the widget’s minimum date.

Parameters:date (wxDateTime) – The wxDateTime object to use for setting the minimum date.