guillaume 1.0.0
Guillaume is a component-based UI framework library built around a primitive rendering system. It's designed for building user interfaces across XR platforms and traditional platforms with custom rendering backends and input handling. The framework is lightweight, flexible, and easy to integrate into existing projects.
|
Interactive button component. More...
#include <button.hpp>
Public Member Functions | |
Button (const std::string &label) | |
Constructs a Button object. | |
Button (const std::string &label, const Properties &properties) | |
Constructs a Button object with properties. | |
~Button (void) override=default | |
Destroys the Button object. | |
void | setOnClick (std::function< void()> callback) |
Sets the onClick callback function. | |
const std::string & | getLabel (void) const |
Gets the button's label. | |
void | setLabel (const std::string &label) |
Sets the button's label. | |
std::shared_ptr< Component > | render (void) override |
Renders the button. | |
void | onEvent (const Event &event) override |
Handles events for the button. | |
![]() | |
Component (void) | |
Constructs a Component object. | |
Component (const Properties &properties) | |
Constructs a Component object with properties. | |
virtual | ~Component (void)=default |
Destroy the Component object. | |
ComponentID | getID (void) const |
Get the ID object. | |
virtual void | addChild (const std::shared_ptr< Component > &child) |
Add a child component. | |
virtual void | addPrimitive (const std::shared_ptr< Primitive > &primitive) |
Add a primitive for rendering. | |
State & | getState (void) |
Gets the component's state. | |
const Properties & | getProperties (void) const |
Gets the component's properties. | |
const std::vector< std::shared_ptr< Component > > & | getChildren (void) const |
Gets the component's children. | |
std::shared_ptr< Component > | getParent (void) const |
Gets the component's parent. | |
const std::vector< std::shared_ptr< Primitive > > & | getPrimitives (void) const |
Gets the component's primitives. | |
Additional Inherited Members | |
![]() | |
void | setParent (const std::shared_ptr< Component > &parent) |
Set the Parent object. | |
![]() | |
State | _state |
The component's state. | |
Properties | _properties |
The component's properties. | |
std::shared_ptr< Component > | _parent |
Pointer to the parent component. | |
std::vector< std::shared_ptr< Component > > | _children |
Vector of child components. | |
std::vector< std::shared_ptr< Primitive > > | _primitives |
Vector of primitives for rendering. | |
Interactive button component.
The Button class represents a clickable button with a label and onClick handler.
Definition at line 38 of file button.hpp.
|
inline |
Constructs a Button object.
label | The button's label text |
Definition at line 49 of file button.hpp.
|
inline |
Constructs a Button object with properties.
label | The button's label text |
properties | The properties for the button |
Definition at line 61 of file button.hpp.
|
inline |
Gets the button's label.
Definition at line 85 of file button.hpp.
|
inlineoverridevirtual |
Handles events for the button.
If the event is a click event, the onClick callback is called.
event | The event to handle |
Reimplemented from Component.
Definition at line 130 of file button.hpp.
|
inlineoverridevirtual |
Renders the button.
Reimplemented from Component.
Definition at line 102 of file button.hpp.
|
inline |
Sets the button's label.
label | The new label text |
Definition at line 92 of file button.hpp.
|
inline |
Sets the onClick callback function.
callback | The callback function to be called when the button is clicked |
Definition at line 78 of file button.hpp.