12#include <ds_value_base.h>
131 float mTrackProportion;
142 uint16_t mTrackWidth;
143 uint16_t mKnobDiameter;
151 uint32_t mTouchTimestamp;
156 uint8_t mCreatedTrackSurface: 1;
157 uint8_t mCreatedActiveTrackSurface: 1;
158 uint8_t mCreatedKnobSurface: 1;
159 uint8_t mIsInverted: 1;
160 uint8_t mIsTouchActive: 1;
163 uint8_t mTrackBorderThickness;
164 uint8_t mKnobBorderThickness;
167 void onPaint(
DsRenderer &renderer)
override final;
169 void onSizeChange(
void)
override final;
171 float onValueChange(
float value)
override final;
173 bool isPosInsideKnob(
const DsPoint &pos);
174 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
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
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
Definition ds_geometry.h:780
DsSlider is a class that represents a slider that can be used to adjust a value.
Definition ds_slider.h:23
void drawKnobSurface(void)
Creates a surface and pre-draws the knob.
void setKnobSurface(DsSurface *surface, uint32_t diameter)
Sets the surfaces used for drawing the knob.
void setTrackBorderThickness(uint8_t thickness)
Sets the track border thickness.
void setTrackBorderColor(DsColor color)
Sets the track border color.
void setKnobBorderColor(DsColor color)
Sets the knob border color.
void setKnobBorderThickness(uint8_t thickness)
Sets the knob border thickness.
void setTrackProportion(float proportion)
Sets proportion of the track width versus the knob diameter.
DsSlider(DsView *parent, const DsPoint &pos, const DsSize &size, bool inverted=false)
Creates a DsSlider object.
void setTrackColors(DsColor color, DsColor color_active)
Sets the track color.
void setTrackSurfaces(DsSurface *surface, DsSurface *surface_active)
Sets the surfaces used for drawing the track.
void setKnobColor(DsColor color)
Sets the knob color.
void drawTrackSurfaces(void)
Creates a surface and pre-draws the track.
DsSurface is a class that represents a drawing surface.
Definition ds_surface.h:30
DsValueBase is a base class that contains a float value.
Definition ds_value_base.h:19
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