A single line editable text widget.
- class enaml.widgets.field.Field(parent=None, **kwargs)
A single line editable text widget.
The unicode text to display in the field.
The mask to use for text input http://qt-project.org/doc/qt-4.8/qlineedit.html#inputMask-prop
The summary of the mask grammar is as follows: A ASCII alphabetic character required. A-Z, a-z. a ASCII alphabetic character permitted but not required. N ASCII alphanumeric character required. A-Z, a-z, 0-9. n ASCII alphanumeric character permitted but not required. X Any character required. x Any character permitted but not required. 9 ASCII digit required. 0-9. 0 ASCII digit permitted but not required. D ASCII digit required. 1-9. d ASCII digit permitted but not required (1-9). # ASCII digit or plus/minus sign permitted but not required. H Hexadecimal character required. A-F, a-f, 0-9. h Hexadecimal character permitted but not required. B Binary character required. 0-1. b Binary character permitted but not required. > All following alphabetic characters are uppercased. < All following alphabetic characters are lowercased. ! Switch off case conversion. Use to escape the special characters listed above to use them as separators.
The mask consists of a string of mask characters and separators, optionally followed by a semicolon and the character used for blanks Eg: 9 digit phone number: (999) 999-9999;_
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.
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’, ‘return_pressed’, and ‘auto_sync’. The ‘auto_sync’ mode will attempt to validate and synchronize the text when the user stops typing.
Time in ms after which the client submit its text to the server for validation and update when the user stop typing. This is used only when the ‘auto_sync’ mode is part of the submit_triggers.
The grayed-out text to display if the field is empty and the widget doesn’t have focus. Defaults to the empty string.
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.
The maximum length of the field in characters. The default value is Zero and indicates there is no maximum length.
Whether or not the field is read only. Defaults to False.
Alignment for the text inside the field. Defaults to ‘left’.
How strongly a component hugs it’s contents’ width. Fields ignore the width hug by default, so they expand freely in width.
A reference to the ProxyField object.
Get the text stored in the field control.
Depending on the state of the field, this text may be different than that stored in the ‘text’ attribute.
result – The unicode text stored in the field.
- Return type
An event fired when an object’s proxy is activated. It is triggered once during the object lifetime, at the end of the activate_proxy method.
The background color of the widget.
An event fired when an object has been destroyed. It is triggered once during the object lifetime, just before the object is removed from the tree structure.
Whether or not the widget is enabled.
An event fired when an object is initialized. It is triggered once during the object lifetime, at the end of the initialize method.
Export the ‘name’ attribute as a declarative member.
The style class to which this item belongs. Multiple classes can be separated with whitespace. An empty string indicates the widget does not belong to any style class.