Page Contents

This Page

ToolBar

class enaml.widgets.tool_bar.ToolBar(parent=None, **kwargs)[source]

Bases: enaml.widgets.constraints_widget.ConstraintsWidget

A widget which displays a row of tool buttons.

A ToolBar is typically used as a child of a MainWindow where it can be dragged and docked in various locations in the same fashion as a DockPane. However, a ToolBar can also be used as the child of a Container and layed out with constraints, though in this case it will lose its ability to be docked.

movable = None

Whether or not the tool bar is movable by the user. This value only has meaning if the tool bar is the child of a MainWindow.

floatable = None

Whether or not the tool bar can be floated as a separate window. This value only has meaning if the tool bar is the child of a MainWindow.

floating = None

A boolean indicating whether or not the tool bar is floating. This value only has meaning if the tool bar is the child of a MainWindow.

dock_area = None

The dock area in the MainWindow where the tool bar is docked. This value only has meaning if the tool bar is the child of a MainWindow.

allowed_dock_areas = None

The areas in the MainWindow where the tool bar can be docked by the user. This value only has meaning if the tool bar is the child of a MainWindow.

orientation = None

The orientation of the toolbar. This only has meaning when the toolbar is not a child of a MainWindow and is used as part of a constraints based layout.

items = None

A read only property which returns the tool bar’s items: ActionGroup | Action

hug_width = None

Hug width is redefined as a property to be computed based on the orientation of the tool bar unless overridden by the user.

hug_height = None

Hug height is redefined as a property to be computed based on the orientation of the slider unless overridden by the user.

snapshot()[source]

Returns the snapshot dict for the DockPane.

bind()[source]

Bind the change handlers for the ToolBar.

on_action_floated(content)[source]

Handle the ‘floated’ action from the client widget.

on_action_docked(content)[source]

Handle the ‘docked’ action from the client widget.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_tool_bar.QtToolBar

class enaml.qt.qt_tool_bar.QtToolBar(object_id, parent, session)[source]

Bases: enaml.qt.qt_constraints_widget.QtConstraintsWidget

A Qt implementation of an Enaml ToolBar.

create_widget(parent, tree)[source]

Create the underlying tool bar widget.

create(tree)[source]

Create and initialize the underlying tool bar control.

init_layout()[source]

Initialize the layout for the toolbar.

child_removed(child)[source]

Handle the child removed event for a QtToolBar.

child_added(child)[source]

Handle the child added event for a QtToolBar.

find_next_action(child)[source]

Get the QAction instance which comes immediately after the actions of the given child.

Parameters:child (QtActionGroup, or QtAction) – The child of interest.
Returns:result (QAction or None) – The QAction which comes immediately after the actions of the given child, or None if no actions follow the child.
on_floated()[source]

The signal handler for the ‘floated’ signal.

on_docked(area)[source]

The signal handler for the ‘docked’ signal.

on_action_set_movable(content)[source]

Handle the ‘set_movable’ action from the Enaml widget.

on_action_set_floatable(content)[source]

Handle the ‘set_floatable’ action from the Enaml widget.

on_action_set_floating(content)[source]

Handle the ‘set_floating’ action from the Enaml widget.

on_action_set_dock_area(content)[source]

Handle the ‘set_dock_area’ action from the Enaml widget.

on_action_set_allowed_dock_areas(content)[source]

Handle the ‘set_allowed_dock_areas’ action from the Enaml widget.

on_action_set_orientation(content)[source]

Handle the ‘set_orientation’ action from the Enaml widget.

set_movable(movable)[source]

Set the movable state on the underlying widget.

set_floatable(floatable)[source]

Set the floatable state on the underlying widget.

set_floating(floating)[source]

Set the floating staet on the underlying widget.

set_dock_area(dock_area)[source]

Set the dock area on the underyling widget.

set_allowed_dock_areas(dock_areas)[source]

Set the allowed dock areas on the underlying widget.

set_orientation(orientation)[source]

Set the orientation of the underlying widget.

Wx

Inheritance diagram of enaml.wx.wx_tool_bar.WxToolBar

class enaml.wx.wx_tool_bar.WxToolBar(object_id, parent, session)[source]

Bases: enaml.wx.wx_constraints_widget.WxConstraintsWidget

A Wx implementation of an Enaml ToolBar.

create_widget(parent, tree)[source]

Create the underlying tool bar widget.

create(tree)[source]

Create and initialize the underlying tool bar control.

init_layout()[source]

Initialize the layout for the toolbar.

child_removed(child)[source]

Handle the child removed event for a WxToolBar.

child_added(child)[source]

Handle the child added event for a WxToolBar.

find_next_action(child)[source]

Get the wxAction instance which comes immediately after the actions of the given child.

Parameters:child (WxActionGroup, or WxAction) – The child of interest.
Returns:result (wxAction or None) – The wxAction which comes immediately after the actions of the given child, or None if no actions follow the child.
on_action_set_movable(content)[source]

Handle the ‘set_movable’ action from the Enaml widget.

on_action_set_floatable(content)[source]

Handle the ‘set_floatable’ action from the Enaml widget.

on_action_set_floating(content)[source]

Handle the ‘set_floating’ action from the Enaml widget.

on_action_set_dock_area(content)[source]

Handle the ‘set_dock_area’ action from the Enaml widget.

on_action_set_allowed_dock_areas(content)[source]

Handle the ‘set_allowed_dock_areas’ action from the Enaml widget.

set_visible(visible)[source]

Overridden parent class visibility setter which properly handles the visibility of the tool bar.

set_orientation(orientation)[source]

Set the orientation of the underlying widget.

set_movable(movable)[source]

Set the movable state on the underlying widget.

set_floatable(floatable)[source]

Set the floatable state on the underlying widget.

set_floating(floating)[source]

Set the floating staet on the underlying widget.

set_dock_area(dock_area)[source]

Set the dock area on the underyling widget.

set_allowed_dock_areas(dock_areas)[source]

Set the allowed dock areas on the underlying widget.