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
Icon.h
Go to the documentation of this file.
1
5
6#ifndef ICON_H_
7#define ICON_H_
8
9#include "../Core/UIElement.h"
10
11#define ICON_COLOR_NOTSET RGB565(0x2B, 0x23, 0x10)
12
16class Icon : public UIElement
17{
18 private:
19 const uint8_t* _iconBits;
20 uint16_t _color;
21 //bool _wasColorSet; /**< true, if the color was set in the constructor or during the first draw call; false, if the color wasn't set in the constructor and before the first draw call */
22 uint16_t _iconWidth;
23 uint16_t _iconHeight;
24
25 public:
35 Icon(uint16_t iconWidth, uint16_t iconHeight, const uint8_t* iconBits, uint16_t color = ICON_COLOR_NOTSET, uint16_t locX = 0, uint16_t locY = 0);
36
40 virtual void Draw(bool redraw) override;
41
45 virtual void RecalculateDimensions() override;
46};
47
48#endif /* ICON_H_ */
#define ICON_COLOR_NOTSET
Define one color that is used to indicate that the user doesn't set the color.
Definition Icon.h:11
Containing the abstract base class for all user interface elements (controls, indicators,...
const uint8_t * _iconBits
Pointer to the array containing the icon data.
Definition Icon.h:19
uint16_t _color
Color that is used to draw the Icon.
Definition Icon.h:20
uint16_t _iconHeight
Height of the icon.
Definition Icon.h:23
Icon(uint16_t iconWidth, uint16_t iconHeight, const uint8_t *iconBits, uint16_t color=ICON_COLOR_NOTSET, uint16_t locX=0, uint16_t locY=0)
Constructor of the Icon.
Definition Icon.cpp:8
uint16_t _iconWidth
Width of the icon.
Definition Icon.h:22
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition Icon.cpp:34
virtual void Draw(bool redraw) override
Method used for drawing of the Icon.
Definition Icon.cpp:16
UIElement(UIElementType type)
Constructor of the UIElement.
Definition UIElement.h:43