Public Member Functions | Protected Member Functions | Protected Attributes

SliderPropertyComponent Class Reference

A PropertyComponent that shows its value as a slider. More...

Inherits PropertyComponent, and Slider::Listener.

List of all members.

Public Member Functions

 SliderPropertyComponent (const Value &valueToControl, const String &propertyName, double rangeMin, double rangeMax, double interval, double skewFactor=1.0)
 Creates the property component.
 ~SliderPropertyComponent ()
 Destructor.
virtual void setValue (double newValue)
 Called when the user moves the slider to change its value.
virtual double getValue () const
 Returns the value that the slider should show.
void refresh ()
 Updates the property component if the item it refers to has changed.
void sliderValueChanged (Slider *)
 Called when the slider's value is changed.

Protected Member Functions

 SliderPropertyComponent (const String &propertyName, double rangeMin, double rangeMax, double interval, double skewFactor=1.0)
 Creates the property component.

Protected Attributes

Slider slider
 The slider component being used in this component.

Detailed Description

A PropertyComponent that shows its value as a slider.

See also:
PropertyComponent, Slider

Constructor & Destructor Documentation

SliderPropertyComponent::SliderPropertyComponent ( const String propertyName,
double  rangeMin,
double  rangeMax,
double  interval,
double  skewFactor = 1.0 
) [protected]

Creates the property component.

The ranges, interval and skew factor are passed to the Slider component.

If you need to customise the slider in other ways, your constructor can access the slider member variable and change it directly.

SliderPropertyComponent::SliderPropertyComponent ( const Value valueToControl,
const String propertyName,
double  rangeMin,
double  rangeMax,
double  interval,
double  skewFactor = 1.0 
)

Creates the property component.

The ranges, interval and skew factor are passed to the Slider component.

If you need to customise the slider in other ways, your constructor can access the slider member variable and change it directly.

SliderPropertyComponent::~SliderPropertyComponent (  )

Destructor.


Member Function Documentation

virtual void SliderPropertyComponent::setValue ( double  newValue ) [virtual]

Called when the user moves the slider to change its value.

Your subclass must use this method to update whatever item this property represents.

virtual double SliderPropertyComponent::getValue (  ) const [virtual]

Returns the value that the slider should show.

void SliderPropertyComponent::refresh (  ) [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.

Implements PropertyComponent.

void SliderPropertyComponent::sliderValueChanged ( Slider slider ) [virtual]

Called when the slider's value is changed.

This may be caused by dragging it, or by typing in its text entry box, or by a call to Slider::setValue().

You can find out the new value using Slider::getValue().

See also:
Slider::valueChanged

Implements Slider::Listener.


Member Data Documentation

The slider component being used in this component.

Your subclass has access to this in case it needs to customise it in some way.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines