enaml.layout.dock_layout
Classes
A layout object for defining a dock area layout. |
|
A layout object for defining a dock bar layout. |
|
The layout object for defining toplevel dock layouts. |
|
A sentinel base class for defining dock layout operations. |
|
A node visitor which validates a layout. |
|
A custom user warning for use with dock layouts. |
|
A layout operation which extends an item in a dock bar. |
|
A layout operation which creates a new floating dock area. |
|
A layout operation which creates a floating dock item. |
|
A split layout which defaults to 'horizonal' orientation. |
|
A layout operation which inserts an item into a layout. |
|
A layout operation which inserts an item into an area border. |
|
A layout operation which inserts an item into a dock bar. |
|
A layout operation which inserts a tab into a tab group. |
|
A layout object for defining an item layout. |
|
A base class for defining layout nodes. |
|
A layout operation which will remove an item from the layout. |
|
A layout operation which retracts an item into a dock bar. |
|
A layout object for defining split dock layouts. |
|
A layout object for defining tabbed dock layouts. |
|
A split layout which defaults to 'vertical' orientation. |
- class enaml.layout.dock_layout.AreaLayout(item=None, **kwargs)[source]
Bases:
LayoutNode
A layout object for defining a dock area layout.
- item
The main layout item to include in the area layout.
- dock_bars
The dock bar layouts to include in the area layout.
- floating
Whether or not the area is floating. A DockLayout should have at most one non-floating area layout.
- geometry
The geometry to apply to the area. This is expressed in desktop coordinates and only applies if the area is floating.
- linked
Whether or not the area is linked with its floating neighbors. This only has an effect if the area is a floating.
- maximized
Whether or not the area is maximized. This only has an effect if the area is a floating.
- class enaml.layout.dock_layout.DockBarLayout(*items, **kwargs)[source]
Bases:
LayoutNode
A layout object for defining a dock bar layout.
- position
The position of the tool bar in its area. Only one tool bar may occupy a given position at any one time.
- items
The list of item layouts to include in the tab layout.
- class enaml.layout.dock_layout.DockLayout(*items, **kwargs)[source]
Bases:
LayoutNode
The layout object for defining toplevel dock layouts.
- items
The layout items to include in the dock layout.
- class enaml.layout.dock_layout.DockLayoutOp[source]
Bases:
Atom
A sentinel base class for defining dock layout operations.
- class enaml.layout.dock_layout.DockLayoutValidator(available)[source]
Bases:
NodeVisitor
A node visitor which validates a layout.
If an irregularity or invalid condition is found in the layout, a warning is emitted. Such conditions can result in undefined layout behavior.
- class enaml.layout.dock_layout.DockLayoutWarning[source]
Bases:
UserWarning
A custom user warning for use with dock layouts.
- __weakref__
list of weak references to the object
- class enaml.layout.dock_layout.ExtendItem[source]
Bases:
DockLayoutOp
A layout operation which extends an item in a dock bar.
This layout operation will cause the named item to be extended to from its dock bar. If the item does not exist in a dock bar, this operation is a no-op.
- item
The name of the dock item to extend from its dock bar.
- class enaml.layout.dock_layout.FloatArea[source]
Bases:
DockLayoutOp
A layout operation which creates a new floating dock area.
This layout operation will create a new floating dock area using the given area layout specification.
- area
The area layout to use when building the new dock area.
- class enaml.layout.dock_layout.FloatItem[source]
Bases:
DockLayoutOp
A layout operation which creates a floating dock item.
This operation will remove an item from the current layout and insert convert it into a floating item. If the item does not exist, the operation is a no-op.
- item
The item layout to use when configuring the floating item.
- class enaml.layout.dock_layout.HSplitLayout(*items, **kwargs)[source]
Bases:
SplitLayout
A split layout which defaults to ‘horizonal’ orientation.
- class enaml.layout.dock_layout.InsertItem[source]
Bases:
DockLayoutOp
A layout operation which inserts an item into a layout.
This operation will remove an item from the current layout and insert it next to a target item. If the item does not exist, the operation is a no-op.
If the target -
- is a normally docked item
The item will be inserted as a new split item.
- is docked in a tab group
The item will be inserted as a neighbor of the tab group.
- is docked in a dock bar
The item will be appended to the dock bar.
- is a floating dock item
A new dock area will be created and the item will be inserted as a new split item.
- does not exist
The item is inserted into the border of the primary dock area.
- item
The name of the dock item to insert into the layout.
- target
The name of the dock item to use as the target location.
- position
The position relative to the target at which to insert the item.
- class enaml.layout.dock_layout.InsertBorderItem[source]
Bases:
DockLayoutOp
A layout operation which inserts an item into an area border.
This operation will remove an item from the current layout and insert it into the border of a dock area. If the item does not exist, the operation is a no-op.
If the target -
- is a normally docked item
The item is inserted into the border of the dock area containing the target.
- is docked in a tab group
The item is inserted into the border of the dock area containing the tab group.
- is docked in a dock bar
The item is inserted into the border of the dock area containing the dock bar.
- is a floating dock item
A new dock area will be created and the item will be inserted into the border of the new dock area.
- does not exist
The item is inserted into the border of the primary dock area.
- item
The name of the dock item to insert into the layout.
- target
The name of the dock item to use as the target location.
- position
The border position at which to insert the item.
- class enaml.layout.dock_layout.InsertDockBarItem[source]
Bases:
DockLayoutOp
A layout operation which inserts an item into a dock bar.
This operation will remove an item from the current layout and insert it into a dock bar in a dock area. If the item does not exist, the operation is a no-op.
If the target -
- is a normally docked item
The item is inserted into the dock bar of the dock area containing the target.
- is docked in a tab group
The item is inserted into the dock bar of the dock area containing the tab group.
- is docked in a dock bar
The item is inserted into the dock bar of the dock area containing the dock bar.
- is a floating dock item
A new dock area will be created and the item will be inserted into the dock bar of the new dock area.
- does not exist
The item is inserted into the dock bar of the primary dock area.
- item
The name of the dock item to insert into the layout.
- target
The name of the dock item to use as the target location.
- position
The dock bar position at which to insert the item.
- index
The index at which to insert the dock bar item.
- class enaml.layout.dock_layout.InsertTab[source]
Bases:
DockLayoutOp
A layout operation which inserts a tab into a tab group.
This operation will remove an item from the current layout and insert it into a tab group in a dock area. If the item does not exist, the operation is a no-op.
If the target -
- is a normally docked item
The target and item will be merged into a new tab group using the default tab position.
- is docked in a tab group
The item will be inserted into the tab group.
- is docked in a dock bar
The item will be appended to the dock bar.
- is a floating dock item
A new dock area will be created and the target and item will be merged into a new tab group.
- does not exist
The item is inserted into the left border of the primary dock area.
- item
The name of the dock item to insert into the tab group.
- target
The name of an existing dock item in the tab group of interest.
- index
The index at which to insert the dock item.
- tab_position
The position of the tabs for a newly created tab group.
- class enaml.layout.dock_layout.ItemLayout(name, **kwargs)[source]
Bases:
LayoutNode
A layout object for defining an item layout.
- name
The name of the DockItem to which this layout item applies.
- floating
Whether or not the item is floating. An ItemLayout defined as a toplevel item in a DockLayout should be marked as floating.
- geometry
The geometry to apply to the item. This is expressed in desktop coordinates and only applies if the item is floating.
- linked
Whether or not the item is linked with its floating neighbors. This value will only have an effect if the item is floating.
- maximized
Whether or not the item is maximized. This value will only have effect if the item is floating or docked in a SplitLayout.
- class enaml.layout.dock_layout.LayoutNode[source]
Bases:
Atom
A base class for defining layout nodes.
This class provides basic traversal functionality.
- children()[source]
Get the children of the node.
- Returns:
result – The list of LayoutNode children of the node. The default implementation returns an empty list.
- Return type:
- traverse(depth_first=False)[source]
Yield all of the nodes in the layout, from this node down.
- Parameters:
depth_first (bool, optional) – If True, yield the nodes in depth first order. If False, yield the nodes in breadth first order. Defaults to False.
- Returns:
result – A generator which yields 2-tuples of (parent, node) for all nodes in the layout.
- Return type:
generator
- find(kind)[source]
Find the first layout node of the given kind.
- Parameters:
kind (type or tuple of types) – The type of the layout node to find.
- Returns:
result – The first layout node of the given type in the tree. The search is performed breadth-first.
- Return type:
LayoutNode or None
- class enaml.layout.dock_layout.RemoveItem[source]
Bases:
DockLayoutOp
A layout operation which will remove an item from the layout.
This layout operation will remove the dock item from the layout and hide it. It can be added back to layout later with one of the other layout operations.
- item
The name of the dock item to remove from the layout.
- class enaml.layout.dock_layout.RetractItem[source]
Bases:
DockLayoutOp
A layout operation which retracts an item into a dock bar.
This layout operation will cause the named item to be retracted into its dock bar. If the item does not exist in a dock bar, this operation is a no-op.
- item
The name of the dock item to retract into its dock bar.
- class enaml.layout.dock_layout.SplitLayout(*items, **kwargs)[source]
Bases:
LayoutNode
A layout object for defining split dock layouts.
- orientation
The orientation of the split layout.
- sizes
The default sizes to apply to the items in the splitter. If provided, the length must be equal to the number of items.
- items
This list of split layout items to include in the split layout.
- class enaml.layout.dock_layout.TabLayout(*items, **kwargs)[source]
Bases:
LayoutNode
A layout object for defining tabbed dock layouts.
- tab_position
The position of the tabs in the tab layout.
- index
The index of the currently selected tab.
- maximized
Whether or not the tab layout is maximized.
- items
The list of item layouts to include in the tab layout.
- class enaml.layout.dock_layout.VSplitLayout(*items, **kwargs)[source]
Bases:
SplitLayout
A split layout which defaults to ‘vertical’ orientation.