|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures a TextField, then builds it and registers it in the entity registry given at construction. More...
#include <headers/guillaume/entities/text_field.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder set to the defaults of reset(). | |
| std::shared_ptr< TextField > | buildEntity (void) override |
| Build a text field and its children from the current configuration, without registering it or setting its parent. | |
| void | reset (void) override |
| Restore the defaults: Filled variant, no label, no icon, no supporting text, no error, empty text and a default pose. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set the pose the field is created with. | |
| Builder & | withVariant (Variant variant) |
| Set the field variant. | |
| Builder & | withPlaceholder (const std::string &placeholder) |
| Set the label. | |
| Builder & | withLeadingIcon (const std::string &iconGlyph) |
| Set the icon shown at the start of the box. | |
| Builder & | withTrailingIcon (const std::string &iconGlyph) |
| Set the icon shown at the end of the box. | |
| Builder & | withSupportingText (const std::string &supportingText) |
| Set the helper text shown under the box. | |
| Builder & | withError (bool error) |
| Choose whether the field starts in the error state. | |
| Builder & | withText (const std::string &text) |
| Set the text the field holds when created. | |
| std::shared_ptr< TextField > | makeTextField (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::string &placeholder, const std::string &leadingIcon, const std::string &trailingIcon, const std::string &supportingText, bool error, const std::string &text="") |
Build a text field, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< TextField > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< TextField > | registerEntity (std::shared_ptr< ecs::Entity > parent) |
| Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults. | |
| Public Member Functions inherited from guillaume::ecs::EntityBuilder | |
| EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder working on a pair of registries, normally those of one scene. | |
| virtual | ~EntityBuilder (void)=default |
| Virtual destructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityBuilder | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry in which the builder creates components. | |
| EntityRegistry & | getEntityRegistry (void) |
| Get the registry in which the builder registers the entities it creates. | |
Configures a TextField, then builds it and registers it in the entity registry given at construction.
Definition at line 134 of file text_field.hpp.
| guillaume::entities::TextField::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Create a builder set to the defaults of reset().
| componentRegistry | The registry the field's components are created in. |
| entityRegistry | The registry the built fields are added to. |
Definition at line 37 of file text_field.cpp.

|
overridevirtual |
Build a text field and its children from the current configuration, without registering it or setting its parent.
Implements guillaume::entities::EntityBuilderBase< TextField >.
Definition at line 44 of file text_field.cpp.

| std::shared_ptr< TextField > guillaume::entities::TextField::Builder::makeTextField | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant, | ||
| const std::string & | placeholder, | ||
| const std::string & | leadingIcon, | ||
| const std::string & | trailingIcon, | ||
| const std::string & | supportingText, | ||
| bool | error, | ||
| const std::string & | text = "" ) |
Build a text field, register it under parent and reset the builder.
The arguments replace every setting but the pose.
| parent | The entity the field is attached to. |
| variant | The field variant. |
| placeholder | The label text (empty: no label). |
| leadingIcon | The glyph name of the icon at the start of the box (empty: none). |
| trailingIcon | The glyph name of the icon at the end of the box (empty: none). |
| supportingText | The helper text under the box (empty: none). |
| error | True to start in the error state. |
| text | The initial text. |
Definition at line 127 of file text_field.cpp.

|
overridevirtual |
Restore the defaults: Filled variant, no label, no icon, no supporting text, no error, empty text and a default pose.
Implements guillaume::ecs::EntityBuilder.
Definition at line 52 of file text_field.cpp.

| TextField::Builder & guillaume::entities::TextField::Builder::withError | ( | bool | error | ) |
Choose whether the field starts in the error state.
| error | True for the error state. Default: false. |
Definition at line 115 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withLeadingIcon | ( | const std::string & | iconGlyph | ) |
Set the icon shown at the start of the box.
| iconGlyph | The glyph name. Default: empty, no icon. |
Definition at line 95 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withPlaceholder | ( | const std::string & | placeholder | ) |
Set the label.
The label is shown in place of the typed text while the field is empty and unfocused, and floats above it otherwise.
| placeholder | The label text. Default: empty, which builds no label. |
Definition at line 88 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set the pose the field is created with.
| pose | The position and orientation of the box. Default: a default-constructed pose. |
Definition at line 75 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withSupportingText | ( | const std::string & | supportingText | ) |
Set the helper text shown under the box.
| supportingText | The text. Default: empty, no text. |
Definition at line 108 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withText | ( | const std::string & | text | ) |
Set the text the field holds when created.
| text | The initial text. Default: empty. |
Definition at line 121 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withTrailingIcon | ( | const std::string & | iconGlyph | ) |
Set the icon shown at the end of the box.
| iconGlyph | The glyph name. Default: empty, no icon. The "error" icon takes its place in the error state. |
Definition at line 102 of file text_field.cpp.
| TextField::Builder & guillaume::entities::TextField::Builder::withVariant | ( | Variant | variant | ) |
Set the field variant.
| variant | The variant. Default: Variant::Filled. |
Definition at line 81 of file text_field.cpp.
