Skip to content

GUI

The GUI object stores and shares parameters used by the elements.

Configure

Warning

Ensure the screen is declared and initialised according to the configuration procedure.

#include "hV_GUI.h"

The pre-processor statement includes the GUI library.

GUI myGUI(&myScreen);

The constructor GUI() sets the link to the screen.

Danger

Because the GUI library uses fast and partial updates, it requires a screen of type Screen_EPD_EXT3_Fast provided by the PDLS_EXT3_Advanced_Fast or PDLS_EXT3_Advanced_Touch libraries.

Legacy version 5

On the legacy version 5, it requires a screen of type Screen_EPD_EXT3_Fast provided by the PDLS_EXT3_Advanced_Fast_Large, PDLS_EXT3_Advanced_Fast_Medium, PDLS_EXT3_Advanced_Fast_Small and PDLS_EXT3_Advanced_Fast_Touch libraries.

myGUI.begin();

begin() initialises the GUI with the default parameters.

The default parameters delegate the partial update to the interface elements, set the state to enabled, set the colours of the interface to black for text, white for background and grey for middle, and set the style to normal.

Then, if needed,

myGUI.delegate(true);
myGUI.setColours(myColours.black, myColours.white, myColours.grey);
myGUI.setState(stateEnabled);
myGUI.setStyle(styleNormal);

delegate(true) tells the GUI to manage the partial update of the interface elements.

When set to false, the update of the screen needs to be managed on the main code.

setColours() sets the front, back and middle colours of the interface.

Note

For monochrome and colour e-paper screens, ensure the selected colours are supported.

setState() defines the default state for the input elements, whether touch is activated:

  • stateDisabled or false for touch disabled;
  • stateEnabled or true for touch enabled.

Default is true for touch enabled.

setStyle() selects the style

  • styleNormal for default square corners;
  • styleRounded for rounded corners.

Input elements include Area, Button, Check-box, Cursor, Flip-flop, Plus-minus, Radio-buttons, Table and Keyboard.

Output elements include Bar-graph, Text and Text-box.

Use

The GUI library exposes two kinds of elements: functions and objects.

Elements called as functions only manage display.

  • Label;
  • Dialogue box;
  • Menu;
  • Slider.

Only the Label element is implemented on e-paper screens.

Elements called as objects manage display, touch and event.

Input elements include

Output elements include

All the listed elements are implement on e-paper screens.