openshot-audio  0.1.7
Classes | Public Types | Public Member Functions | Friends | List of all members
juce::ColourSelector Class Reference

#include <juce_gui_extra.h>

Inheritance diagram for juce::ColourSelector:
juce::Slider::Listener

Classes

class  ColourComponentSlider
 
class  ColourSpaceMarker
 
class  ColourSpaceView
 
class  HueSelectorComp
 
class  HueSelectorMarker
 
class  SwatchComponent
 

Public Types

enum  ColourSelectorOptions { showAlphaChannel = 1 << 0, showColourAtTop = 1 << 1, showSliders = 1 << 2, showColourspace = 1 << 3 }
 
enum  ColourIds { backgroundColourId = 0x1007000, labelTextColourId = 0x1007001 }
 

Public Member Functions

 ColourSelector (int flags=(showAlphaChannel|showColourAtTop|showSliders|showColourspace), int edgeGap=4, int gapAroundColourSpaceComponent=7)
 
 ~ColourSelector ()
 
Colour getCurrentColour () const
 
void setCurrentColour (Colour newColour)
 
virtual int getNumSwatches () const
 
virtual Colour getSwatchColour (int index) const
 
virtual void setSwatchColour (int index, const Colour &newColour) const
 

Friends

class ColourSpaceView
 
struct ContainerDeletePolicy< ColourSpaceView >
 
class HueSelectorComp
 
struct ContainerDeletePolicy< HueSelectorComp >
 

Additional Inherited Members

- Protected Member Functions inherited from juce::Slider::Listener
virtual ~Listener ()
 
virtual void sliderDragStarted (Slider *)
 
virtual void sliderDragEnded (Slider *)
 

Detailed Description

A component that lets the user choose a colour.

This shows RGB sliders and a colourspace that the user can pick colours from.

This class is also a ChangeBroadcaster, so listeners can register to be told when the colour changes.

Member Enumeration Documentation

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

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 used to fill the component's background.

labelTextColourId 

the colour used for the labels next to the sliders.

Options for the type of selector to show. These are passed into the constructor.

Enumerator
showAlphaChannel 

if set, the colour's alpha channel can be changed as well as its RGB.

showColourAtTop 

if set, a swatch of the colour is shown at the top of the component.

showSliders 

if set, RGB sliders are shown at the bottom of the component.

showColourspace 

if set, a big HSV selector is shown.

Constructor & Destructor Documentation

ColourSelector::ColourSelector ( int  flags = (showAlphaChannel | showColourAtTop | showSliders | showColourspace),
int  edgeGap = 4,
int  gapAroundColourSpaceComponent = 7 
)

Creates a ColourSelector object.

The flags are a combination of values from the ColourSelectorOptions enum, specifying which of the selector's features should be visible.

The edgeGap value specifies the amount of space to leave around the edge.

gapAroundColourSpaceComponent indicates how much of a gap to put around the colourspace and hue selector components.

ColourSelector::~ColourSelector ( )

Destructor.

Member Function Documentation

Colour ColourSelector::getCurrentColour ( ) const

Returns the colour that the user has currently selected.

The ColourSelector class is also a ChangeBroadcaster, so listeners can register to be told when the colour changes.

See Also
setCurrentColour
int ColourSelector::getNumSwatches ( ) const
virtual

Tells the selector how many preset colour swatches you want to have on the component.

To enable swatches, you'll need to override getNumSwatches(), getSwatchColour(), and setSwatchColour(), to return the number of colours you want, and to set and retrieve their values.

Colour ColourSelector::getSwatchColour ( int  index) const
virtual

Called by the selector to find out the colour of one of the swatches.

Your subclass should return the colour of the swatch with the given index.

To enable swatches, you'll need to override getNumSwatches(), getSwatchColour(), and setSwatchColour(), to return the number of colours you want, and to set and retrieve their values.

void ColourSelector::setCurrentColour ( Colour  newColour)

Changes the colour that is currently being shown.

void ColourSelector::setSwatchColour ( int  index,
const Colour newColour 
) const
virtual

Called by the selector when the user puts a new colour into one of the swatches.

Your subclass should change the colour of the swatch with the given index.

To enable swatches, you'll need to override getNumSwatches(), getSwatchColour(), and setSwatchColour(), to return the number of colours you want, and to set and retrieve their values.

Friends And Related Function Documentation

friend class ColourSpaceView
friend
friend struct ContainerDeletePolicy< ColourSpaceView >
friend
friend struct ContainerDeletePolicy< HueSelectorComp >
friend
friend class HueSelectorComp
friend

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