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


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder set to the defaults of reset(). | |
| std::shared_ptr< Dialog > | buildEntity (void) override |
| Build a dialog and its children from the current configuration, without registering it or setting its parent. | |
| void | reset (void) override |
| Restore the defaults: Alert variant, no title, no message, no action, no icon, no dismiss handler, and a default pose. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set the pose the dialog is created with. | |
| Builder & | withVariant (Variant variant) |
| Set the dialog variant. | |
| Builder & | withTitle (const std::string &title) |
| Set the title, shown above the message. | |
| Builder & | withMessage (const std::string &message) |
| Set the message, shown under the title. | |
| Builder & | addAction (const std::string &label, std::function< void(void)> onPress={}) |
| Append an action, shown as a text button at the end of the action row. | |
| Builder & | withIcon (const std::string &iconGlyph) |
| Set the icon shown above the title. | |
| Builder & | withOnDismiss (std::function< void(void)> onDismiss) |
| Set the handler called when the dialog is dismissed (see Dialog::setOnDismiss()). | |
| std::shared_ptr< Dialog > | makeDialog (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::string &title, const std::string &message, const std::vector< std::string > &actions={}) |
Build a dialog, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Dialog > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Dialog > | 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 Dialog, then builds it and registers it in the entity registry given at construction.
Definition at line 125 of file dialog.hpp.
| guillaume::entities::Dialog::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Create a builder set to the defaults of reset().
| componentRegistry | The registry the dialog's components are created in. |
| entityRegistry | The registry the built dialogs are added to. |
Definition at line 67 of file dialog.cpp.

| Dialog::Builder & guillaume::entities::Dialog::Builder::addAction | ( | const std::string & | label, |
| std::function< void(void)> | onPress = {} ) |
Append an action, shown as a text button at the end of the action row.
| label | The button label. An action with an empty label gets no button. |
| onPress | Called when the button is pressed. May be empty. The dialog stays open after the call. |
Definition at line 129 of file dialog.cpp.

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

| std::shared_ptr< Dialog > guillaume::entities::Dialog::Builder::makeDialog | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant, | ||
| const std::string & | title, | ||
| const std::string & | message, | ||
| const std::vector< std::string > & | actions = {} ) |
Build a dialog, register it under parent and reset the builder.
The arguments replace the variant, title and message set before; actions are appended to the actions already added with addAction(). The icon and dismiss handler set before are kept.
| parent | The entity the dialog is attached to. |
| variant | The dialog variant. |
| title | The title text (empty: no title). |
| message | The message text (empty: no message). |
| actions | Labels of extra actions without a press handler. |
Definition at line 150 of file dialog.cpp.

|
overridevirtual |
Restore the defaults: Alert variant, no title, no message, no action, no icon, no dismiss handler, and a default pose.
Implements guillaume::ecs::EntityBuilder.
Definition at line 82 of file dialog.cpp.


| Dialog::Builder & guillaume::entities::Dialog::Builder::withIcon | ( | const std::string & | iconGlyph | ) |
Set the icon shown above the title.
| iconGlyph | The glyph name. Default: empty, which builds no icon, except for a Confirmation dialog, which then shows "info". |
Definition at line 136 of file dialog.cpp.
| Dialog::Builder & guillaume::entities::Dialog::Builder::withMessage | ( | const std::string & | message | ) |
Set the message, shown under the title.
| message | The message text. Default: empty, which builds no message. |
Definition at line 122 of file dialog.cpp.
| Dialog::Builder & guillaume::entities::Dialog::Builder::withOnDismiss | ( | std::function< void(void)> | onDismiss | ) |
Set the handler called when the dialog is dismissed (see Dialog::setOnDismiss()).
| onDismiss | The handler. Default: none. |
Definition at line 143 of file dialog.cpp.
| Dialog::Builder & guillaume::entities::Dialog::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set the pose the dialog is created with.
| pose | The position and orientation of the panel. Default: a default-constructed pose. |
Definition at line 104 of file dialog.cpp.
| Dialog::Builder & guillaume::entities::Dialog::Builder::withTitle | ( | const std::string & | title | ) |
Set the title, shown above the message.
| title | The title text. Default: empty, which builds no title. |
Definition at line 116 of file dialog.cpp.
| Dialog::Builder & guillaume::entities::Dialog::Builder::withVariant | ( | Variant | variant | ) |
Set the dialog variant.
| variant | The variant. Default: Variant::Alert. |
Definition at line 110 of file dialog.cpp.
