AbstractAnchor class new in Git master
#include <Magnum/Ui/Anchor.h>
Base for widget positioning anchors.
A non-owning wrapper over a NodeHandle along with an AbstractUserInterface reference and optional LayoutHandle. The BasicAnchor template and the Anchor typedef then restrict the type to a concrete user interface instance.
Meant to be returned from layouter instances to construct widget instances with.
Derived classes
-
template<class UserInterface>class BasicAnchor new in Git master
- Widget positioning anchor.
Constructors, destructors, conversion operators
- AbstractAnchor(AbstractUserInterface& ui, NodeHandle node)
- Constructor.
- AbstractAnchor(const AbstractWidget& widget)
- Construct from a widget instance.
- AbstractAnchor(AbstractUserInterface& ui, NodeHandle parent, const Vector2& offset, const Vector2& size, NodeFlags flags = {})
- Create a custom-positioned anchor.
- AbstractAnchor(AbstractAnchor parent, const Vector2& offset, const Vector2& size, NodeFlags flags = {})
- AbstractAnchor(AbstractUserInterface& ui, const Vector2& offset, const Vector2& size, NodeFlags flags = {})
- Create a custom-positioned root anchor.
- operator NodeHandle() const
- Node handle.
Public functions
- auto ui() const -> AbstractUserInterface&
- User interface instance.
- auto node() const -> NodeHandle
- Node handle.
Function documentation
Magnum:: Ui:: AbstractAnchor:: AbstractAnchor(AbstractUserInterface& ui,
NodeHandle node)
Constructor.
| Parameters | |
|---|---|
| ui | User interface instance |
| node | Node handle |
The node is expected to be valid in ui.
Magnum:: Ui:: AbstractAnchor:: AbstractAnchor(const AbstractWidget& widget)
Construct from a widget instance.
Unlike AbstractAnchor(AbstractUserInterface&, NodeHandle) doesn't perform any checks and just assumes the widget has a live AbstractUserInterface reference and a valid NodeHandle.
Magnum:: Ui:: AbstractAnchor:: AbstractAnchor(AbstractUserInterface& ui,
NodeHandle parent,
const Vector2& offset,
const Vector2& size,
NodeFlags flags = {})
Create a custom-positioned anchor.
Calls AbstractUserInterface::parent, offset, size and flags, and remembers the created NodeHandle. See its documentation for detailed description of all constraints.
Magnum:: Ui:: AbstractAnchor:: AbstractAnchor(AbstractAnchor parent,
const Vector2& offset,
const Vector2& size,
NodeFlags flags = {})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: AbstractAnchor:: AbstractAnchor(AbstractUserInterface& ui,
const Vector2& offset,
const Vector2& size,
NodeFlags flags = {})
Create a custom-positioned root anchor.
Equivalent to calling AbstractAnchor(AbstractUserInterface&, NodeHandle, const Vector2&, const Vector2&, NodeFlags) with NodeHandle::
NodeHandle Magnum:: Ui:: AbstractAnchor:: node() const
Node handle.
Guaranteed to be never NodeHandle::