openshot-audio  0.1.7
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
PropertyComponent Class Referenceabstract

#include <juce_PropertyComponent.h>

Inheritance diagram for PropertyComponent:
SettableTooltipClient TooltipClient ProcessorParameterPropertyComp TextPropertyComponent

Classes

struct  LookAndFeelMethods
 

Public Types

enum  ColourIds { backgroundColourId = 0x1008300, labelTextColourId = 0x1008301 }
 

Public Member Functions

 PropertyComponent (const String &propertyName, int preferredHeight=25)
 
 ~PropertyComponent ()
 
int getPreferredHeight () const noexcept
 
void setPreferredHeight (int newHeight) noexcept
 
virtual void refresh ()=0
 
void paint (Graphics &) override
 
void resized () override
 
void enablementChanged () override
 
- Public Member Functions inherited from SettableTooltipClient
virtual ~SettableTooltipClient ()
 
virtual void setTooltip (const String &newTooltip)
 
virtual String getTooltip ()
 
- Public Member Functions inherited from TooltipClient
virtual ~TooltipClient ()
 

Protected Attributes

int preferredHeight
 

Additional Inherited Members

- Protected Member Functions inherited from SettableTooltipClient
 SettableTooltipClient ()
 

Detailed Description

A base class for a component that goes in a PropertyPanel and displays one of an item's properties.

Subclasses of this are used to display a property in various forms, e.g. a ChoicePropertyComponent shows its value as a combo box; a SliderPropertyComponent shows its value as a slider; a TextPropertyComponent as a text box, etc.

A subclass must implement the refresh() method which will be called to tell the component to update itself, and is also responsible for calling this it when the item that it refers to is changed.

See Also
PropertyPanel, TextPropertyComponent, SliderPropertyComponent, ChoicePropertyComponent, ButtonPropertyComponent, BooleanPropertyComponent

Member Enumeration Documentation

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

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 background colour to fill the component with.

labelTextColourId 

The colour for the property's label text.

Constructor & Destructor Documentation

PropertyComponent::PropertyComponent ( const String propertyName,
int  preferredHeight = 25 
)

Creates a PropertyComponent.

Parameters
propertyNamethe name is stored as this component's name, and is used as the name displayed next to this component in a property panel
preferredHeightthe height that the component should be given - some items may need to be larger than a normal row height. This value can also be set if a subclass changes the preferredHeight member variable.
PropertyComponent::~PropertyComponent ( )

Destructor.

Member Function Documentation

void PropertyComponent::enablementChanged ( )
override

By default, this just repaints the component.

int PropertyComponent::getPreferredHeight ( ) const
inlinenoexcept

Returns this item's preferred height.

This value is specified either in the constructor or by a subclass changing the preferredHeight member variable.

void PropertyComponent::paint ( Graphics g)
override

The default paint method fills the background and draws a label for the item's name.

See Also
LookAndFeel::drawPropertyComponentBackground(), LookAndFeel::drawPropertyComponentLabel()
virtual void PropertyComponent::refresh ( )
pure virtual

Updates the property component if the item it refers to has changed.

A subclass must implement this method, and other objects may call it to force it to refresh itself.

The subclass should be economical in the amount of work is done, so for example it should check whether it really needs to do a repaint rather than just doing one every time this method is called, as it may be called when the value being displayed hasn't actually changed.

Implemented in TextPropertyComponent, and ProcessorParameterPropertyComp.

void PropertyComponent::resized ( )
override

The default resize method positions any child component to the right of this one, based on the look and feel's default label size.

void PropertyComponent::setPreferredHeight ( int  newHeight)
inlinenoexcept

Member Data Documentation

int PropertyComponent::preferredHeight
protected

Used by the PropertyPanel to determine how high this component needs to be. A subclass can update this value in its constructor but shouldn't alter it later as changes won't necessarily be picked up.


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