Krotos Modules 3
Loading...
Searching...
No Matches
krotos::AttachedToggleButton Class Reference

This class combines a ToggleButton, Label, and a ButtonParameterAttachment to simplify the process of adding toggle buttons to a GUI element. More...

#include <AttachedToggleButton.h>

Inheritance diagram for krotos::AttachedToggleButton:

Public Member Functions

 AttachedToggleButton (const String &labelText)
 
void resized () override
 
Label & getLabel ()
 
Button & getButton ()
 
Button & getControlComponent ()
 
std::unique_ptr< ButtonParameterAttachment > & getAttachment ()
 
void setDragAndDropDescription (const var &description)
 

Public Attributes

std::function< void()> onStateChange
 

Private Attributes

DraggableLabel m_label
 
ToggleButton m_toggleButton
 
std::unique_ptr< ButtonParameterAttachment > m_attachment
 

Detailed Description

This class combines a ToggleButton, Label, and a ButtonParameterAttachment to simplify the process of adding toggle buttons to a GUI element.

Constructor & Destructor Documentation

◆ AttachedToggleButton()

krotos::AttachedToggleButton::AttachedToggleButton ( const String & labelText)

Constructs a new slider with specified text for the label.

Member Function Documentation

◆ getAttachment()

std::unique_ptr< ButtonParameterAttachment > & krotos::AttachedToggleButton::getAttachment ( )

Returns reference to the attachment Object.

◆ getButton()

Button & krotos::AttachedToggleButton::getButton ( )

Returns reference to the button Object.

◆ getControlComponent()

Button & krotos::AttachedToggleButton::getControlComponent ( )

Generic function name for getButton()

◆ getLabel()

Label & krotos::AttachedToggleButton::getLabel ( )

Returns reference to the label displaying the button name.

◆ resized()

void krotos::AttachedToggleButton::resized ( )
override

◆ setDragAndDropDescription()

void krotos::AttachedToggleButton::setDragAndDropDescription ( const var & description)

Set the descriptor for the Label which will be passed to a dragAndDropTarget. Setting this will enable the Label to become draggable

Member Data Documentation

◆ m_attachment

std::unique_ptr<ButtonParameterAttachment> krotos::AttachedToggleButton::m_attachment
private

◆ m_label

DraggableLabel krotos::AttachedToggleButton::m_label
private

◆ m_toggleButton

ToggleButton krotos::AttachedToggleButton::m_toggleButton
private

◆ onStateChange

std::function<void()> krotos::AttachedToggleButton::onStateChange

You can assign a lambda to this callback object to have it called when the button's state changes.


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