Magnum::Ui::AbstractAnchor class new in Git master

Base for widget positioning anchors.

Wraps an AbstractUserInterface reference, NodeHandle 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
Templated base for widget positioning anchors.

Constructors, destructors, conversion operators

AbstractAnchor(AbstractUserInterface& ui, NodeHandle node, LayoutHandle layout) explicit
Constructor.
AbstractAnchor(AbstractUserInterface& ui, NodeHandle parent, const Vector2& offset, const Vector2& size, NodeFlags flags = {})
Create a custom-positioned anchor.
AbstractAnchor(AbstractUserInterface& ui, NodeHandle parent, const Vector2& size, NodeFlags flags = {})
Create a custom-sized anchor.
AbstractAnchor(AbstractUserInterface& ui, const Vector2& offset, const Vector2& size, NodeFlags flags = {})
Create a custom-positioned top-level anchor.
AbstractAnchor(AbstractUserInterface& ui, const Vector2& size, NodeFlags flags = {})
Create a custom-sized top-level anchor.
operator NodeHandle() const
Node handle.
operator LayoutHandle() const
Layout handle.

Public functions

auto ui() const -> AbstractUserInterface&
User interface instance.
auto node() const -> NodeHandle
Node handle.
auto layout() const -> LayoutHandle
Layout handle.

Function documentation

Magnum::Ui::AbstractAnchor::AbstractAnchor(AbstractUserInterface& ui, NodeHandle node, LayoutHandle layout) explicit

Constructor.

Parameters
ui User interface instance
node Node handle
layout Layout associated with given node or LayoutHandle::Null

The node is expected to be valid in ui. If layout is not LayoutHandle::Null, it's expected to be valid in ui and associated with node.

Magnum::Ui::AbstractAnchor::AbstractAnchor(AbstractUserInterface& ui, NodeHandle parent, const Vector2& offset, const Vector2& size, NodeFlags flags = {})

Create a custom-positioned anchor.

Calls AbstractUserInterface::createNode() with parent, offset, size and flags, and remembers the created NodeHandle. The layout() is LayoutHandle::Null.

Magnum::Ui::AbstractAnchor::AbstractAnchor(AbstractUserInterface& ui, NodeHandle parent, const Vector2& size, NodeFlags flags = {})

Create a custom-sized anchor.

Calls AbstractUserInterface::createNode() with parent, zero offset, size and flags, and remembers the created NodeHandle. The layout() is LayoutHandle::Null.

Magnum::Ui::AbstractAnchor::AbstractAnchor(AbstractUserInterface& ui, const Vector2& offset, const Vector2& size, NodeFlags flags = {})

Create a custom-positioned top-level anchor.

Equivalent to calling AbstractAnchor(AbstractUserInterface&, NodeHandle, const Vector2&, const Vector2&, NodeFlags) with NodeHandle::Null as the parent.

Magnum::Ui::AbstractAnchor::AbstractAnchor(AbstractUserInterface& ui, const Vector2& size, NodeFlags flags = {})

Create a custom-sized top-level anchor.

Equivalent to calling AbstractAnchor(AbstractUserInterface&, NodeHandle, const Vector2&, NodeFlags) with NodeHandle::Null as the parent.

Magnum::Ui::AbstractAnchor::operator NodeHandle() const

Node handle.

Guaranteed to be never NodeHandle::Null.

Magnum::Ui::AbstractAnchor::operator LayoutHandle() const

Layout handle.

Unlike layout() expects that the handle is not null.

NodeHandle Magnum::Ui::AbstractAnchor::node() const

Node handle.

Guaranteed to be never NodeHandle::Null.

LayoutHandle Magnum::Ui::AbstractAnchor::layout() const

Layout handle.

Can be LayoutHandle::Null, in which case the anchor doesn't have any associated layout.