9EnumControl<T>::EnumControl(T* valuePointer,
const char** enumNames, uint8_t numEnumValues,
void* controlContext,
void(*onValueChanged)(
void* controlContext), uint16_t locX, uint16_t locY) :
EnumIndicator<T>(valuePointer, enumNames, numEnumValues, locX, locY)
80 bool touchWasInRightHalf = (x >= (this->
LocX + this->
Width / 2));
81 if(touchWasInRightHalf)
Containing a class for a enum control that is showing a enumeration variable value and offers the pos...
@ KEYOK
OK (Enter) key.
Definition Keys.h:36
@ KEYDOWN
Down arrow key.
Definition Keys.h:35
@ KEYUP
Up arrow key.
Definition Keys.h:34
enum Keys Keys_t
Available input keys.
TouchTypes
Available touch types.
Definition TouchTypes.h:13
@ TOUCH_LONG
Long touch.
Definition TouchTypes.h:15
@ TOUCH_NORMAL
Normal touch.
Definition TouchTypes.h:14
Containing a class that is used to handle the drawing and key handling of all UI_Elements.
UI_Manager UiManager
Access object for the singleton instance of the UI_Manager.
Definition UI_Manager.cpp:7
@ UI_CONTROL
Control elements are used to show informations and offer the possibility to change some values.
Definition UIElementType.h:16
virtual void Draw(bool redraw) override
Method used for drawing of the EnumControl.
Definition EnumControl.cpp:17
virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override
Process a touch input at the given point (x, y)
Definition EnumControl.cpp:72
void * _controlContext
Context pointer that is returned with the _onValueChanged function pointer.
Definition EnumControl.h:19
void(* _onValueChanged)(void *controlContext)
Function pointer for _onValueChanged event.
Definition EnumControl.h:20
bool PreviousValue()
Set the value of the controlled enumeration variable to the previous enum value.
Definition EnumControl.cpp:103
EnumControl(T *valuePointer, const char **enumNames, uint8_t numEnumValues, void *controlContext=NULL, void(*onValueChanged)(void *controlContext)=NULL, uint16_t locX=0, uint16_t locY=0)
Constructor of the EnumControl.
Definition EnumControl.cpp:9
void ToggleEditMode()
Toggle the control between display and edit mode.
Definition EnumControl.cpp:131
bool NextValue()
Set the value of the controlled enumeration variable to the next enum value.
Definition EnumControl.cpp:117
virtual bool KeyInput(Keys_t key) override
Process the given key.
Definition EnumControl.cpp:55
bool _lastDrawnEditMode
The EditMode that was last drawn.
Definition EnumControl.h:21
T * _valuePointer
Pointer to the enumeration variable that is shown by this indicator.
Definition EnumIndicator.h:21
EnumIndicator(T *valuePointer, const char **enumNames, uint8_t numEnumValues, uint16_t locX=0, uint16_t locY=0)
Constructor of the EnumIndicator.
Definition EnumIndicator.cpp:9
uint8_t _numEnumValues
Number of enumeration values.
Definition EnumIndicator.h:20
T _lastValueDraw
Last drawn enum value.
Definition EnumIndicator.h:22
virtual void Draw(bool redraw) override
Method used for drawing of the EnumIndicator.
Definition EnumIndicator.cpp:17
bool _lastDrawnVisible
The Visible value that was last drawn.
Definition UIElement.h:26
bool IsInEditMode
Is the UIElement in edit mode?
Definition UIElement.h:35
UIElementType Type
Element type (control, indicator, container)
Definition UIElement.h:29
bool HitTest(uint16_t x, uint16_t y)
Check if the given point (x, y) is inside this UIElement.
Definition UIElement.h:109
uint16_t Height
Drawing height of the UIElement.
Definition UIElement.h:33
uint16_t LocY
Y Location of the upper left corner of the UIElement.
Definition UIElement.h:31
bool Visible
The UIElement is only drawn if the visibility is set to true.
Definition UIElement.h:34
uint16_t Width
Drawing width of the UIElement.
Definition UIElement.h:32
uint16_t LocX
X Location of the upper left corner of the UIElement.
Definition UIElement.h:30