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

A ToggleButton that uses an OpenGlButtonComponent for its rendering. More...

#include <synth_button.h>

Inheritance diagram for OpenGlToggleButton:
ExpandModulationButton SynthButton BypassButton

Public Member Functions

 OpenGlToggleButton (String name)
 
OpenGlButtonComponentgetGlComponent ()
 
void setActive (bool active=true)
 
bool isActive () const
 
void resized () override
 Called when the button is resized, adjusts text size and colors accordingly.
 
void setText (String text)
 
void setPowerButton ()
 Configures the button as a power button.
 
void setNoBackground ()
 Removes the background, showing just text.
 
void setJustification (Justification justification)
 
void setLightenButton ()
 Configures the button as a lighten button.
 
void setShowOnColors (bool show)
 
void setUiButton (bool primary)
 
virtual void enablementChanged () override
 Called when the button enablement changes.
 
void mouseEnter (const MouseEvent &e) override
 
void mouseExit (const MouseEvent &e) override
 
void mouseDown (const MouseEvent &e) override
 
void mouseUp (const MouseEvent &e) override
 

Detailed Description

A ToggleButton that uses an OpenGlButtonComponent for its rendering.

It supports various styles and uses OpenGL for drawing, making it suitable for modern UIs.

Constructor & Destructor Documentation

◆ OpenGlToggleButton()

OpenGlToggleButton::OpenGlToggleButton ( String name)
inline

Constructor.

Parameters
nameThe name of the toggle button.

Member Function Documentation

◆ enablementChanged()

virtual void OpenGlToggleButton::enablementChanged ( )
inlineoverridevirtual

Called when the button enablement changes.

◆ getGlComponent()

OpenGlButtonComponent * OpenGlToggleButton::getGlComponent ( )
inline

Retrieves the underlying OpenGL component.

Returns
A pointer to the OpenGlButtonComponent.

◆ isActive()

bool OpenGlToggleButton::isActive ( ) const
inline

Checks if the button is active.

Returns
True if active, otherwise false.

◆ mouseDown()

void OpenGlToggleButton::mouseDown ( const MouseEvent & e)
inlineoverride

Called when the mouse is pressed down on the button.

Parameters
eThe mouse event.

◆ mouseEnter()

void OpenGlToggleButton::mouseEnter ( const MouseEvent & e)
inlineoverride

Called when the mouse enters the button area.

Parameters
eThe mouse event.

◆ mouseExit()

void OpenGlToggleButton::mouseExit ( const MouseEvent & e)
inlineoverride

Called when the mouse leaves the button area.

Parameters
eThe mouse event.

◆ mouseUp()

void OpenGlToggleButton::mouseUp ( const MouseEvent & e)
inlineoverride

Called when the mouse is released from the button.

Parameters
eThe mouse event.

◆ resized()

void OpenGlToggleButton::resized ( )
override

Called when the button is resized, adjusts text size and colors accordingly.

Called when the OpenGlToggleButton is resized, adjusts text size and updates colors.

◆ setActive()

void OpenGlToggleButton::setActive ( bool active = true)
inline

Sets the active state of the button.

Parameters
activeTrue if active, false otherwise.

◆ setJustification()

void OpenGlToggleButton::setJustification ( Justification justification)
inline

Sets the text justification mode.

Parameters
justificationThe JUCE Justification mode.

◆ setLightenButton()

void OpenGlToggleButton::setLightenButton ( )
inline

Configures the button as a lighten button.

◆ setNoBackground()

void OpenGlToggleButton::setNoBackground ( )
inline

Removes the background, showing just text.

◆ setPowerButton()

void OpenGlToggleButton::setPowerButton ( )
inline

Configures the button as a power button.

◆ setShowOnColors()

void OpenGlToggleButton::setShowOnColors ( bool show)
inline

Toggles showing on-colors when toggled on.

Parameters
showTrue to show on-colors, otherwise off-colors.

◆ setText()

void OpenGlToggleButton::setText ( String text)
inline

Sets the text to be displayed on the button.

Parameters
textThe text to set.

◆ setUiButton()

void OpenGlToggleButton::setUiButton ( bool primary)
inline

Configures the button as a UI button.

Parameters
primaryTrue if this is a primary UI button.

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