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
ContainerStack.h
Go to the documentation of this file.
1
5
6#ifndef CONTAINERSTACK_H_
7#define CONTAINERSTACK_H_
8
9#include "Container.h"
10
23
28{
29 private:
31
32 public:
33
43 ContainerStack(StackLayout_t stackLayout = STACK_LAYOUT_VERTICAL_LEFT, uint8_t maxNumItems = DEFAULT_MAX_CONTAINER_ITEMS, uint16_t locX = 0, uint16_t locY = 0, uint16_t width = 0, uint16_t height = 0);
44
48 virtual void Draw(bool redraw) override;
49
57 virtual bool KeyInput(Keys_t key) override;
58
66 virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override;
67
71 void InitItems();
72
76 virtual void RecalculateDimensions() override;
77
81 virtual void RecalculateLayout() override;
82};
83
84#endif /* CONTAINERSTACK_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
StackLayout
Available stack layouts.
Definition ContainerStack.h:15
@ STACK_LAYOUT_HORIZONTAL_TOP
Stack the elements horizontal, top aligned.
Definition ContainerStack.h:19
@ STACK_LAYOUT_VERTICAL_LEFT
Stack the elements vertical, left aligned.
Definition ContainerStack.h:16
@ STACK_LAYOUT_HORIZONTAL_BOTTOM
Stack the elements horizontal, bottom aligned.
Definition ContainerStack.h:21
@ STACK_LAYOUT_HORIZONTAL_CENTER
Stack the elements horizontal, center aligned.
Definition ContainerStack.h:20
@ STACK_LAYOUT_VERTICAL_CENTER
Stack the elements vertical, center aligned.
Definition ContainerStack.h:17
@ STACK_LAYOUT_VERTICAL_RIGHT
Stack the elements vertical, right aligned.
Definition ContainerStack.h:18
enum StackLayout StackLayout_t
Available stack layouts.
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 ContainerStack.cpp:64
StackLayout_t _stackLayout
Stack layout.
Definition ContainerStack.h:30
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition ContainerStack.cpp:73
ContainerStack(StackLayout_t stackLayout=STACK_LAYOUT_VERTICAL_LEFT, 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 ContainerStack.
Definition ContainerStack.cpp:8
virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override
Process a touch input at the given point (x, y)
Definition ContainerStack.cpp:47
virtual void RecalculateLayout() override
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items,...
Definition ContainerStack.cpp:81
virtual bool KeyInput(Keys_t key) override
Process the given key.
Definition ContainerStack.cpp:34