21#define DEFAULT_BOOLCONTROL_TOGGLESWITCH_WIDTH 40
22#define DEFAULT_BOOLCONTROL_TOGGLESWITCH_HEIGHT 20
23#define DEFAULT_BOOLCONTROL_TOGGLESWITCH_SLIDER_SPACING 3
25#define DEFAULT_BOOLCONTROL_CHECKBOX_SIZE 20
26#define DEFAULT_BOOLCONTROL_CHECKBOX_CHECK_SPACING 3
56 virtual void Draw(
bool redraw)
override;
enum BoolControlStyles BoolControlStyles_t
Available boolean control styles.
BoolControlStyles
Available boolean control styles.
Definition BoolControl.h:15
@ BOOLCONTROL_STYLE_TOGGLESWITCH
The boolean control is styled like a toggle switch.
Definition BoolControl.h:16
@ BOOLCONTROL_STYLE_CHECKBOX
The boolean control is styled like a check box.
Definition BoolControl.h:17
@ BOOLCONTROL_STYLE_CLASSIC
The boolean control is styled with a rectangle with ON/OFF text.
Definition BoolControl.h:18
Containing a class for a boolean indicator that is only showing a boolean variable value.
enum Keys Keys_t
Available input keys.
TouchTypes
Available touch types.
Definition TouchTypes.h:13
void ToggleValue()
Toggle the value of the boolean variable referenced by the valuePointer.
Definition BoolControl.cpp:103
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition BoolControl.cpp:109
virtual bool KeyInput(Keys_t key) override
Process the given key.
Definition BoolControl.cpp:81
BoolControlStyles_t _style
Style used by the boolean control.
Definition BoolControl.h:36
BoolControl(bool *valuePointer, void *controlContext=NULL, void(*onValueChanged)(void *controlContext)=NULL, BoolControlStyles_t style=BOOLCONTROL_STYLE_TOGGLESWITCH, uint16_t locX=0, uint16_t locY=0)
Constructor of the BoolControl.
Definition BoolControl.cpp:8
virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override
Process a touch input at the given point (x, y)
Definition BoolControl.cpp:93
bool * _valuePointer
Pointer to the boolean variable that is shown by this control.
Definition BoolControl.h:34
void(* OnValueChanged)(void *controlContext)
Function pointer for OnValueChanged event.
Definition BoolControl.h:40
virtual void Draw(bool redraw) override
Method used for drawing of the BoolControl.
Definition BoolControl.cpp:16
bool _lastValueDraw
Last drawn bool value.
Definition BoolControl.h:35
void * ControlContext
Context pointer that is returned with the OnValueChanged function pointer.
Definition BoolControl.h:39
UIElement(UIElementType type)
Constructor of the UIElement.
Definition UIElement.h:43