Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otIconGrid Class Reference
[Graphic library that allows you to view a grid of iconsGraphic library that allows you to view a grid of icons]

Graphic library that allows you to view a grid of icons To reduce the amount of memory used, the library requires access to the SD memory where the files representing the icons in EMB format are stored.

#include <otIconGrid.h>


Public Types

enum  GridSize {
  G_8x6, G_4x3, G_5x3, G_3x4,
  G_6x8
}

Public Member Functions

 otIconGrid ()
bool init (U16 size, U16 items, U16 colorFore, U16 colorBack, otFILE *file, otGraphics *tft)
bool addItem (U16 index, const char *fileName, const char *label=0, const char *toolTip=0)
bool setPixmap (U16 index, const char *fileName)
void activate (U16 idx)
void select (U16 idx)
void update ()
void next ()
void previous ()
U16 selected ()


Member Enumeration Documentation

enum otIconGrid::GridSize
 

Enumeration values:
G_8x6  40 x 40 pixel icon size max, real icon 32x32, on screen you see a grid of 8 x 6 icons
G_4x3  80 x 80 pixel icon size max, real icon 64x64, on screen you see a grid of 4 x 3 icons
G_5x3  80 x 80 pixel icon size max, real icon 64x64, on screen you see a grid of 5 x 3 icons
G_3x4  80 x 80 pixel icon size max, real icon 64x64, on screen you see a grid of 3 x 4 icons on vertical display
G_6x8  40 x 40 pixel icon size max, real icon 32x32, on screen you see a grid of 6 x 8 icons on vertical display


Constructor & Destructor Documentation

otIconGrid.otIconGrid  ) 
 

Create the class


Member Function Documentation

void otIconGrid.activate U16  idx  ) 
 

Activate an item of the grid

Parameters:
idx Identifier (index) of loaded icon on the grid

bool otIconGrid.addItem U16  index,
const char *  fileName,
const char *  label = 0,
const char *  toolTip = 0
 

Add a new itme to the grid

Parameters:
index Identifier index of the icon on the grid
fileName File path name of the icon graphics on SD. EMB file format is used.
label Showed text under icon.
toolTip Help for this icon
Returns:
True if the file is found and all necessary init are done.

bool otIconGrid.init U16  size,
U16  items,
U16  colorFore,
U16  colorBack,
otFILE file,
otGraphics tft
 

Init the class

Parameters:
size Grid size, see defined enum GridSize
items Tatal number of used icons
colorFore Foreground color as 565
colorBack Background color as 565
file Pointer to otFile class
tft Pointer to otILI9341 class
Returns:
True on success

void otIconGrid.next  ) 
 

Select next icon. If the icon is the last one in the current display, a scroll down occurs on the next icons, if present.

void otIconGrid.previous  ) 
 

Select previous icon. If the icon is the first one in the current display, a scroll up occurs on the back icons, if present.

void otIconGrid.select U16  idx  ) 
 

Select an item of the grid

Parameters:
idx Identifier (index) of loaded icon on the grid

U16 otIconGrid.selected  ) 
 

Return select icon index

bool otIconGrid.setPixmap U16  index,
const char *  fileName
 

Change a selected pixmap in the grid

Parameters:
index Identifier index of the icon on the grid
fileName File path name of the icon graphics on SD. EMB file format is used.
Returns:
True if the file is found and all necessary init are done.

void otIconGrid.update  ) 
 

Draw all icons of the current view


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0