template<class UserInterface>
Magnum::Ui::BasicWidget class new in Git master

Templated abstract base for stateful widgets.

Restricts AbstractWidget to a concrete user interface instance. See the base class documentation for more information.

Base classes

class AbstractWidget new in Git master
Base for stateful widgets.

Derived classes

class Button new in Git master
Button widget.
class Input new in Git master
Input widget.
class Label new in Git master
Label widget.
class Panel new in Git master
Panel widget.
class ScrollArea new in Git master
Scroll area widget.

Constructors, destructors, conversion operators

BasicWidget(UserInterface& ui, NodeHandle node) explicit
Constructor.
BasicWidget(NonOwnedT, UserInterface& ui, NodeHandle node) explicit
Construct a non-owned widget.
BasicWidget(const BasicAnchor<UserInterface>& anchor) explicit
Construct from a positioning anchor.
BasicWidget(NonOwnedT, const BasicAnchor<UserInterface>& anchor) explicit
Construct a non-owned widget from a positioning anchor.
BasicWidget(NoCreateT) explicit
Construct with no underlying node.
BasicWidget(const BasicWidget<UserInterface>&) deleted
Copying is not allowed.
BasicWidget(BasicWidget<UserInterface>&& other) defaulted noexcept
Move constructor.

Public functions

auto operator=(const BasicWidget&) -> BasicWidget& deleted
Copying is not allowed.
auto operator=(BasicWidget&& other) -> BasicWidget& defaulted noexcept
Move assignment.
auto ui() const -> UserInterface&
User interface instance this widget is part of.

Function documentation

template<class UserInterface _1>
Magnum::Ui::BasicWidget<_1>::BasicWidget(UserInterface& ui, NodeHandle node) explicit

Constructor.

Parameters
ui User interface instance
node Node to create the widget on

The node is expected to be valid in ui.

template<class UserInterface _1>
Magnum::Ui::BasicWidget<_1>::BasicWidget(NonOwnedT, UserInterface& ui, NodeHandle node) explicit

Construct a non-owned widget.

Parameters
ui User interface instance
node Node to create the widget on

The node is expected to be valid in ui. Compared to AbstractWidget(AbstractUserInterface&, NodeHandle) the node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::removeNode() is explicitly called on node().

template<class UserInterface _1>
Magnum::Ui::BasicWidget<_1>::BasicWidget(const BasicAnchor<UserInterface>& anchor) explicit

Construct from a positioning anchor.

The ui() and node() is set to AbstractAnchor::ui() and AbstractAnchor::node().

template<class UserInterface _1>
Magnum::Ui::BasicWidget<_1>::BasicWidget(NonOwnedT, const BasicAnchor<UserInterface>& anchor) explicit

Construct a non-owned widget from a positioning anchor.

The ui() and node() is set to AbstractAnchor::ui() and AbstractAnchor::node(). Compared to AbstractWidget(const AbstractAnchor&) the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::removeNode() is explicitly called on node().

template<class UserInterface _1>
Magnum::Ui::BasicWidget<_1>::BasicWidget(NoCreateT) explicit

Construct with no underlying node.

The instance is equivalent to a moved-out state, i.e. not usable for anything. Move another instance over it to make it useful.

template<class UserInterface _1>
Magnum::Ui::BasicWidget<_1>::BasicWidget(BasicWidget<UserInterface>&& other) defaulted noexcept

Move constructor.

Performs a destructive move, i.e. the other node() becomes NodeHandle::Null.