guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::entities::RadioButton::Builder Class Reference

Configures, creates and registers RadioButton widgets. More...

#include <headers/guillaume/entities/radio_button.hpp>

Inheritance diagram for guillaume::entities::RadioButton::Builder:
Collaboration diagram for guillaume::entities::RadioButton::Builder:

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder with the default configuration (see reset()).
std::shared_ptr< RadioButton > buildEntity (void) override
 Build a RadioButton, with its dot and label children, from the current configuration, without registering it.
void reset (void) override
 Restore the default configuration.
Builder & withPose (const utility::graphic::PoseF &pose)
 Set the position and orientation of the ring.
Builder & withVariant (Variant variant)
 Set the visual variant.
Builder & withLabel (const std::string &label)
 Set the label shown to the right of the ring.
std::shared_ptr< RadioButton > makeRadioButton (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::string &label)
 Build a radio button, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< RadioButton >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< RadioButton > 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.

Detailed Description

Configures, creates and registers RadioButton widgets.

Set options with the with... methods then call registerEntity(), or use makeRadioButton() to do both in one call.

Definition at line 99 of file radio_button.hpp.

Constructor & Destructor Documentation

◆ Builder()

guillaume::entities::RadioButton::Builder::Builder ( ecs::ComponentRegistry & componentRegistry,
ecs::EntityRegistry & entityRegistry )

Construct a builder with the default configuration (see reset()).

Parameters
componentRegistryThe registry that stores the components of the radio buttons to build.
entityRegistryThe registry the built radio buttons are added to (usually the scene's).

Definition at line 85 of file radio_button.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

std::shared_ptr< RadioButton > guillaume::entities::RadioButton::Builder::buildEntity ( void )
overridevirtual

Build a RadioButton, with its dot and label children, from the current configuration, without registering it.

registerEntity() calls it, then sets the parent, registers the radio button and resets the builder.

Returns
The new radio button, not selected.

Implements guillaume::entities::EntityBuilderBase< RadioButton >.

Definition at line 92 of file radio_button.cpp.

Here is the call graph for this function:

◆ makeRadioButton()

std::shared_ptr< RadioButton > guillaume::entities::RadioButton::Builder::makeRadioButton ( std::shared_ptr< ecs::Entity > parent,
Variant variant,
const std::string & label )

Build a radio button, register it under parent and reset the builder.

A pose set before the call with withPose() also applies.

Parameters
parentThe entity the radio button becomes a child of.
variantEnabled, Disabled or Error.
labelThe label text; empty for a radio button without label.
Returns
The new radio button, not selected, registered in the entity registry.

Definition at line 137 of file radio_button.cpp.

Here is the call graph for this function:

◆ reset()

void guillaume::entities::RadioButton::Builder::reset ( void )
overridevirtual

Restore the default configuration.

Defaults: Variant::Enabled, no label, default pose. The ring is a 20 dp circle with no padding.

Implements guillaume::ecs::EntityBuilder.

Definition at line 99 of file radio_button.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ withLabel()

RadioButton::Builder & guillaume::entities::RadioButton::Builder::withLabel ( const std::string & label)

Set the label shown to the right of the ring.

Parameters
labelThe label text, also used as the accessibility label. Default: empty, no label child is built.
Returns
Reference to the builder for chaining.

Definition at line 131 of file radio_button.cpp.

◆ withPose()

RadioButton::Builder & guillaume::entities::RadioButton::Builder::withPose ( const utility::graphic::PoseF & pose)

Set the position and orientation of the ring.

Parameters
poseThe pose written to the radio button's Transform. Default: a default-constructed pose.
Returns
Reference to the builder for chaining.

Definition at line 118 of file radio_button.cpp.

◆ withVariant()

RadioButton::Builder & guillaume::entities::RadioButton::Builder::withVariant ( Variant variant)

Set the visual variant.

Parameters
variantEnabled, Disabled (ignores input) or Error (error colors). Default: Variant::Enabled.
Returns
Reference to the builder for chaining.

Definition at line 124 of file radio_button.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: