2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
23 ==============================================================================
29 //==============================================================================
31 A PropertyComponent that shows its value as a slider.
33 @see PropertyComponent, Slider
37 class JUCE_API SliderPropertyComponent
: public PropertyComponent
40 //==============================================================================
41 /** Creates the property component.
43 The ranges, interval and skew factor are passed to the Slider component.
45 If you need to customise the slider in other ways, your constructor can
46 access the slider member variable and change it directly.
48 SliderPropertyComponent (const String
& propertyName
,
52 double skewFactor
= 1.0,
53 bool symmetricSkew
= false);
56 //==============================================================================
57 /** Creates the property component.
59 The ranges, interval and skew factor are passed to the Slider component.
61 If you need to customise the slider in other ways, your constructor can
62 access the slider member variable and change it directly.
64 Note that if you call this constructor then you must use the Value to interact with
65 the value, and you can't override the class with your own setValue or getValue methods.
66 If you want to use those methods, call the other constructor instead.
68 SliderPropertyComponent (const Value
& valueToControl
,
69 const String
& propertyName
,
73 double skewFactor
= 1.0,
74 bool symmetricSkew
= false);
77 ~SliderPropertyComponent() override
;
80 //==============================================================================
81 /** Called when the user moves the slider to change its value.
83 Your subclass must use this method to update whatever item this property
86 virtual void setValue (double newValue
);
88 /** Returns the value that the slider should show. */
89 virtual double getValue() const;
92 //==============================================================================
94 void refresh() override
;
97 /** The slider component being used in this component.
98 Your subclass has access to this in case it needs to customise it in some way.
103 //==============================================================================
104 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderPropertyComponent
)