73 RotaryHorizontalVerticalDrag,
124 Slider (SliderStyle style, TextEntryBoxPosition textBoxPosition);
135 void setSliderStyle (SliderStyle newStyle);
140 SliderStyle getSliderStyle() const noexcept;
170 void setRotaryParameters (
float startAngleRadians,
171 float endAngleRadians,
172 bool stopAtEnd)
noexcept;
183 void setMouseDragSensitivity (
int distanceForFullScaleDrag);
186 int getMouseDragSensitivity() const noexcept;
197 void setVelocityBasedMode (
bool isVelocityBased);
202 bool getVelocityBasedMode() const noexcept;
219 void setVelocityModeParameters (
double sensitivity = 1.0,
222 bool userCanPressKeyToSwapMode = true,
228 double getVelocitySensitivity() const noexcept;
233 int getVelocityThreshold() const noexcept;
238 double getVelocityOffset() const noexcept;
243 bool getVelocityModeIsSwappable() const noexcept;
264 void setSkewFactor (
double factor,
bool symmetricSkew = false);
273 void setSkewFactorFromMidPoint (
double sliderValueToShowAtMidPoint);
279 double getSkewFactor() const noexcept;
285 bool isSymmetricSkew() const noexcept;
292 incDecButtonsNotDraggable,
293 incDecButtonsDraggable_AutoDirection,
294 incDecButtonsDraggable_Horizontal,
295 incDecButtonsDraggable_Vertical
308 void setIncDecButtonsMode (IncDecButtonMode mode);
322 void setTextBoxStyle (TextEntryBoxPosition newPosition,
324 int textEntryBoxWidth,
325 int textEntryBoxHeight);
330 TextEntryBoxPosition getTextBoxPosition() const noexcept;
335 int getTextBoxWidth() const noexcept;
340 int getTextBoxHeight() const noexcept;
349 void setTextBoxIsEditable (
bool shouldBeEditable);
354 bool isTextBoxEditable() const noexcept;
370 void hideTextBox (
bool discardCurrentEditorContents);
388 void setValue (
double newValue,
NotificationType notification = sendNotificationAsync);
391 double getValue() const;
399 Value& getValueObject() noexcept;
409 void setRange (
double newMinimum,
411 double newInterval = 0);
419 void setRange (
Range<
double> newRange,
double newInterval);
431 Range<
double> getRange() const noexcept;
436 double getMaximum() const noexcept;
441 double getMinimum() const noexcept;
446 double getInterval() const noexcept;
457 double getMinValue() const;
465 Value& getMinValueObject() noexcept;
486 void setMinValue (
double newValue,
488 bool allowNudgingOfOtherValues = false);
498 double getMaxValue() const;
506 Value& getMaxValueObject() noexcept;
527 void setMaxValue (
double newValue,
529 bool allowNudgingOfOtherValues = false);
547 void setMinAndMaxValues (
double newMinValue,
double newMaxValue,
595 void addListener (Listener* listener);
598 void removeListener (Listener* listener);
627 void setDoubleClickReturnValue (
bool shouldDoubleClickBeEnabled,
628 double valueToSetOnDoubleClick,
629 ModifierKeys singleClickModifiers = ModifierKeys::altModifier);
634 double getDoubleClickReturnValue() const noexcept;
639 bool isDoubleClickReturnEnabled() const noexcept;
650 void setChangeNotificationOnlyOnRelease (
bool onlyNotifyOnRelease);
661 void setSliderSnapsToMousePosition (
bool shouldSnapToMouse);
664 bool getSliderSnapsToMousePosition() const noexcept;
682 void setPopupDisplayEnabled (
bool shouldShowOnMouseDrag,
683 bool shouldShowOnMouseHover,
685 int hoverTimeout = 2000);
691 Component* getCurrentPopupDisplay() const noexcept;
700 void setPopupMenuEnabled (
bool menuEnabled);
705 void setScrollWheelEnabled (
bool enabled);
708 bool isScrollWheelEnabled() const noexcept;
715 int getThumbBeingDragged() const noexcept;
721 virtual
void startedDragging();
726 virtual
void stoppedDragging();
731 virtual
void valueChanged();
742 virtual
double getValueFromText (const
String& text);
754 virtual
String getTextFromValue (
double value);
763 void setTextValueSuffix (const
String& suffix);
766 String getTextValueSuffix() const;
775 int getNumDecimalPlacesToDisplay() const noexcept;
782 void setNumDecimalPlacesToDisplay (
int decimalPlacesToDisplay);
796 virtual
double proportionOfLengthToValue (
double proportion);
811 virtual
double valueToProportionOfLength (
double value);
822 float getPositionOfValue (
double value) const;
837 virtual
double snapValue (
double attemptedValue,
DragMode dragMode);
847 bool isHorizontal() const noexcept;
849 bool isVertical() const noexcept;
851 bool isRotary() const noexcept;
853 bool isBar() const noexcept;
855 bool isTwoValue() const noexcept;
857 bool isThreeValue() const noexcept;
869 backgroundColourId = 0x1001200,
870 thumbColourId = 0x1001300,
872 trackColourId = 0x1001310,
873 rotarySliderFillColourId = 0x1001311,
874 rotarySliderOutlineColourId = 0x1001312,
876 textBoxTextColourId = 0x1001400,
877 textBoxBackgroundColourId = 0x1001500,
878 textBoxHighlightColourId = 0x1001600,
879 textBoxOutlineColourId = 0x1001700
907 Slider& sliderBeingDragged;
922 virtual void drawLinearSlider (
Graphics&,
923 int x,
int y,
int width,
int height,
930 virtual void drawLinearSliderBackground (
Graphics&,
931 int x,
int y,
int width,
int height,
938 virtual void drawLinearSliderOutline (
Graphics&,
939 int x,
int y,
int width,
int height,
943 virtual void drawLinearSliderThumb (
Graphics&,
944 int x,
int y,
int width,
int height,
951 virtual int getSliderThumbRadius (
Slider&) = 0;
953 virtual void drawRotarySlider (
Graphics&,
954 int x,
int y,
int width,
int height,
955 float sliderPosProportional,
956 float rotaryStartAngle,
957 float rotaryEndAngle,
960 virtual Button* createSliderButton (
Slider&,
bool isIncrement) = 0;
965 virtual Font getSliderPopupFont (
Slider&) = 0;
966 virtual int getSliderPopupPlacement (
Slider&) = 0;
975 void resized()
override;
983 void mouseDoubleClick (
const MouseEvent&)
override;
987 void modifierKeysChanged (
const ModifierKeys&)
override;
989 void lookAndFeelChanged()
override;
991 void enablementChanged()
override;
995 void colourChanged()
override;
1001 void mouseEnter (
const MouseEvent&)
override;
1003 bool keyPressed (
const KeyPress&)
override;
1010 [[deprecated]]
void setValue (
double,
bool);
1011 [[deprecated]]
void setValue (
double,
bool,
bool);
1012 [[deprecated]]
void setMinValue (
double,
bool,
bool,
bool);
1013 [[deprecated]]
void setMinValue (
double,
bool,
bool);
1014 [[deprecated]]
void setMinValue (
double,
bool);
1015 [[deprecated]]
void setMaxValue (
double,
bool,
bool,
bool);
1016 [[deprecated]]
void setMaxValue (
double,
bool,
bool);
1017 [[deprecated]]
void setMaxValue (
double,
bool);
1018 [[deprecated]]
void setMinAndMaxValues (
double,
double,
bool,
bool);
1019 [[deprecated]]
void setMinAndMaxValues (
double,
double,
bool);
1024 JUCE_PUBLIC_IN_DLL_BUILD (
class Pimpl)
The base class for all JUCE user-interface objects.
FocusChangeType
Enumeration used by the focusGained() and focusLost() methods.
Represents a particular font, including its size, style, etc.
A graphics context, used for drawing a component or image.
A graphical effect filter that can be applied to components.
Represents a key press, including any modifier keys that are needed.
A component that displays a text string, and can optionally become a text editor when clicked.
Represents the state of the mouse buttons and modifier keys.
Contains position and status information about a mouse event.
Represents a mapping between an arbitrary range of values and a normalised 0->1 range.
A general-purpose range object, that simply represents any linear range with a start and end point.
Manages a rectangle and allows geometric operations to be performed on it.
A class for receiving callbacks from a Slider.
virtual void sliderDragEnded(Slider *)
Called after a drag operation has finished.
virtual ~Listener()=default
Destructor.
virtual void sliderDragStarted(Slider *)
Called when the slider is about to be dragged.
virtual void sliderValueChanged(Slider *slider)=0
Called when the slider's value is changed.
An RAII class for sending slider listener drag messages.
A slider control for changing a value.
DragMode
Describes the type of mouse-dragging that is happening when a value is being changed.
@ notDragging
Dragging is not active.
@ absoluteDrag
The dragging corresponds directly to the value that is displayed.
std::function< void()> onDragStart
You can assign a lambda to this callback object to have it called when the slider's drag begins.
std::function< void()> onValueChange
You can assign a lambda to this callback object to have it called when the slider value is changed.
IncDecButtonMode
Used by setIncDecButtonsMode().
std::function< String(double)> textFromValueFunction
You can assign a lambda that will be used to convert the slider's normalised position to a textual va...
float startAngleRadians
The angle (in radians, clockwise from the top) at which the slider's minimum value is represented.
std::function< void()> onDragEnd
You can assign a lambda to this callback object to have it called when the slider's drag ends.
SliderStyle
The types of slider available.
@ LinearBarVertical
A vertical bar slider with the text label drawn on top of it.
@ IncDecButtons
A pair of buttons that increment or decrement the slider's value by the increment set in setRange().
@ LinearBar
A horizontal bar slider with the text label drawn on top of it.
@ LinearHorizontal
A traditional horizontal slider.
@ LinearVertical
A traditional vertical slider.
float endAngleRadians
The angle (in radians, clockwise from the top) at which the slider's maximum value is represented.
bool stopAtEnd
Determines what happens when a circular drag action rotates beyond the minimum or maximum angle.
std::function< double(const String &)> valueFromTextFunction
You can assign a lambda that will be used to convert textual values to the slider's normalised positi...
ColourIds
A set of colour IDs to use to change the colour of various aspects of the slider.
TextEntryBoxPosition
The position of the slider's text-entry box.
@ TextBoxRight
Puts the text box to the right of the slider, vertically centred.
@ NoTextBox
Doesn't display a text box.
@ TextBoxAbove
Puts the text box above the slider, horizontally centred.
@ TextBoxLeft
Puts the text box to the left of the slider, vertically centred.
Structure defining rotary parameters for a slider.
A struct defining the placement of the slider area and the text box area relative to the bounds of th...
Represents a shared variant value.
NotificationType
These enums are used in various classes to indicate whether a notification event should be sent out.
Contains status information about a mouse wheel event.
This abstract base class is implemented by LookAndFeel classes to provide slider drawing functionalit...