|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures RadioGroup widgets and registers them in the scene's entity registry. More...
#include <headers/guillaume/entities/radio_group.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder holding the defaults of reset(). | |
| std::shared_ptr< RadioGroup > | buildEntity (void) override |
| Build a group and its radio buttons from the current configuration, without registering it or giving it a parent. | |
| void | reset (void) override |
| Restore the defaults: default pose, no option, no selected option, no value-change handler, and a vertical layout aligned to the start with RowSpacing between options. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set where the group is. | |
| Builder & | addOption (const std::string &label) |
| Append an option at the end of the list. | |
| Builder & | withValue (std::size_t index) |
| Choose the option selected when the group is built. | |
| Builder & | withOnValueChange (std::function< void(std::size_t)> onValueChange) |
| Set the function called when the user selects another option. | |
| std::shared_ptr< RadioGroup > | makeRadioGroup (std::shared_ptr< ecs::Entity > parent, const std::vector< std::string > &options) |
| Build a group and its radio buttons, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< RadioGroup > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< RadioGroup > | 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 RadioGroup widgets and registers them in the scene's entity registry.
Definition at line 95 of file radio_group.hpp.
| guillaume::entities::RadioGroup::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Construct a builder holding the defaults of reset().
| componentRegistry | The registry the components of the built groups are stored in. |
| entityRegistry | The registry that owns the groups built by makeRadioGroup. |
Definition at line 31 of file radio_group.cpp.

| RadioGroup::Builder & guillaume::entities::RadioGroup::Builder::addOption | ( | const std::string & | label | ) |
Append an option at the end of the list.
| label | The text shown next to the radio button of the option. |
Definition at line 68 of file radio_group.cpp.

|
overridevirtual |
Build a group and its radio buttons from the current configuration, without registering it or giving it a parent.
Implements guillaume::entities::EntityBuilderBase< RadioGroup >.
Definition at line 38 of file radio_group.cpp.

| std::shared_ptr< RadioGroup > guillaume::entities::RadioGroup::Builder::makeRadioGroup | ( | std::shared_ptr< ecs::Entity > | parent, |
| const std::vector< std::string > & | options ) |
Build a group and its radio buttons, register it under parent and reset the builder.
The pose, selected option and handler set with the with... methods apply.
| parent | The entity the group is attached to, or nullptr for a root entity. |
| options | The option labels, in display order. They are appended to the options already given with addOption(). |
Definition at line 87 of file radio_group.cpp.

|
overridevirtual |
Restore the defaults: default pose, no option, no selected option, no value-change handler, and a vertical layout aligned to the start with RowSpacing between options.
Implements guillaume::ecs::EntityBuilder.
Definition at line 44 of file radio_group.cpp.

| RadioGroup::Builder & guillaume::entities::RadioGroup::Builder::withOnValueChange | ( | std::function< void(std::size_t)> | onValueChange | ) |
Set the function called when the user selects another option.
| onValueChange | The function to call, receiving the index of the newly selected option. Empty by default. |
Definition at line 80 of file radio_group.cpp.
| RadioGroup::Builder & guillaume::entities::RadioGroup::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set where the group is.
| pose | The pose of the top-left corner of the group. A default-constructed pose by default. |
Definition at line 61 of file radio_group.cpp.
| RadioGroup::Builder & guillaume::entities::RadioGroup::Builder::withValue | ( | std::size_t | index | ) |
Choose the option selected when the group is built.
| index | The index of the option, starting at 0. It is not checked: with an index that matches no option, no radio button is selected. By default no option is selected. |
Definition at line 74 of file radio_group.cpp.