Page Contents

This Page

DateSelector

class enaml.widgets.date_selector.DateSelector(parent=None, **kwargs)[source]

Bases: enaml.widgets.bounded_date.BoundedDate

A widget to edit a Python datetime.date object.

A DateSelector displays a Python datetime.date using an appropriate toolkit specific control. This is a geometrically smaller control than what is provided by Calendar.

date_format = None

A python date format string to format the date for display. If 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 DateSelector 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_date_selector.QtDateSelector

class enaml.qt.qt_date_selector.QtDateSelector(object_id, parent, session)[source]

Bases: enaml.qt.qt_bounded_date.QtBoundedDate

A Qt implementation of an Enaml DateSelector.

create_widget(parent, tree)[source]

Create the underlying QDateEdit widget.

create(tree)[source]

Create and initialize the underlying widget.

on_action_set_date_format(content)[source]

Handle the ‘set_date_format’ action from the Enaml widget.

on_action_set_calendar_popup(content)[source]

Handle the ‘set_calendar_popup’ action from the Enaml widget.

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.

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.
set_date_format(date_format)[source]

Set the widget’s date format.

Parameters:date_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

Inheritance diagram of enaml.wx.wx_date_selector.WxDateSelector

class enaml.wx.wx_date_selector.WxDateSelector(object_id, parent, session)[source]

Bases: enaml.wx.wx_bounded_date.WxBoundedDate

A Wx implementation of an Enaml DateSelector.

create_widget(parent, tree)[source]

Creates the underlying wx.DatePickerCtrl.

create(tree)[source]

Create and initialize the date selector control.

on_action_set_date_format(content)[source]

Handle the ‘set_date_format’ action from the Enaml widget.

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.
set_date_format(date_format)[source]

Set the widget’s date format.

Parameters:date_format (str) – A Python time formatting string.

Note

Changing the format on wx is not supported. See http://trac.wxwidgets.org/ticket/10988