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

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

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

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

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder with the default configuration (see reset()).
std::shared_ptr< Checkbox > buildEntity (void) override
 Build a Checkbox, with its check glyph 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 box.
Builder & withState (State state)
 Set the state the checkbox starts in.
Builder & withVariant (Variant variant)
 Set the visual variant.
Builder & withLabel (const std::string &label)
 Set the label shown to the right of the box.
std::shared_ptr< Checkbox > makeCheckbox (std::shared_ptr< ecs::Entity > parent, State state, Variant variant, const std::string &label)
 Build a checkbox, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Checkbox >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< Checkbox > 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 Checkbox widgets.

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

Definition at line 107 of file checkbox.hpp.

Constructor & Destructor Documentation

◆ Builder()

guillaume::entities::Checkbox::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 checkboxes to build.
entityRegistryThe registry the built checkboxes are added to (usually the scene's).

Definition at line 40 of file checkbox.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

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

Build a Checkbox, with its check glyph and label children, from the current configuration, without registering it.

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

Returns
The new checkbox.

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

Definition at line 47 of file checkbox.cpp.

Here is the call graph for this function:

◆ makeCheckbox()

std::shared_ptr< Checkbox > guillaume::entities::Checkbox::Builder::makeCheckbox ( std::shared_ptr< ecs::Entity > parent,
State state,
Variant variant,
const std::string & label )

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

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

Parameters
parentThe entity the checkbox becomes a child of.
stateThe state the checkbox starts in.
variantEnabled, Disabled or Error.
labelThe label text; empty for a checkbox without label.
Returns
The new checkbox, registered in the entity registry.

Definition at line 99 of file checkbox.cpp.

Here is the call graph for this function:

◆ reset()

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

Restore the default configuration.

Defaults: State::Unchecked, Variant::Enabled, no label, default pose. The box is an 18 dp square with a 2 dp corner radius and no padding, and centers its content.

Implements guillaume::ecs::EntityBuilder.

Definition at line 54 of file checkbox.cpp.

Here is the caller graph for this function:

◆ withLabel()

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

Set the label shown to the right of the box.

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 92 of file checkbox.cpp.

◆ withPose()

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

Set the position and orientation of the box.

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

Definition at line 74 of file checkbox.cpp.

◆ withState()

Checkbox::Builder & guillaume::entities::Checkbox::Builder::withState ( State state)

Set the state the checkbox starts in.

Parameters
stateThe initial state. Default: State::Unchecked.
Returns
Reference to the builder for chaining.

Definition at line 80 of file checkbox.cpp.

Here is the caller graph for this function:

◆ withVariant()

Checkbox::Builder & guillaume::entities::Checkbox::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 86 of file checkbox.cpp.


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