7#ifndef _DS_DISCRETE_SLIDER_H
8#define _DS_DISCRETE_SLIDER_H
12#include <ds_selection_base.h>
115 float mTrackProportion;
126 uint16_t mTrackWidth;
127 uint16_t mKnobDiameter;
135 uint32_t mTouchTimestamp;
140 uint8_t mIsInverted: 1;
141 uint8_t mIsTouchActive: 1;
144 uint8_t mTrackBorderThickness;
145 uint8_t mKnobBorderThickness;
148 void onPaint(
DsRenderer &renderer)
override final;
150 void onSizeChange(
void)
override final;
152 int32_t onSelectionChange(int32_t selection)
override final;
154 bool isPosInsideKnob(
const DsPoint &pos);
155 DsRect updateKnobPosition(int32_t new_knob_pos);
DsColor is a class that represents a 4 channel color (Alpha, Red, Green, Blue).
Definition ds_color.h:53
DsDiscreteSlider is a class that represents a slider that can be used to adjust a value in discrete s...
Definition ds_discrete_slider.h:23
void setTrackBorderColor(DsColor color)
Sets the track border color.
void setKnobColor(DsColor color)
Sets the knob color.
void setKnobBorderColor(DsColor color)
Sets the knob border color.
void setTrackProportion(float proportion)
Sets proportion of the track width versus the knob diameter.
~DsDiscreteSlider()
Destructor.
void setKnobSurface(DsSurface *surface, uint32_t diameter)
Sets the surfaces used for drawing the knob.
void setTrackSurfaces(DsSurface *surface, DsSurface *surface_active)
Sets the surfaces used for drawing the track.
void setTrackColors(DsColor color, DsColor color_active)
Sets the track color.
DsDiscreteSlider(DsView *parent, const DsPoint &pos, const DsSize &size, uint32_t stops, bool inverted=false)
Creates a DsSlider object.
void setKnobBorderThickness(uint8_t thickness)
Sets the knob border thickness.
void setTrackBorderThickness(uint8_t thickness)
Sets the track border thickness.
DsPoint is a class that represents the X and Y 2D coordinates of a point as integer numbers.
Definition ds_geometry.h:24
DsRect is a class that represents a 2D rectangle (X, Y, W, H)
Definition ds_geometry.h:1507
DsRenderer is a class that implements all the drawing operations.
Definition ds_renderer.h:42
DsSelectionBase is a base class that contains a selection value.
Definition ds_selection_base.h:19
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
Definition ds_geometry.h:780
DsSurface is a class that represents a drawing surface.
Definition ds_surface.h:30
DsView is a base class that represents any view on the screen.
Definition ds_view.h:40
This structure implements a touch event.
Definition ds_event.h:25