class new in Git master
#include <Magnum/Ui/Input.h>
Input Input widget.
Base classes
-
template<class UserInterface>class BasicWidget<UserInterface> new in Git master
- Templated abstract base for stateful widgets.
Constructors, destructors, conversion operators
-
Input(const Anchor& anchor,
Containers::
StringView text, const TextProperties& textProperties, InputStyle style = InputStyle:: Default) explicit - Constructor.
-
Input(const Anchor& anchor,
Containers::
StringView text, InputStyle style = InputStyle:: Default) explicit - Input(NoCreateT, UserInterface& ui) explicit
- Construct with no underlying node.
Public functions
- auto style() const -> InputStyle
- Style.
- auto setStyle(InputStyle style) -> Input&
- Set style.
-
auto text() const -> Containers::
StringView - Text.
-
auto setText(Containers::
StringView text, const TextProperties& textProperties = {}) -> Input& - Set text.
- auto backgroundData() const -> DataHandle
- Background data.
- auto textData() const -> DataHandle
- Text data or DataHandle::
Null.
Function documentation
Magnum:: Ui:: Input:: Input(const Anchor& anchor,
Containers:: StringView text,
const TextProperties& textProperties,
InputStyle style = InputStyle:: Default) explicit
Constructor.
Parameters | |
---|---|
anchor | Positioning anchor |
text | Pre-filled input text |
textProperties | Text shaping and layouting properties |
style | Input style |
Magnum:: Ui:: Input:: Input(const Anchor& anchor,
Containers:: StringView text,
InputStyle style = InputStyle:: Default) 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:: Input:: Input(NoCreateT,
UserInterface& ui) 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.
Input& Magnum:: Ui:: Input:: setStyle(InputStyle style)
Set style.
Returns | Reference to self (for method chaining) |
---|
Note that calling this function doesn't change the font if the new style uses a different one, you have to call setText() afterwards to make it pick it up.
Containers:: StringView Magnum:: Ui:: Input:: text() const
Text.
The returned view is valid only until any text is created or updated on the user interface text layer.
Input& Magnum:: Ui:: Input:: setText(Containers:: StringView text,
const TextProperties& textProperties = {})
Set text.
Returns | Reference to self (for method chaining) |
---|
DataHandle Magnum:: Ui:: Input:: backgroundData() const
Background data.
Exposed mainly for testing purposes, not meant to be modified directly.
DataHandle Magnum:: Ui:: Input:: textData() const
Text data or DataHandle::
Exposed mainly for testing purposes, not meant to be modified directly.