6#ifndef ContainerTabs_H_
7#define ContainerTabs_H_
11#define DEFAULT_MAX_ContainerTabs_TABS 5
12#define DEFAULT_ContainerTabs_TABHEADER_MARGIN 2
78 virtual void Draw(
bool redraw)
override;
Containing the base class for container elements.
#define DEFAULT_MAX_ContainerTabs_TABS
Maximum number of tabs that are supported.
Definition ContainerTabs.h:11
#define DEFAULT_ContainerTabs_TABHEADER_MARGIN
Margin around the tab page tabs.
Definition ContainerTabs.h:12
enum TabPositions TabPositions_t
Available tab positions.
TabPositions
Available tab positions.
Definition ContainerTabs.h:18
@ TAB_POSITION_TOP
Tabs are on the top.
Definition ContainerTabs.h:20
@ TAB_POSITION_LEFT
Tabs are on the left side.
Definition ContainerTabs.h:19
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
TabPositions_t _tabPosition
Position of the tabs.
Definition ContainerTabs.h:31
virtual void RecalculateLayout() override
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items,...
Definition ContainerTabs.cpp:205
int GetSelectedTabIndex()
Return the value of the selected tab index.
Definition ContainerTabs.cpp:165
UIElement ** _headers
Array with all tab page tab header elements.
Definition ContainerTabs.h:29
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition ContainerTabs.cpp:186
uint16_t TabRegionSize
Width or height of the Tabs in pixel.
Definition ContainerTabs.h:38
ContainerTabs(uint16_t width, uint16_t height, TabPositions_t tabPosition=TAB_POSITION_LEFT, void *controlContext=NULL, void(*onSelectedTabChanged)(void *controlContext)=NULL, uint8_t maxNumItems=DEFAULT_MAX_ContainerTabs_TABS, uint8_t tabHeaderMargin=DEFAULT_ContainerTabs_TABHEADER_MARGIN)
Constructor of the ContainerTabs.
Definition ContainerTabs.cpp:9
void SelectTab(int index)
Select the tab at the requested index (after range checking).
Definition ContainerTabs.cpp:154
~ContainerTabs()
Destructor of the ContainerTabs.
Definition ContainerTabs.h:69
bool AddItem(UIElement *header, UIElement *tabContent)
Add a new tab to the tab control.
Definition ContainerTabs.cpp:142
void GetContentRegionSize(uint16_t *w, uint16_t *h)
Get the size of the content region of the ContainerTabs.
Definition ContainerTabs.cpp:170
virtual bool KeyInput(Keys_t key) override
Definition ContainerTabs.cpp:93
uint8_t _tabHeaderMargin
Margin around the tab page tabs.
Definition ContainerTabs.h:32
void(* _onSelectedTabChanged)(void *controlContext)
Function pointer for _onSelectedTabChanged event.
Definition ContainerTabs.h:35
void * _controlContext
Context pointer that is returned with the _onSelectedTabChanged function pointer.
Definition ContainerTabs.h:34
virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override
Process a touch input at the given point (x, y)
Definition ContainerTabs.cpp:108
uint8_t _lastDrawnTabIndex
Index of the last drawn tab.
Definition ContainerTabs.h:30
Abstract base class for all user interface elements (controls, indicators, containers).
Definition UIElement.h:24
UIElement(UIElementType type)
Constructor of the UIElement.
Definition UIElement.h:43