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
ContainerPage.h
Go to the documentation of this file.
1
5
6#ifndef CONTAINERPAGE_H_
7#define CONTAINERPAGE_H_
8
9#include "Container.h"
10
15{
17 uint16_t relativeX;
18 uint16_t relativeY;
19};
20
25{
26 private:
28
29 public:
30
39 ContainerPage(uint8_t maxNumItems = DEFAULT_MAX_CONTAINER_ITEMS, uint16_t locX = 0, uint16_t locY = 0, uint16_t width = 0, uint16_t height = 0);
40
45 {
46 delete _itemConfiguration;
47 _itemConfiguration = NULL;
48 }
49
53 virtual void Draw(bool redraw) override;
54
62 virtual bool KeyInput(Keys_t key) override;
63
71 virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override;
72
76 void InitItems();
77
83 bool AddItem(UIElement* item);
84
88 virtual void RecalculateDimensions() override;
89
93 virtual void RecalculateLayout() override;
94};
95
96#endif /* CONTAINERPAGE_H_ */
Containing the base class for container elements.
#define DEFAULT_MAX_CONTAINER_ITEMS
Default maximum number of items, each container can hold.
Definition Container.h:11
enum Keys Keys_t
Available input keys.
TouchTypes
Available touch types.
Definition TouchTypes.h:13
virtual void Draw()
Virtual method used for drawing of the container UIElement.
Definition Container.h:43
Container(uint8_t maxNumItems=DEFAULT_MAX_CONTAINER_ITEMS)
Constructor of the Container.
Definition Container.cpp:7
void InitItems()
This method selects the first UIElement in the container that is of UI_CONTROL type.
Definition ContainerPage.cpp:64
virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override
Process a touch input at the given point (x, y)
Definition ContainerPage.cpp:47
bool AddItem(UIElement *item)
Add the item to the elements of this container and adapt the save the current relative coordinates.
Definition ContainerPage.cpp:73
ContainerPage(uint8_t maxNumItems=DEFAULT_MAX_CONTAINER_ITEMS, uint16_t locX=0, uint16_t locY=0, uint16_t width=0, uint16_t height=0)
Constructor of the ContainerPage.
Definition ContainerPage.cpp:8
~ContainerPage()
Destructor of the ContainerPage.
Definition ContainerPage.h:44
virtual void RecalculateLayout() override
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items,...
Definition ContainerPage.cpp:94
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition ContainerPage.cpp:86
virtual bool KeyInput(Keys_t key) override
Process the given key.
Definition ContainerPage.cpp:34
PageItemConfig * _itemConfiguration
Configuration data for all items inside the page.
Definition ContainerPage.h:27
Abstract base class for all user interface elements (controls, indicators, containers).
Definition UIElement.h:24
Struct used to store the relative coordinates of a item inside the page.
Definition ContainerPage.h:15
uint16_t relativeX
Relative X coordinate inside the page where the item is placed.
Definition ContainerPage.h:17
uint16_t relativeY
Relative Y coordinate inside the page where the item is placed.
Definition ContainerPage.h:18
UIElement * item
Pointer to the item for which this configuration applies.
Definition ContainerPage.h:16