|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures a Menu, creates it and registers it in an entity registry. More...
#include <headers/guillaume/entities/menu.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder set to the defaults of reset(). | |
| std::shared_ptr< Menu > | buildEntity (void) override |
| Build a menu and its rows from the current configuration, without registering it or setting its parent. | |
| void | reset (void) override |
| Restore the defaults. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set where the menu is placed while it has no anchor. | |
| Builder & | withVariant (Variant variant) |
| Set the variant. | |
| Builder & | addItem (const std::string &label, const std::string &leadingIcon="") |
| Append an enabled item without press handler. | |
| Builder & | addItem (const Item &item) |
| Append an item described in full. | |
| std::shared_ptr< Menu > | makeMenu (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::vector< Item > &items) |
| Build a menu, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Menu > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Menu > | 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 Menu, creates it and registers it in an entity registry.
| guillaume::entities::Menu::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
| Menu::Builder & guillaume::entities::Menu::Builder::addItem | ( | const Item & | item | ) |
| Menu::Builder & guillaume::entities::Menu::Builder::addItem | ( | const std::string & | label, |
| const std::string & | leadingIcon = "" ) |
|
overridevirtual |
Build a menu and its rows from the current configuration, without registering it or setting its parent.
Implements guillaume::entities::EntityBuilderBase< Menu >.
Definition at line 85 of file menu.cpp.

| std::shared_ptr< Menu > guillaume::entities::Menu::Builder::makeMenu | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant, | ||
| const std::vector< Item > & | items ) |
Build a menu, register it under parent and reset the builder.
The items given here come after the ones already added with addItem().
| parent | The entity the menu becomes a child of, or nullptr for a root entity. |
| variant | The variant of the menu. |
| items | The items to append, in display order; may be empty. |
Definition at line 138 of file menu.cpp.

|
overridevirtual |
Restore the defaults.
Defaults: Dropdown variant, no item, default pose. The mode (Elevated), the anchor (none) and the anchor position (Bottom) are set on the menu after it is built.
Implements guillaume::ecs::EntityBuilder.
Definition at line 92 of file menu.cpp.


| Menu::Builder & guillaume::entities::Menu::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
| Menu::Builder & guillaume::entities::Menu::Builder::withVariant | ( | Variant | variant | ) |