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.
|
Abstract base class for all user interface elements (controls, indicators, containers). More...
#include <UIElement.h>
Public Member Functions | |
UIElement (UIElementType type) | |
Constructor of the UIElement. | |
UIElement (uint16_t locX, uint16_t locY, UIElementType type) | |
Constructor of the UIElement. | |
virtual void | Draw (bool redraw)=0 |
Virtual method used for drawing of the UIElement. | |
virtual bool | KeyInput (Keys_t key) |
Process the given key. | |
virtual bool | TouchInput (uint16_t x, uint16_t y, TouchTypes touchType) |
Process a touch input at the given point (x, y) | |
virtual void | RecalculateDimensions ()=0 |
Recalculate the Height and Width of the UIElement. | |
virtual void | RecalculateLayout () |
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items, all other items can do other layout update stuff) | |
bool | HitTest (uint16_t x, uint16_t y) |
Check if the given point (x, y) is inside this UIElement. | |
Public Attributes | |
UIElementType | Type |
Element type (control, indicator, container) | |
uint16_t | LocX |
X Location of the upper left corner of the UIElement. | |
uint16_t | LocY |
Y Location of the upper left corner of the UIElement. | |
uint16_t | Width |
Drawing width of the UIElement. | |
uint16_t | Height |
Drawing height of the UIElement. | |
bool | Visible |
The UIElement is only drawn if the visibility is set to true. | |
bool | IsInEditMode |
Is the UIElement in edit mode? | |
UIElement * | Parent |
Parent UIElement that this UIElement belongs to. | |
UIElement * | ActiveChild |
Child element that is currently active (receiving all key inputs). | |
Protected Attributes | |
bool | _lastDrawnVisible |
The Visible value that was last drawn. | |
Abstract base class for all user interface elements (controls, indicators, containers).
|
inline |
Constructor of the UIElement.
type | Element type (control, indicator, container) |
|
inline |
|
pure virtual |
Virtual method used for drawing of the UIElement.
This method must be overwritten in all derived classes. Use the UiManager.Gfx object for drawing.
Implemented in BoolControl, BoolIndicator, ButtonControl, ContainerGrid, ContainerList, ContainerPage, ContainerStack, ContainerTabs, EnumControl< T >, EnumIndicator< T >, Icon, Label, MessageDialog, NumericControl< T >, NumericIndicator< T >, ProgressBar< T >, and VirtualKeys.
|
inline |
|
inlinevirtual |
Process the given key.
This method can be overwritten in all derived classes. If it's not overwritten, no keys are supported by the UIElement. If this element doesn't support the key type, the key is forwarded to the parent. This is done until the key is processed or the root of the visual tree is reached.
key | Key that should be processed. |
Reimplemented in BoolControl, ButtonControl, Container, ContainerGrid, ContainerList, ContainerPage, ContainerStack, ContainerTabs, EnumControl< T >, MessageDialog, NumericControl< T >, and VirtualKeys.
|
pure virtual |
Recalculate the Height and Width of the UIElement.
Implemented in BoolControl, BoolIndicator, ButtonControl, ContainerGrid, ContainerList, ContainerPage, ContainerStack, ContainerTabs, EnumIndicator< T >, Icon, Label, MessageDialog, NumericControl< T >, NumericIndicator< T >, ProgressBar< T >, and VirtualKeys.
|
inlinevirtual |
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items, all other items can do other layout update stuff)
Reimplemented in ContainerGrid, ContainerList, ContainerPage, ContainerStack, ContainerTabs, MessageDialog, ProgressBar< T >, and VirtualKeys.
|
inlinevirtual |
Process a touch input at the given point (x, y)
x | X-Coordinate of the touched point |
y | Y-Coordinate of the touched point |
touchType | Type of the touch |
Reimplemented in BoolControl, ButtonControl, ContainerGrid, ContainerList, ContainerPage, ContainerStack, ContainerTabs, EnumControl< T >, MessageDialog, NumericControl< T >, and VirtualKeys.
|
protected |
The Visible value that was last drawn.
Used to detect changes in the Visible property.
UIElement* UIElement::ActiveChild |
Child element that is currently active (receiving all key inputs).
This property is only set for elements that contain children (mostly containers). Simple controls or indicators should set this to NULL.
bool UIElement::IsInEditMode |
Is the UIElement in edit mode?
This property is only used by some controls. Use the UI_Manager::UpdateIsInEditModeElement() method to change this value to make sure, only one UIElement has this property set to true!