5#ifndef INCLUDE_FIFECHAN_WIDGETS_SLIDER_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_SLIDER_HPP_
12#include "fifechan/platform.hpp"
15#include "fifechan/listeners/keylistener.hpp"
16#include "fifechan/listeners/mouselistener.hpp"
17#include "fifechan/widget.hpp"
52 explicit Slider(
double scaleEnd = 1.0);
60 Slider(
double scaleStart,
double scaleEnd);
76 void setScale(
double scaleStart,
double scaleEnd);
84 double getScaleStart()
const;
92 void setScaleStart(
double scaleStart);
100 double getScaleEnd()
const;
108 void setScaleEnd(
double scaleEnd);
116 double getValue()
const;
124 void setValue(
double value);
132 void setMarkerLength(
int length);
140 int getMarkerLength()
const;
150 void setOrientation(Orientation orientation);
160 Orientation getOrientation()
const;
171 void setStepLength(
double length);
182 double getStepLength()
const;
186 void draw(
Graphics* graphics)
override;
190 void mousePressed(
MouseEvent& mouseEvent)
override;
191 void mouseDragged(
MouseEvent& mouseEvent)
override;
192 void mouseWheelMovedUp(
MouseEvent& mouseEvent)
override;
193 void mouseWheelMovedDown(
MouseEvent& mouseEvent)
override;
194 void mouseWheelMovedRight(
MouseEvent& mouseEvent)
override;
195 void mouseWheelMovedLeft(
MouseEvent& mouseEvent)
override;
199 void keyPressed(
KeyEvent& keyEvent)
override;
207 virtual void drawMarker(
Graphics* graphics);
216 virtual double markerPositionToValue(
int position)
const;
225 virtual int valueToMarkerPosition(
double value)
const;
232 virtual int getMarkerPosition()
const;
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
KeyListener(KeyListener const &)=default
Copy constructor.
Represents a mouse event.
MouseListener(MouseListener const &)=default
Copy constructor.
A control for selecting a numeric value by sliding along a scale.
double mValue
Holds the current selected value.
Slider(double scaleEnd=1.0)
Constructor.
double mStepLength
Holds the step length.
Orientation
Draw orientations for the slider.
double mScaleEnd
Holds the end value of the scale.
Orientation mOrientation
Holds the orientation of the slider.
double mScaleStart
Holds the start value of the scale.
bool mDragged
True if the slider is dragged, false otherwise.
int mMarkerLength
Holds the length of the marker.
Used replacement tokens by configure_file():