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

digraph inheritance260389b33e { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "QtWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.qt.qt_widget.QtWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtObject" -> "QtWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.qt.qt_control.QtControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtConstraintsWidget" -> "QtControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtBoundedDate" [style="setlinewidth(0.5)",URL="#enaml.qt.qt_bounded_date.QtBoundedDate",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtControl" -> "QtBoundedDate" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "QtConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.qt.qt_constraints_widget.QtConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtWidget" -> "QtConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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

digraph inheritance5cfbebe838 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "WxObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "WxBoundedDate" [style="setlinewidth(0.5)",URL="#enaml.wx.wx_bounded_date.WxBoundedDate",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxControl" -> "WxBoundedDate" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.wx.wx_constraints_widget.WxConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxWidget" -> "WxConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.wx.wx_widget.WxWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxObject" -> "WxWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.wx.wx_control.WxControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxConstraintsWidget" -> "WxControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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.