AbstractSnapLayout class new in Git master
#include <Magnum/Ui/SnapLayout.h>
Base for layouts using SnapLayouter.
A non-owning wrapper of an AbstractUserInterface and SnapLayouter reference, NodeHandle and a LayoutHandle, convertible to an AbstractAnchor to construct widget instances with. The BasicSnapLayout template and the SnapLayout typedef then restrict the type to a concrete user interface instance.
Converting instances of BasicSnapLayout / SnapLayout to BasicSnapLayoutColumn, BasicSnapLayoutRow / SnapLayoutColumn, SnapLayoutRow and other typedefs specialize the layout for concrete placement rules. Equivalent effect can be achieved by calling setChildSnap() and setFlags() / addFlags() / clearFlags() on the unspecialized BasicSnapLayout / SnapLayout.
Derived classes
-
template<class UserInterface>class BasicSnapLayout new in Git master
- Layout using SnapLayouter.
Public static functions
-
static auto child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
LayoutHandle layoutBefore = LayoutHandle::
Null, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout - Create a child layout.
- static auto child(SnapLayouter& layouter, const AbstractAnchor& parent, const Vector2& nodeSize, LayoutHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- static auto child(SnapLayouter& layouter, const AbstractAnchor& parent, const Vector2& nodeSize, NodeFlags nodeFlags, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- static auto child(SnapLayouter& layouter, const AbstractAnchor& parent, const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- static auto child(SnapLayouter& layouter, const AbstractAnchor& parent, const Vector2& nodeSize, NodeFlags nodeFlags, LayouterDataHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create a child layout, ordered before given layout assuming the layout belongs to the same layouter.
- static auto child(SnapLayouter& layouter, const AbstractAnchor& parent, const Vector2& nodeSize, LayouterDataHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- static auto root(AbstractUserInterface& ui, SnapLayouter& layouter, Snaps snap, const Vector2& nodeSize = {}, NodeFlags nodeFlags = {}, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create an explicitly snapped root layout.
- static auto root(AbstractUserInterface& ui, SnapLayouter& layouter, Snaps snap, const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- static auto child(SnapLayouter& layouter, Snaps snap, const AbstractAnchor& parent, const Vector2& nodeSize = {}, NodeFlags nodeFlags = {}, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create an explicitly snapped child layout.
- static auto child(SnapLayouter& layouter, Snaps snap, const AbstractAnchor& parent, const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- static auto sibling(SnapLayouter& layouter, Snaps snap, const AbstractAnchor& target, const Vector2& nodeSize = {}, NodeFlags nodeFlags = {}, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create an explicitly snapped sibling layout.
- static auto sibling(SnapLayouter& layouter, Snaps snap, const AbstractAnchor& target, const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
Constructors, destructors, conversion operators
- AbstractSnapLayout(SnapLayouter& layouter, const AbstractAnchor& anchor) explicit
- Construct with creating or reusing layout on an existing node.
- AbstractSnapLayout(SnapLayouter& layouter, const AbstractAnchor& anchor, LayoutHandle before, SnapLayoutFlags flags = {}) explicit
- Construct a layout on an existing node.
- AbstractSnapLayout(SnapLayouter& layouter, const AbstractAnchor& anchor, SnapLayoutFlags layoutFlags) explicit
- AbstractSnapLayout(SnapLayouter& layouter, const AbstractAnchor& anchor, LayouterDataHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) explicit
- Construct a layout on an existing node, ordered before given layout assuming the layout belongs to the same layouter.
- AbstractSnapLayout(SnapLayouter& layouter, const AbstractAnchor& anchor, Snaps snap, LayoutHandle snapTarget, SnapLayoutFlags flags = {}) explicit
- Construct an explicitly snapped layout on an existing node.
- AbstractSnapLayout(SnapLayouter& layouter, const AbstractAnchor& anchor, Snaps snap, LayouterDataHandle snapTarget, SnapLayoutFlags flags = {}) explicit
- Construct an explicitly snapped layout on an existing node, assuming the target belongs to the same layouter.
- operator NodeHandle() const
- operator LayoutHandle() const
- operator AbstractAnchor() const
- Widget positioning anchor.
Public functions
- auto ui() const -> AbstractUserInterface&
- User interface instance.
- auto layouter() const -> SnapLayouter&
- Layouter instance.
- auto node() const -> NodeHandle
- Node handle.
- auto layout() const -> LayoutHandle
- Layout handle.
- auto flags() const -> SnapLayoutFlags
- Layout flags.
- auto setFlags(SnapLayoutFlags flags) -> AbstractSnapLayout&
- Set layout flags.
- auto addFlags(SnapLayoutFlags flags) -> AbstractSnapLayout&
- Add layout flags.
- auto clearFlags(SnapLayoutFlags flags) -> AbstractSnapLayout&
- Clear layout flags.
- auto childSnap() const -> Snaps
- Snap for child layouts.
- auto setChildSnap(Snaps snap) -> AbstractSnapLayout&
- Set snap for child layouts.
-
auto child(const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
LayoutHandle layoutBefore = LayoutHandle::
Null, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout - Create a child layout.
- auto child(const Vector2& nodeSize, LayoutHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- auto child(const Vector2& nodeSize, NodeFlags nodeFlags, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- auto child(const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- auto child(const Vector2& nodeSize, NodeFlags nodeFlags, LayouterDataHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create a child layout, ordered before given layout assuming the layout belongs to the same layouter.
- auto child(const Vector2& nodeSize, LayouterDataHandle layoutBefore, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- auto child(Snaps snap, const Vector2& nodeSize = {}, NodeFlags nodeFlags = {}, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create an explicitly snapped child layout.
- auto child(Snaps snap, const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
- auto sibling(Snaps snap, const Vector2& nodeSize = {}, NodeFlags nodeFlags = {}, SnapLayoutFlags layoutFlags = {}) -> AbstractSnapLayout
- Create an explicitly snapped sibling layout.
- auto sibling(Snaps snap, const Vector2& nodeSize, SnapLayoutFlags layoutFlags) -> AbstractSnapLayout
Function documentation
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
LayoutHandle layoutBefore = LayoutHandle:: Null,
SnapLayoutFlags layoutFlags = {})
Create a child layout.
| Parameters | |
|---|---|
| layouter | Layouter instance |
| parent | Parent anchor |
| nodeSize | Child node size |
| nodeFlags | Child node flags |
| layoutBefore | Child layout to order before or LayoutHandle:: |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a node that's child of parent and assigns a layout to it. The child layout is positioned according to SnapLayouter::parent layout. Expects that layouter is part of the same user interface as parent, and that the node in parent already has a layout from layouter assigned.
Use child(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) to snap a child layout explicitly, use sibling(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped sibling instead of a child and root(AbstractUserInterface&, SnapLayouter&, Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped root layout. Creating a layout for an already existing node can be done using the AbstractSnapLayout(SnapLayouter&, const AbstractAnchor& anchor) constructor.
Calls AbstractUserInterface::
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize,
LayoutHandle layoutBefore,
SnapLayoutFlags layoutFlags = {})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize,
NodeFlags nodeFlags,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize,
NodeFlags nodeFlags,
LayouterDataHandle layoutBefore,
SnapLayoutFlags layoutFlags = {})
Create a child layout, ordered before given layout assuming the layout belongs to the same layouter.
Like child(SnapLayouter&, const AbstractAnchor&, const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) but without checking that layoutBefore indeed belongs to layouter. See its documentation for more information.
Calls AbstractUserInterface::
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
const AbstractAnchor& parent,
const Vector2& nodeSize,
LayouterDataHandle layoutBefore,
SnapLayoutFlags layoutFlags = {})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: root(AbstractUserInterface& ui,
SnapLayouter& layouter,
Snaps snap,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
SnapLayoutFlags layoutFlags = {})
Create an explicitly snapped root layout.
| Parameters | |
|---|---|
| ui | User interface instance |
| layouter | Layouter instance |
| snap | How to snap to the ui |
| nodeSize | Child node size |
| nodeFlags | Child node flags |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a root node and assigns it a layout explicitly snapped to the user interface itself. Expects that layouter is part of ui.
Use child(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped child and sibling(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped sibling node, use child(SnapLayouter&, const AbstractAnchor&, const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) to add a child layout positioned according to SnapLayouter::
Calls AbstractUserInterface::
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: root(AbstractUserInterface& ui,
SnapLayouter& layouter,
Snaps snap,
const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
Snaps snap,
const AbstractAnchor& parent,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
SnapLayoutFlags layoutFlags = {})
Create an explicitly snapped child layout.
| Parameters | |
|---|---|
| layouter | Layouter instance |
| snap | How to snap to the parent |
| parent | Parent anchor to snap to |
| nodeSize | Child node size |
| nodeFlags | Child node flags |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a node that's child of parent and assigns a layout explicitly snapped to it. Expects that layouter is part of the same user interface as parent, and that the node in parent already has a layout from layouter assigned.
Use sibling(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped sibling instead of a child and root(AbstractUserInterface&, SnapLayouter&, Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped root node, use child(SnapLayouter&, const AbstractAnchor&, const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) to add a child layout positioned according to SnapLayouter::
Calls AbstractUserInterface::
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(SnapLayouter& layouter,
Snaps snap,
const AbstractAnchor& parent,
const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: sibling(SnapLayouter& layouter,
Snaps snap,
const AbstractAnchor& target,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
SnapLayoutFlags layoutFlags = {})
Create an explicitly snapped sibling layout.
| Parameters | |
|---|---|
| layouter | Layouter instance |
| snap | How to snap to the target |
| target | Target anchor to snap to |
| nodeSize | Node size |
| nodeFlags | Node flags |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a node with the same parent as target, and assigns it a layout that's explicitly snapped to target. Expects that layouter is part of the same user interface as target, and that the node in target already has a layout from layouter assigned.
Use child(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) and specializations to create an explicitly snapped child instead of a sibling and root(AbstractUserInterface&, SnapLayouter&, Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped root node, use child(SnapLayouter&, const AbstractAnchor&, const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) to add a child layout positioned according to SnapLayouter::
Calls AbstractUserInterface::
static AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: sibling(SnapLayouter& layouter,
Snaps snap,
const AbstractAnchor& target,
const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: AbstractSnapLayout:: AbstractSnapLayout(SnapLayouter& layouter,
const AbstractAnchor& anchor) explicit
Construct with creating or reusing layout on an existing node.
| Parameters | |
|---|---|
| layouter | Layouter instance |
| anchor | Anchor to which to assign the layout |
Expects that layouter is part of the same user interface as anchor. If the node in anchor already has a layout from layouter assigned, uses it, otherwise adds a new one to it. Use the AbstractSnapLayout(SnapLayouter&, const AbstractAnchor& anchor, LayoutHandle, SnapLayoutFlags) overload to add a new layout always together with specifying its properties.
Calls SnapLayouter::
Magnum:: Ui:: AbstractSnapLayout:: AbstractSnapLayout(SnapLayouter& layouter,
const AbstractAnchor& anchor,
LayoutHandle before,
SnapLayoutFlags flags = {}) explicit
Construct a layout on an existing node.
| Parameters | |
|---|---|
| layouter | Layouter instance |
| anchor | Anchor to which to assign the layout |
| before | Sibling layout to order before or LayoutHandle:: |
| flags | Layout flags |
Assigns a new layout to an existing node contained in anchor. Expects that layouter is part of the same user interface as anchor, and that the node in anchor doesn't have a layout from layouter assigned yet. Use the AbstractSnapLayout(SnapLayouter&, const AbstractAnchor&) overload to add a new layout only if it isn't assigned yet.
Use the child(), root() or sibling() static functions for a combined operation of creating a node and assigning a layout to it, you can also call member child() and sibling() on an existing layout instance for the same effect.
Calls SnapLayouter::
Magnum:: Ui:: AbstractSnapLayout:: AbstractSnapLayout(SnapLayouter& layouter,
const AbstractAnchor& anchor,
SnapLayoutFlags layoutFlags) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: AbstractSnapLayout:: AbstractSnapLayout(SnapLayouter& layouter,
const AbstractAnchor& anchor,
LayouterDataHandle layoutBefore,
SnapLayoutFlags layoutFlags = {}) explicit
Construct a layout on an existing node, ordered before given layout assuming the layout belongs to the same layouter.
Like AbstractSnapLayout(SnapLayouter&, const AbstractAnchor&, LayoutHandle, SnapLayoutFlags) but without checking that layoutBefore indeed belongs to layouter. See documentation for more information.
Calls SnapLayouter::
Magnum:: Ui:: AbstractSnapLayout:: AbstractSnapLayout(SnapLayouter& layouter,
const AbstractAnchor& anchor,
Snaps snap,
LayoutHandle snapTarget,
SnapLayoutFlags flags = {}) explicit
Construct an explicitly snapped layout on an existing node.
| Parameters | |
|---|---|
| layouter | Layouter instance |
| anchor | Anchor to which to assign the layout |
| snap | How to snap |
| snapTarget | Target to snap to or LayoutHandle::anchor to the UI itself |
| flags | Layout flags |
Calls SnapLayouter::
Magnum:: Ui:: AbstractSnapLayout:: AbstractSnapLayout(SnapLayouter& layouter,
const AbstractAnchor& anchor,
Snaps snap,
LayouterDataHandle snapTarget,
SnapLayoutFlags flags = {}) explicit
Construct an explicitly snapped layout on an existing node, assuming the target belongs to the same layouter.
Like AbstractSnapLayout(SnapLayouter&, const AbstractAnchor&, Snaps, LayoutHandle, SnapLayoutFlags) but without checking that snapTarget indeed belongs to layouter. See documentation for more information.
Calls SnapLayouter::
Magnum:: Ui:: AbstractSnapLayout:: operator NodeHandle() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: AbstractSnapLayout:: operator LayoutHandle() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NodeHandle Magnum:: Ui:: AbstractSnapLayout:: node() const
Node handle.
Guaranteed to be never NodeHandle::
LayoutHandle Magnum:: Ui:: AbstractSnapLayout:: layout() const
Layout handle.
Guaranteed to be never LayoutHandle::
AbstractSnapLayout& Magnum:: Ui:: AbstractSnapLayout:: setFlags(SnapLayoutFlags flags)
Set layout flags.
| Returns | Reference to self (for method chaining) |
|---|
Initially, a layout has the flags that were passed to the constructor, to root() child() or sibling(), which are by default none. The BasicSnapLayoutColumn, BasicSnapLayoutColumnLeft, BasicSnapLayoutColumnRight, BasicSnapLayoutColumnFill, BasicSnapLayoutRow, BasicSnapLayoutRowTop, BasicSnapLayoutRowBottom and BasicSnapLayoutRowFill subclasses implicitly add SnapLayoutFlag::
Calls SnapLayouter::
AbstractSnapLayout& Magnum:: Ui:: AbstractSnapLayout:: addFlags(SnapLayoutFlags flags)
Add layout flags.
Calls setFlags() with the existing flags ORed with flags. Useful for preserving previously set flags.
AbstractSnapLayout& Magnum:: Ui:: AbstractSnapLayout:: clearFlags(SnapLayoutFlags flags)
Clear layout flags.
Calls setFlags() with the existing flags ANDed with the inverse of flags. Useful for removing a subset of previously set flags.
AbstractSnapLayout& Magnum:: Ui:: AbstractSnapLayout:: setChildSnap(Snaps snap)
Set snap for child layouts.
| Returns | Reference to self (for method chaining) |
|---|
Default is Snap::
- Bottom for BasicSnapLayoutColumn
- BottomLeft|InsideX for BasicSnapLayoutColumnLeft
- BottomRight|InsideX for BasicSnapLayoutColumnRight
- Bottom|FillX for BasicSnapLayoutColumnFill
- Right for BasicSnapLayoutRow
- TopRight|InsideY for BasicSnapLayoutRowTop
- BottomRight|InsideY for BasicSnapLayoutRowBottom
- Right|FillY for BasicSnapLayoutRowFill
Calls SnapLayouter::
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
LayoutHandle layoutBefore = LayoutHandle:: Null,
SnapLayoutFlags layoutFlags = {})
Create a child layout.
| Parameters | |
|---|---|
| nodeSize | Child node size |
| nodeFlags | Child node flags |
| layoutBefore | Child layout to order before or LayoutHandle:: |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a node that's a child of node() and assigns a layout to it. The child layout is positioned according to childSnap(). Use child(Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to snap a child layout explicitly, use sibling(Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped sibling instead of a child.
The BasicSnapLayout subclass and its various typedefs such as SnapLayout return a concrete layout instance. You can also use the static child(SnapLayouter&, const AbstractAnchor&, const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) function to create a child layout without an existing AbstractSnapLayout instance.
Calls AbstractUserInterface::
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(const Vector2& nodeSize,
LayoutHandle layoutBefore,
SnapLayoutFlags layoutFlags = {})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(const Vector2& nodeSize,
NodeFlags nodeFlags,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(const Vector2& nodeSize,
NodeFlags nodeFlags,
LayouterDataHandle layoutBefore,
SnapLayoutFlags layoutFlags = {})
Create a child layout, ordered before given layout assuming the layout belongs to the same layouter.
Like child(const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) but without checking that layoutBefore indeed belongs to layouter(). See its documentation for more information.
Calls AbstractUserInterface::
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(const Vector2& nodeSize,
LayouterDataHandle layoutBefore,
SnapLayoutFlags layoutFlags = {})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(Snaps snap,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
SnapLayoutFlags layoutFlags = {})
Create an explicitly snapped child layout.
| Parameters | |
|---|---|
| snap | How to snap |
| nodeSize | Child node size |
| nodeFlags | Child node flags |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a node that's a child of node(), and assigns a layout explicitly snapped to it. Use sibling(Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped sibling instead of a child, use child(const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) to add a child layout positioned implicitly according to childSnap().
The BasicSnapLayout subclass and its various typedefs such as SnapLayout return a concrete layout instance. You can also use the static child(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) function to create an explicitly snapped child layout without an existing AbstractSnapLayout instance.
Calls AbstractUserInterface::
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: child(Snaps snap,
const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: sibling(Snaps snap,
const Vector2& nodeSize = {},
NodeFlags nodeFlags = {},
SnapLayoutFlags layoutFlags = {})
Create an explicitly snapped sibling layout.
| Parameters | |
|---|---|
| snap | How to snap |
| nodeSize | Child node size |
| nodeFlags | Child node flags |
| layoutFlags | Layout flags |
| Returns | New layout instance |
Creates a node with the same parent as node(), and assigns a layout explicitly snapped to it. Use child(Snaps, const Vector2&, NodeFlags, SnapLayoutFlags) to create an explicitly snapped child instead of a sibling, use child(const Vector2&, NodeFlags, LayoutHandle, SnapLayoutFlags) to add a child layout positioned implicitly according to childSnap().
The BasicSnapLayout subclass and its various typedefs such as SnapLayout return a concrete layout instance. You can also use the static sibling(SnapLayouter&, Snaps, const AbstractAnchor&, const Vector2&, NodeFlags, SnapLayoutFlags) function to create an explicitly snapped sibling layout without an existing AbstractSnapLayout instance.
Calls AbstractUserInterface::
AbstractSnapLayout Magnum:: Ui:: AbstractSnapLayout:: sibling(Snaps snap,
const Vector2& nodeSize,
SnapLayoutFlags layoutFlags)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.