2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_SLIDERPROPERTYCOMPONENT_JUCEHEADER__
27 #define __JUCE_SLIDERPROPERTYCOMPONENT_JUCEHEADER__
29 #include "juce_PropertyComponent.h"
30 #include "../controls/juce_Slider.h"
33 //==============================================================================
35 A PropertyComponent that shows its value as a slider.
37 @see PropertyComponent, Slider
39 class JUCE_API SliderPropertyComponent
: public PropertyComponent
,
40 private SliderListener
// (can't use Slider::Listener due to idiotic VC2005 bug)
43 //==============================================================================
44 /** Creates the property component.
46 The ranges, interval and skew factor are passed to the Slider component.
48 If you need to customise the slider in other ways, your constructor can
49 access the slider member variable and change it directly.
51 SliderPropertyComponent (const String
& propertyName
,
55 double skewFactor
= 1.0);
58 //==============================================================================
59 /** Creates the property component.
61 The ranges, interval and skew factor are passed to the Slider component.
63 If you need to customise the slider in other ways, your constructor can
64 access the slider member variable and change it directly.
66 SliderPropertyComponent (const Value
& valueToControl
,
67 const String
& propertyName
,
71 double skewFactor
= 1.0);
74 ~SliderPropertyComponent();
77 //==============================================================================
78 /** Called when the user moves the slider to change its value.
80 Your subclass must use this method to update whatever item this property
83 virtual void setValue (double newValue
);
85 /** Returns the value that the slider should show. */
86 virtual double getValue() const;
89 //==============================================================================
93 void sliderValueChanged (Slider
*);
96 /** The slider component being used in this component.
97 Your subclass has access to this in case it needs to customise it in some way.
102 //==============================================================================
103 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderPropertyComponent
);
107 #endif // __JUCE_SLIDERPROPERTYCOMPONENT_JUCEHEADER__