Page Contents

This Page

DatetimeSelector

class enaml.widgets.datetime_selector.DatetimeSelector(parent=None, **kwargs)[source]

Bases: enaml.widgets.bounded_datetime.BoundedDatetime

A datetime widget that displays a Python datetime.datetime object using an appropriate toolkit specific control.

datetime_format = None

A python date format string to format the datetime. If None is supplied (or is invalid) the system locale setting is used. This may not be supported by all backends.

calendar_popup = None

Whether to use a calendar popup for selecting the date.

hug_width = None

How strongly to hugs the content width. A DatetimeSelector ignores the width hug by default, so it expands freely in width.

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.

__implements__

alias of __NoInterface__

Backends

Qt

digraph inheritance80eea9b08e { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "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)"]; "QtDatetimeSelector" [style="setlinewidth(0.5)",URL="#enaml.qt.qt_datetime_selector.QtDatetimeSelector",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtBoundedDatetime" -> "QtDatetimeSelector" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtBoundedDatetime" [style="setlinewidth(0.5)",URL="enaml.widgets.bounded_datetime.BoundedDatetime.html#enaml.qt.qt_bounded_datetime.QtBoundedDatetime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtControl" -> "QtBoundedDatetime" [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)"]; "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)"]; "QtObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; }

class enaml.qt.qt_datetime_selector.QtDatetimeSelector(object_id, parent, session)[source]

Bases: enaml.qt.qt_bounded_datetime.QtBoundedDatetime

A Qt implementation of an Enaml DatetimeSelector.

create_widget(parent, tree)[source]

Create the underlying datetime widget.

create(tree)[source]

Create and initialize the underlying widget.

on_action_set_datetime_format(content)[source]

Handle the ‘set_datetime_format’ action from the Enaml widget.

on_action_set_calendar_popup(content)[source]

Handle the ‘set_calendar_popup’ action from the Enaml widget.

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.

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.
set_datetime_format(datetime_format)[source]

Set the widget’s datetime format.

Parameters:datetime_format (str) – A Python time formatting string.
set_calendar_popup(popup)[source]

Set whether a calendar popup is available on the widget.

Parameters:popup (bool) – Whether the calendar popup is enabled.

Wx