JM9 XRCU Board 0.2.0a
Libraries API Reference
Loading...
Searching...
No Matches
Scrollbar.h
1#ifndef DSGC_SCROLLBAR_H
2#define DSGC_SCROLLBAR_H
3
4#include "Component.h"
5
6namespace dsgc {
7 class Scrollbar : public Component {
8 private:
9 unsigned int knobAccessibleLength;
10 unsigned int knobLength;
11 float knobRelativePosition;
12 protected:
13 Scrollbar(Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int trackLength, double knobRelativeSize);
14 unsigned int getKnobLength();
15 unsigned int getKnobPositionOffset();
16
22 virtual unsigned int getKnobX();
28 virtual unsigned int getKnobY();
35 virtual unsigned int getKnobWidth();
42 virtual unsigned int getKnobHeight();
43
44 static const unsigned int KNOB_RADIUS;
45 static const unsigned int KNOB_WIDTH;
46 static const unsigned int BORDER_RADIUS;
47 static const unsigned int BORDER_WIDTH;
48 public:
49 virtual void paint() override;
50
56 void setKnobRelativePosition(float relativePosition);
57
63 };
64}
65
66#endif // #ifndef DSGC_SCROLLBAR_H
Definition Adafruit_GFX.h:18
virtual void paint() override
Paints this component.
virtual unsigned int getKnobY()
Gets the y-coordinate of the top-left corner of the knob.
virtual unsigned int getKnobWidth()
Gets the width of the knob.
void setKnobRelativePosition(float relativePosition)
Sets the relative position of the knob in this scrollbar.
float getKnobRelativePosition()
Gets the relative position of the knob in this scrollbar.
virtual unsigned int getKnobHeight()
Gets the height of the knob.
virtual unsigned int getKnobX()
Gets the x-coordinate of the top-left corner of the knob.