11#define UI_LIB_DEFAULT_COLOR_BACKGROUND RGB565(0x00, 0x00, 0x00)
12#define UI_LIB_DEFAULT_COLOR_FOREGROUND RGB565(0xFF, 0xFF, 0xFF)
13#define UI_LIB_DEFAULT_COLOR_FOREGROUND_EDIT_MODE UI_LIB_DEFAULT_COLOR_BACKGROUND
14#define UI_LIB_DEFAULT_COLOR_FOCUS_FRAME UI_LIB_DEFAULT_COLOR_FOREGROUND
15#define UI_LIB_DEFAULT_FONT &FreeSans12pt7b
16#define UI_LIB_DEFAULT_ELEMENT_MARGIN 2
17#define UI_LIB_DEFAULT_ELEMENT_PADDING 3
67 void Init(Adafruit_GFX* gfx);
82 void SetFont(
const GFXfont* font);
enum Keys Keys_t
Available input keys.
TouchTypes
Available touch types.
Definition TouchTypes.h:13
#define UI_LIB_DEFAULT_COLOR_FOREGROUND
Default UIElement foreground color (white)
Definition UI_Manager.h:12
#define UI_LIB_DEFAULT_COLOR_BACKGROUND
Default Background color (black)
Definition UI_Manager.h:11
UI_Manager UiManager
Access object for the singleton instance of the UI_Manager.
Definition UI_Manager.cpp:7
#define UI_LIB_DEFAULT_COLOR_FOREGROUND_EDIT_MODE
Default UIElement foreground color in edit mode (black).
Definition UI_Manager.h:13
#define UI_LIB_DEFAULT_COLOR_FOCUS_FRAME
Default Focus frame color.
Definition UI_Manager.h:14
Containing the abstract base class for all user interface elements (controls, indicators,...
Class that is used to handle the drawing and key handling of all UI_Elements.
Definition UI_Manager.h:23
uint16_t ElementPadding
Space between the outline of every UIElement and the internal content.
Definition UI_Manager.h:47
UIElement * _lastDrawnFocusElement
Last drawn focus element.
Definition UI_Manager.h:27
uint16_t ColorForegroundEditMode
Default UIElement foreground color in edit mode (black).
Definition UI_Manager.h:42
void Init(Adafruit_GFX *gfx)
Initialize the UI_Manager.
Definition UI_Manager.cpp:22
static UI_Manager & getInstance()
Get the singleton instance of the UI_Manager class.
Definition UI_Manager.h:57
uint16_t FontHeight
Maximum height of the Font (height of the string "Ag").
Definition UI_Manager.h:45
uint16_t ColorForeground
UIElement color (green)
Definition UI_Manager.h:41
const GFXfont * Font
Default font used when no other font is assigned.
Definition UI_Manager.h:44
bool CompleteRedrawRequested
True, if the tree root was currently changed.
Definition UI_Manager.h:48
void Draw()
Draw the complete visual tree (_visualTreeRoot and all of its children).
Definition UI_Manager.cpp:50
UIElement * _focusElement
Element that has the focus (it is highlited and receives all key inputs).
Definition UI_Manager.h:26
uint16_t ColorBackground
Background color (black)
Definition UI_Manager.h:40
void SetColors(uint16_t colorBackground=UI_LIB_DEFAULT_COLOR_BACKGROUND, uint16_t colorForeground=UI_LIB_DEFAULT_COLOR_FOREGROUND, uint16_t colorForegroundEditMode=UI_LIB_DEFAULT_COLOR_FOREGROUND_EDIT_MODE, uint16_t colorFocusFrame=UI_LIB_DEFAULT_COLOR_FOCUS_FRAME)
Set all colors.
Definition UI_Manager.cpp:31
bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType)
Process a touch input at the given point (x, y)
Definition UI_Manager.cpp:134
void SetFont(const GFXfont *font)
Set the Font property and recalculate the FontHeight based on this font.
Definition UI_Manager.cpp:39
UI_Manager()
Constructor of the UI_Manager.
Definition UI_Manager.cpp:9
bool KeyInput(Keys_t key)
Forward the given key to the _focusElement.
Definition UI_Manager.cpp:118
void ChangeVisualTreeRoot(UIElement *visualTreeRoot)
Change the root element of the visual tree.
Definition UI_Manager.cpp:89
uint16_t ElementMargin
Space without content around every UIElement.
Definition UI_Manager.h:46
void setFocusToLeaf()
Traverse down the visual tree until an element without a child is reached and focus this element.
Definition UI_Manager.cpp:103
uint16_t ColorFocusFrame
Color of the focus frame.
Definition UI_Manager.h:43
void UpdateIsInEditModeElement(UIElement *element, bool newEditModeState)
Update the IsInEditMode property of the given UIElement to the given newEditModeState.
Definition UI_Manager.cpp:149
Adafruit_GFX * Gfx
Graphics object.
Definition UI_Manager.h:49
UIElement * GetVisualTreeRoot()
Return the root element of the visual tree.
Definition UI_Manager.cpp:98
bool AreVirtualKeysShown
True, if the Virtual keys are shown.
Definition UI_Manager.h:50
UIElement * _visualTreeRoot
Root element of the visual tree.
Definition UI_Manager.h:25
UIElement * _lastElementInEditMode
Last UI_Element that has the IsInEditMode property set.
Definition UI_Manager.h:29
Abstract base class for all user interface elements (controls, indicators, containers).
Definition UIElement.h:24