Vital
Loading...
Searching...
No Matches
IncrementerButtons Class Reference

A pair of buttons for incrementing and decrementing a Slider's value. More...

#include <incrementer_buttons.h>

Inheritance diagram for IncrementerButtons:

Public Member Functions

 IncrementerButtons (Slider *slider)
 Constructs the IncrementerButtons object.
 
void setActive (bool active)
 Sets whether the incrementer buttons are active.
 
void resized () override
 Resizes and positions the increment and decrement buttons.
 
void paint (Graphics &g) override
 Paints the component background and updates button colors.
 
void buttonClicked (Button *clicked_button) override
 Called when one of the incrementer buttons is clicked.
 

Detailed Description

A pair of buttons for incrementing and decrementing a Slider's value.

The IncrementerButtons class provides two small triangular arrow buttons, one for incrementing and one for decrementing the value of an associated Slider. When either button is pressed, the Slider's value is adjusted by one unit. The appearance of the buttons adapts to the currently active skin colors, and can be toggled active or inactive.

Constructor & Destructor Documentation

◆ IncrementerButtons()

IncrementerButtons::IncrementerButtons ( Slider * slider)
inline

Constructs the IncrementerButtons object.

Parameters
sliderA pointer to a Slider whose value will be modified when these buttons are pressed.

Member Function Documentation

◆ buttonClicked()

void IncrementerButtons::buttonClicked ( Button * clicked_button)
inlineoverride

Called when one of the incrementer buttons is clicked.

Parameters
clicked_buttonThe button that was clicked.

Increments or decrements the associated Slider's value by 1.0 depending on which button is clicked.

◆ paint()

void IncrementerButtons::paint ( Graphics & g)
inlineoverride

Paints the component background and updates button colors.

Parameters
gThe graphics context to use for painting.

◆ resized()

void IncrementerButtons::resized ( )
inlineoverride

Resizes and positions the increment and decrement buttons.

◆ setActive()

void IncrementerButtons::setActive ( bool active)
inline

Sets whether the incrementer buttons are active.

Parameters
activeTrue if active (enabled), false otherwise.

When inactive, the buttons can be visually indicated as disabled.


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