5#ifndef INCLUDE_FIFECHAN_WIDGETS_SLIDER_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_SLIDER_HPP_
10#include "fifechan/keylistener.hpp"
11#include "fifechan/mouselistener.hpp"
12#include "fifechan/platform.hpp"
13#include "fifechan/widget.hpp"
27 class FIFEGUI_API
Slider :
public Widget,
public MouseListener,
public KeyListener
45 explicit Slider(
double scaleEnd = 1.0);
53 Slider(
double scaleStart,
double scaleEnd);
69 void setScale(
double scaleStart,
double scaleEnd);
77 double getScaleStart()
const;
85 void setScaleStart(
double scaleStart);
93 double getScaleEnd()
const;
101 void setScaleEnd(
double scaleEnd);
109 double getValue()
const;
117 void setValue(
double value);
125 void setMarkerLength(
int length);
133 int getMarkerLength()
const;
142 void setOrientation(Orientation orientation);
151 Orientation getOrientation()
const;
160 void setStepLength(
double length);
169 double getStepLength()
const;
173 void draw(
Graphics* graphics)
override;
177 void mousePressed(
MouseEvent& mouseEvent)
override;
178 void mouseDragged(
MouseEvent& mouseEvent)
override;
179 void mouseWheelMovedUp(
MouseEvent& mouseEvent)
override;
180 void mouseWheelMovedDown(
MouseEvent& mouseEvent)
override;
181 void mouseWheelMovedRight(
MouseEvent& mouseEvent)
override;
182 void mouseWheelMovedLeft(
MouseEvent& mouseEvent)
override;
186 void keyPressed(
KeyEvent& keyEvent)
override;
194 virtual void drawMarker(
Graphics* graphics);
203 virtual double markerPositionToValue(
int position)
const;
212 virtual int valueToMarkerPosition(
double value)
const;
219 virtual int getMarkerPosition()
const;
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Represents a mouse event.
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.