openshot-audio  0.1.7
Public Types | Public Member Functions | Protected Member Functions | List of all members
BooleanPropertyComponent Class Reference

#include <juce_BooleanPropertyComponent.h>

Inheritance diagram for BooleanPropertyComponent:
Button::Listener

Public Types

enum  ColourIds { backgroundColourId = 0x100e801, outlineColourId = 0x100e803 }
 

Public Member Functions

 BooleanPropertyComponent (const Value &valueToControl, const String &propertyName, const String &buttonText)
 
 ~BooleanPropertyComponent ()
 
virtual void setState (bool newState)
 
virtual bool getState () const
 
void paint (Graphics &) override
 
void refresh () override
 
void buttonClicked (Button *) override
 

Protected Member Functions

 BooleanPropertyComponent (const String &propertyName, const String &buttonTextWhenTrue, const String &buttonTextWhenFalse)
 

Detailed Description

A PropertyComponent that contains an on/off toggle button.

This type of property component can be used if you have a boolean value to toggle on/off.

See Also
PropertyComponent

Member Enumeration Documentation

A set of colour IDs to use to change the colour of various aspects of the component.

These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.

See Also
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator
backgroundColourId 

The colour to fill the background of the button area.

outlineColourId 

The colour to use to draw an outline around the text area.

Constructor & Destructor Documentation

BooleanPropertyComponent::BooleanPropertyComponent ( const String propertyName,
const String buttonTextWhenTrue,
const String buttonTextWhenFalse 
)
protected

Creates a button component.

If you use this constructor, you must override the getState() and setState() methods.

Parameters
propertyNamethe property name to be passed to the PropertyComponent
buttonTextWhenTruethe text shown in the button when the value is true
buttonTextWhenFalsethe text shown in the button when the value is false
BooleanPropertyComponent::BooleanPropertyComponent ( const Value valueToControl,
const String propertyName,
const String buttonText 
)

Creates a button component.

Note that if you call this constructor then you must use the Value to interact with the button state, and you can't override the class with your own setState or getState methods. If you want to use getState and setState, call the other constructor instead.

Parameters
valueToControla Value object that this property should refer to.
propertyNamethe property name to be passed to the PropertyComponent
buttonTextthe text shown in the ToggleButton component
BooleanPropertyComponent::~BooleanPropertyComponent ( )

Destructor.

Member Function Documentation

void BooleanPropertyComponent::buttonClicked ( Button )
overridevirtual

Called when the button is clicked.

Implements Button::Listener.

bool BooleanPropertyComponent::getState ( ) const
virtual

Must return the current value of the property.

void BooleanPropertyComponent::paint ( Graphics g)
override
void BooleanPropertyComponent::refresh ( )
override
void BooleanPropertyComponent::setState ( bool  newState)
virtual

Called to change the state of the boolean value.


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