enable.trait_defs.ui.editor_with_component module¶
-
class
enable.trait_defs.ui.editor_with_component.
Editor
(parent, **traits)[source]¶ Bases:
traitsui.editor.Editor
Base class for PyQt editors for Traits-based UIs.
Adds a menu item to the menu bar being constructed.
Returns whether the action should be defined in the user interface.
-
eval_when
(condition, object, trait)[source]¶ Evaluates a condition within a defined context, and sets a specified object trait based on the result, which is assumed to be a Boolean.
-
get_control_widget
()[source]¶ Get the concrete widget for the control.
Some editors may use a QLayout instead of a Qwidget, which may not be suitable for certain usages (eg. for parenting other widgets).
-
perform
(action, action_event=None)[source]¶ Performs the action described by a specified Action object.
-
set_size_policy
(direction, resizable, springy, stretch)[source]¶ Set the size policy of the editor’s controller.
Based on the “direction” of the group that contains this editor (VGroup or HGroup), set the stretch factor and the resizing policy of the control.
- Parameters
direction (QtGui.QBoxLayout.Direction) – Directionality of the group that contains this editor. Either QtGui.QBoxLayout.Direction.LeftToRight or QtGui.QBoxLayout.Direction.TopToBottom
resizable (bool) – True if control should be resizable in the orientation opposite to the group directionality
springy (bool) – True if control should be resizable in the orientation equal to the group directionality
stretch (int) – Stretch factor used by Qt to distribute the total size to each component.
-
class
enable.trait_defs.ui.editor_with_component.
EditorWithComponent
(parent, **traits)[source]¶ Bases:
traitsui.qt4.editor.Editor
Base class for editors which hold a Component that displays the value.
This is distinct from CompononentEditor in that the value is not the Component.
-
component
= Instance(Component)¶ The component that is created by the UI.
-
dispose
()[source]¶ Disposes of the contents of an editor.
This disconnects any synchronised values and resets references to other objects.
Subclasses may chose to override this method to perform additional clean-up.
-
init
(parent)[source]¶ Create and initialize the underlying toolkit widget.
This method must be overriden by subclasses. Implementations must ensure that the
control
trait is set to an appropriate toolkit object.- Parameters
parent (toolkit control) – The parent toolkit object of the editor’s toolkit objects.
-
window
= Instance(Window)¶ The window that displays the component.
-
-
class
enable.trait_defs.ui.editor_with_component.
EditorWithLabelComponent
(parent, **traits)[source]¶ Bases:
enable.trait_defs.ui.editor_with_component.EditorWithComponent
A class that creates a Label component.
By default it displays the string representation of the value.
-
font
= font_trait()¶ The font to use for the label.
-