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 Class Reference

Class for an icon indicator that is drawing an icon to the screen. More...

#include <Icon.h>

Inheritance diagram for Icon:
UIElement

Public Member Functions

 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.
 
virtual void Draw (bool redraw) override
 Method used for drawing of the Icon.
 
virtual void RecalculateDimensions () override
 Recalculate the Height and Width of the UIElement.
 
- Public Member Functions inherited from UIElement
 UIElement (UIElementType type)
 Constructor of the UIElement.
 
 UIElement (uint16_t locX, uint16_t locY, UIElementType type)
 Constructor of the UIElement.
 
virtual bool KeyInput (Keys_t key)
 Process the given key.
 
virtual bool TouchInput (uint16_t x, uint16_t y, TouchTypes touchType)
 Process a touch input at the given point (x, y)
 
virtual void RecalculateLayout ()
 Recalculate the UIElement layout (containers update the X- and Y-Location of all their items, all other items can do other layout update stuff)
 
bool HitTest (uint16_t x, uint16_t y)
 Check if the given point (x, y) is inside this UIElement.
 

Private Attributes

const uint8_t * _iconBits
 Pointer to the array containing the icon data.
 
uint16_t _color
 Color that is used to draw the Icon.
 
uint16_t _iconWidth
 Width of the icon.
 
uint16_t _iconHeight
 Height of the icon.
 

Additional Inherited Members

- Public Attributes inherited from UIElement
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?
 
UIElementParent
 Parent UIElement that this UIElement belongs to.
 
UIElementActiveChild
 Child element that is currently active (receiving all key inputs).
 
- Protected Attributes inherited from UIElement
bool _lastDrawnVisible
 The Visible value that was last drawn.
 

Detailed Description

Class for an icon indicator that is drawing an icon to the screen.

Constructor & Destructor Documentation

◆ Icon()

Icon::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.

Parameters
iconWidthDrawing width of the Icon
iconHeightDrawing height of the Icon
iconBitsPointer to the array containing the icon data. This must be stored in Progmem. Use the following declaration: unsigned char icon_<iconName>_bits[] PROGMEM = { ... }
colorColor that is used to draw the Icon. The color is only used to draw this Icon. All other UIElements are using the default color again.
locXX Location of the upper left corner of the Icon
locYY Location of the upper left corner of the Icon

Member Function Documentation

◆ Draw()

void Icon::Draw ( bool redraw)
overridevirtual

Method used for drawing of the Icon.

Implements UIElement.

◆ RecalculateDimensions()

void Icon::RecalculateDimensions ( )
overridevirtual

Recalculate the Height and Width of the UIElement.

Implements UIElement.

Member Data Documentation

◆ _color

uint16_t Icon::_color
private

Color that is used to draw the Icon.

The color is only used to draw this Icon. All other UIElements are using the default color again.

◆ _iconBits

const uint8_t* Icon::_iconBits
private

Pointer to the array containing the icon data.

This must be stored in Progmem. Use the following declaration: unsigned char icon_<iconName>_bits[] PROGMEM = { ... }


The documentation for this class was generated from the following files: