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.
|
Class for a control that can be used to emulate key presses via touch inputs. More...
#include <VirtualKeys.h>
Public Member Functions | |
VirtualKeys (void(*onVirtualKeyPressed)(Keys_t key)=NULL) | |
Constructor of the VirtualKeys. | |
void | ShowVirtualKeys (UIElement *targetElement) |
Change the visual tree root to show the virtual keys with the given target element that will be edited. | |
void | ExitVirtualKeys () |
Exit the virtual keys and change the visual tree root back to the _previousVisualTreeRoot. | |
virtual void | Draw (bool redraw) override |
Method used for drawing of the VirtualKeys. | |
virtual bool | KeyInput (Keys_t key) override |
Process the given key. | |
virtual bool | TouchInput (uint16_t x, uint16_t y, TouchTypes touchType) override |
Process a touch input at the given point (x, y) | |
virtual void | RecalculateDimensions () override |
Recalculate the Height and Width of the UIElement. | |
virtual void | RecalculateLayout () override |
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items, all other items can do other layout update stuff) | |
![]() | |
UIElement (UIElementType type) | |
Constructor of the UIElement. | |
UIElement (uint16_t locX, uint16_t locY, UIElementType type) | |
Constructor of the UIElement. | |
bool | HitTest (uint16_t x, uint16_t y) |
Check if the given point (x, y) is inside this UIElement. | |
Public Attributes | |
void(* | OnVirtualKeyPressed )(Keys_t key) |
Function pointer for OnVirtualKeyPressed event. | |
![]() | |
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). | |
Private Member Functions | |
void | _handleButtonPress (Keys_t key) |
Method that is called whenever a button is pressed. | |
Private Attributes | |
ContainerGrid | _grid |
Grid used to combine all virtual keys. | |
ButtonControl | _button0 |
Virtual keys button 0. | |
ButtonControl | _button1 |
Virtual keys button 1. | |
ButtonControl | _button2 |
Virtual keys button 2. | |
ButtonControl | _button3 |
Virtual keys button 3. | |
ButtonControl | _button4 |
Virtual keys button 4. | |
ButtonControl | _button5 |
Virtual keys button 5. | |
ButtonControl | _button6 |
Virtual keys button 6. | |
ButtonControl | _button7 |
Virtual keys button 7. | |
ButtonControl | _button8 |
Virtual keys button 8. | |
ButtonControl | _button9 |
Virtual keys button 9. | |
ButtonControl | _buttonLeft |
Virtual keys button Left. | |
ButtonControl | _buttonRight |
Virtual keys button Right. | |
ButtonControl | _buttonMilli |
Virtual keys button Milli. | |
ButtonControl | _buttonKilo |
Virtual keys button Kilo. | |
ButtonControl | _buttonX1 |
Virtual keys button x1. | |
ButtonControl | _buttonMinus |
Virtual keys button Minus. | |
ButtonControl | _buttonUp |
Virtual keys button Up. | |
ButtonControl | _buttonOk |
Virtual keys button Ok. | |
ButtonControl | _buttonDown |
Virtual keys button Down. | |
ButtonControl | _buttonExitVirtualKeys |
Virtual keys button Exit. | |
UIElement * | _targetElement |
UI_Element that is edited by the virtual keys. | |
UIElement * | _previousVisualTreeRoot |
Previous visual tree root. | |
Additional Inherited Members | |
![]() | |
bool | _lastDrawnVisible |
The Visible value that was last drawn. | |
Class for a control that can be used to emulate key presses via touch inputs.
It displays one UI_Element that receives all emulated key presses and a matrix with many BoolControl elements to input key presses.
VirtualKeys::VirtualKeys | ( | void(* | onVirtualKeyPressed )(Keys_t key) = NULL | ) |
Constructor of the VirtualKeys.
onVirtualKeyPressed | Function pointer for OnVirtualKeyPressed event |
|
private |
Method that is called whenever a button is pressed.
key | Pressed key |
|
overridevirtual |
Method used for drawing of the VirtualKeys.
Implements UIElement.
|
overridevirtual |
Process the given key.
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. Supported keys are: KEYOK, KEYUP, KEYDOWN |
Reimplemented from UIElement.
|
overridevirtual |
|
overridevirtual |
void VirtualKeys::ShowVirtualKeys | ( | UIElement * | targetElement | ) |
Change the visual tree root to show the virtual keys with the given target element that will be edited.
targetElement | UI_Element that is edited by the virtual keys. |
|
overridevirtual |
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 from UIElement.
|
private |
Previous visual tree root.
This is used to change the visual tree root back on exit.