FEHIcon

back to FEHLCD.h

Description

Library: FEHLCD.h

The FEHIcon namespace includes the Icon class (which has its own member variables and functions) and the DrawIconArray function. In order to declare an Icon or use the DrawIconArray function, you must use the FEHIcon namespace with the binary scope resolution operator “::”. These icons are essentially software buttons that utilize the touch screen for activation.

One use of these icons is for menus like the ones used in the Proteus_Test program. The easiest way to make these menus is to declare an array of icons and then use the DrawIconArray function to set them up and draw them. Then, the member functions of the Icon class are used to determine when they are pressed and update them.

An important note is that the DrawIconArray function is a powerful function which takes in a lot of input arguments but does a lot at once. See its page for more details. The member functions in the Icon class can be implemented to individually affect aspects of an icon and to essentially reproduce the effects of DrawIconArray.

 

Members

class Icon;
void DrawIconArray(Icon icon[], int rows, int cols, int top, int bot, int left, int right, char labels[][20], unsigned int col, unsigned int txtcol);

 

Declaration

FEHIcon::Icon <icon_name>[array_size];

 

Example

#include <FEHLCD.h>

int main(void)
{
    // clear screen to black to see icon
    LCD.Clear(BLACK);

    // declare icon array called square_button of size 1
    FEHIcon::Icon square_button[1];

    // declare string for icon label
    char label[1][20] = {"BUTTON"};

    // draw icon in a 1 by 1 array, with top and bottom margins of 20 pixels and left and right margins of 60 pixels
    // use label, and make icon border white and icon text white
    FEHIcon::DrawIconArray(square_button, 1, 1, 20, 20, 60, 60, label, WHITE, WHITE);
}