gui: GUI functions

Top  Previous  Next

The GUI functions provide a more advanced API for using the display.

It is possible to switch between this API and the more simple display API using guiOpen/guiClose and displayPower.

 

At its core, this API provides three different kinds of GUI elements, in addition to some common functionality:

1. Custom Forms

2. Dialogs

3. Menus

 

Limits

The limit to the number of different objects currently is as follows:

10 Forms.

100 controls across all forms.

10 Menus (each with up to 8 items).

Trying to create objects beyond these limits will result in error code -2, not enough memory / resources.

 

In addition to the custom GUIs, there is also some built-in GUI, to configure and monitor the status of the device.

 

Common Functions

The following functions can be used across the library:


guiGrabScreenShot

Takes a screenshot of the display. Can also be called when the display API is used.


guiCalibrateTouch

Calibrates the touch panel.


guiOpen

Opens the GUI API


guiClose

Closes the GUI API


guiWaitEvent

Waits for a GUI event to occur.


guiGetTag

Retrieves the tag value for the provided handle.

 

Form Functionsgui_form_example

The custom forms makes it possible to create forms with many different types of controls, to use for e.g. data entry, visualization of data, configuration and many other things.

To make it easy to layout the controls on the forms, the controls are arranged in a grid of a custom size.


guiFormCreate

Creates a new form


guiFormShow

Makes the form visible


guiFormClose

Hides the visible form.


guiFormRemove

Releases the form and the resources it uses.

 

Controls:

To create and use controls on the forms, please use the Control functions.

 

 

Dialogs

The dialogs can be used to interact with the user, without having to create a custom form.

The function blocks until the user responds or it times out.

 

The following dialog functions are available:


guiCloseDialogs

Closes all open dialogs.


guiShowMessage

Shows a dialog with a message for the user, with one or more buttons.


guiShowChoice

Shows a dialog list of choices to the user.


guiShowNumberInput

Shows a dialog for entering a number.


guiShowTextInput

Shows a dialog for entering a text.


guiShowDateInput

Shows a dialog for entering a date and/or a time.

 

 

Menus:

The menus allow for quick access to a large number of items, which can be used e.g. for navigating the forms or for quick settings.

gui_menu

The following menu functions are available:


guiMenuCreate

Creates a new menu


guiMenuRemove

Releases the menu


guiMenuSetItem

Sets an item in the menu


guiMenuRemoveItem

Removes an item from the menu


guiMenuShow

Shows the menu.


guiMenuClose

Closes the menu


guiMenuClickEvent

Handles a click on a menu item.

 

 

 

Built-in GUI:

Status panel:

The status panel contains a list of icons, showing the status for many of the interfaces on the device.

If enabled, detailed information can be shown by clicking on the icons.

gui_status_bar

 

System menu:

The system menu allows for accessing viewing and editing some configuration settings on the device, such as the system switches.

The icons in the status bar will show details when clicked, if the system menu is enabled, or if it is allowed in the configuration dialog.

The system menu is accessed by clicking on the clock in the status bar.

gui_sys_menu

 

The following function controls access to the system menu:


guiSysMenuEnable

Enables the system menu


guiSysMenuSetPassword

Configures the password that the user can use to enable the system menu.

 

Calibration menu:

The calibration menu provides access to calibrating the display.

gui_sys_menu_cal

 

It has two entries:

Contrast

This is used for adjusting the contrast of the display, to e.g. optimize it for different viewing angles.

gui_cal_contrast

Clicking the arrows adjust the contrast up and down and is applied immediately.

 

Touch panel

This menu item is used to calibrate the touch panel, to adjust for e.g. the access angle or the item used to press on the screen.

gui_cal_touch

To calibrate, click accurately on each of the five points as they are shown, and the dialog closes. To close the dialog without changing the calibration, wait for 60 seconds and the dialog closes by itself.

The calibration dialog can also be activated with the guiCalibrateTouch function.