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

Inheritance diagram of enaml.qt.qt_datetime_selector.QtDatetimeSelector

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