JM9 XRCU Board 0.2.0a
Libraries API Reference
Loading...
Searching...
No Matches
Checkbox.h
1#ifndef DSGC_CHECKBOX_H
2#define DSGC_CHECKBOX_H
3
4#include "Component.h"
5
6namespace dsgc {
7 class Checkbox : public Component {
8 private:
9 bool checked;
10 const unsigned int length;
11 Color tickColor;
12 void paintBox(unsigned int cornerRadius);
13 void paintTick(unsigned int margin);
14 static const unsigned int MIN_LENGTH;
15 static const unsigned int MIN_TICK_MARGIN;
16 static const unsigned int DEFAULT_LENGTH;
17 public:
24 Checkbox(Adafruit_GFX &graphics, unsigned int x, unsigned int y);
25
33 Checkbox(Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int length);
34
35 virtual void paint() override;
36
42 void setChecked(bool checked);
43
48 bool isChecked();
49
57
62 void setTickColor(Color color);
63 };
64}
65
66#endif // #ifndef DSGC_CHECKBOX_H
Definition Adafruit_GFX.h:18
void setChecked(bool checked)
Sets whether the checkbox is checked.
virtual void paint() override
Paints this component.
Color getTickColor()
Gets the color of the tick stroke.
bool isChecked()
Gets whether the checkbox is checked.
void setTickColor(Color color)
Sets the color of the tick stroke.
Checkbox(Adafruit_GFX &graphics, unsigned int x, unsigned int y)
Creates a checkbox with default length.
Checkbox(Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int length)
Creates a checkbox.
The common interface for colors used by DSGC.
Definition Color.h:21