Page Contents

This Page

Field

class enaml.widgets.field.Field(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A single line editable text widget.

text = None

The unicode text to display in the field.

mask = None

The mask to use for text input. TODO - describe and implement this mask

validator = None

The validator to use for this field. If the validator provides a client side validator, then text will only be submitted if it passes that validator.

submit_triggers = None

The list of actions which should cause the client to submit its text to the server for validation and update. The currently supported values are ‘lost_focus’ and ‘return_pressed’.

placeholder = None

The grayed-out text to display if the field is empty and the widget doesn’t have focus. Defaults to the empty string.

echo_mode = None

How to display the text in the field. Valid values are ‘normal’ which displays the text as normal, ‘password’ which displays the text with an obscured character, and ‘silent’ which displays no text at all but still allows input.

max_length = None

The maximum length of the field in characters. The default value is Zero and indicates there is no maximum length.

read_only = None

Whether or not the field is read only. Defaults to False.

hug_width = None

How strongly a component hugs it’s contents’ width. Fields ignore the width hug by default, so they expand freely in width.

snapshot()[source]

Returns the snapshot dict for the field.

bind()[source]

A method called after initialization which allows the widget to bind any event handlers necessary.

on_action_submit_text(content)[source]

Handle the ‘submit_text’ action from the client widget.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_field.QtField

class enaml.qt.qt_field.QtField(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A Qt4 implementation of an Enaml Field.

create_widget(parent, tree)[source]

Creates the underlying QLineEdit widget.

create(tree)[source]

Create and initialize the underlying widget.

on_lost_focus()[source]

The signal handler for ‘lostFocus’ signal.

on_return_pressed()[source]

The signal handler for ‘returnPressed’ signal.

on_action_set_text(content)[source]

Handle the ‘set_text’ action from the Enaml widget.

on_action_set_validator(content)[source]

Handle the ‘set_validator’ action from the Enaml widget.

on_action_set_submit_triggers(content)[source]

Handle the ‘set_submit_triggers’ action from the Enaml widget.

on_action_set_placeholder(content)[source]

Hanlde the ‘set_placeholder’ action from the Enaml widget.

on_action_set_echo_mode(content)[source]

Handle the ‘set_echo_mode’ action from the Enaml widget.

on_action_set_max_length(content)[source]

Handle the ‘set_max_length’ action from the Enaml widget.

on_action_set_read_only(content)[source]

Handle the ‘set_read_only’ action from the Enaml widget.

on_action_invalid_text(content)[source]

Handle the ‘invalid_text’ action from the Enaml widget.

set_text(text)[source]

Set the text in the underlying widget.

set_validator(validator)[source]

Set the validator for the underlying widget.

set_submit_triggers(triggers)[source]

Set the submit triggers for the underlying widget.

set_placeholder(text)[source]

Set the placeholder text of the underlying widget.

set_echo_mode(mode)[source]

Set the echo mode of the underlying widget.

set_max_length(length)[source]

Set the maximum text length in the underlying widget.

set_read_only(read_only)[source]

Set whether or not the widget is read only.

Wx

Inheritance diagram of enaml.wx.wx_field.WxField

class enaml.wx.wx_field.WxField(object_id, parent, session)[source]

Bases: enaml.wx.wx_control.WxControl

A Wx implementation of an Enaml Field.

create_widget(parent, tree)[source]

Creates the underlying wxLineEdit.

create(tree)[source]

Create and initialize the wx field control.

on_lost_focus(event)[source]

The event handler for EVT_KILL_FOCUS event.

on_return_pressed(event)[source]

The event handler for EVT_TEXT_ENTER event.

on_action_set_text(content)[source]

Handle the ‘set_text’ action from the Enaml widget.

on_action_set_validator(content)[source]

Handle the ‘set_validator’ action from the Enaml widget.

on_action_set_submit_triggers(content)[source]

Handle the ‘set_submit_triggers’ action from the Enaml widget.

on_action_set_placeholder(content)[source]

Hanlde the ‘set_placeholder’ action from the Enaml widget.

on_action_set_echo_mode(content)[source]

Handle the ‘set_echo_mode’ action from the Enaml widget.

on_action_set_max_length(content)[source]

Handle the ‘set_max_length’ action from the Enaml widget.

on_action_set_read_only(content)[source]

Handle the ‘set_read_only’ action from the Enaml widget.

on_action_invalid_text(content)[source]

Handle the ‘invalid_text’ action from the Enaml widget.

set_text(text)[source]

Updates the text control with the given unicode text.

set_validator(validator)[source]

Sets the validator for the control.

set_submit_triggers(triggers)[source]

Set the submit triggers for the underlying widget.

set_placeholder(placeholder)[source]

Sets the placeholder text in the widget.

set_echo_mode(echo_mode)[source]

Sets the echo mode of the wiget.

set_max_length(max_length)[source]

Set the max length of the control to max_length. If the max length is <= 0 or > 32767 then the control will be set to hold 32kb of text.

set_read_only(read_only)[source]

Sets the read only state of the widget.