UI_Lib  a1366e08a59cc549a65fa26081e6409aa12f26d5
This is a user interface library for graphical LCDs. It offers many different controls and indicators that can be nested depending on the element types.
Loading...
Searching...
No Matches
EnumControl.h
Go to the documentation of this file.
1
5
6#ifndef ENUMCONTROL_H_
7#define ENUMCONTROL_H_
8
10
15template <class T>
16class EnumControl : public EnumIndicator<T>
17{
18 private:
20 void(*_onValueChanged)(void* controlContext);
22
23 public:
24
35 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);
36
40 virtual void Draw(bool redraw) override;
41
48 virtual bool KeyInput(Keys_t key) override;
49
57 virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override;
58
63 bool PreviousValue();
64
69 bool NextValue();
70
75 void ToggleEditMode();
76};
77
78#endif /* ENUMCONTROL_H_ */
Containing a class for an enum indicator that is only showing a enumeration variable value.
enum Keys Keys_t
Available input keys.
TouchTypes
Available touch types.
Definition TouchTypes.h:13
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
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