EasyGUI  Version v1.0
Core widget functions

Core functions for all widgets. More...

Modules

 Predefined ID values
 Macros for fast ID setup.
 
 Widget create flags
 A list of flags supported for widget creation.
 
 Private functions
 Private widget functions and enumerations.
 
 Shared functions
 Shared public function which should not be directly accessed by user in API.
 
 Text management
 Text and font management functions.
 
 Size management
 Size management functions.
 
 Position management
 Position management functions.
 
 Visibility management
 Visibility management functions.
 
 Miscellaneous
 Miscellaneous functions.
 
 Padding
 Padding related functions.
 
 Callback processing
 Callback based functions.
 

Data Structures

struct  gui_style_t
 Style information. More...
 
struct  gui_widget_param
 Structure used in setting and getting parameter values from widgets using callbacks. More...
 
struct  gui_evt_param_t
 Structure of input parameters for widget callback. More...
 
struct  gui_evt_result_t
 Structure of output results for widget callback. More...
 
struct  gui_widget_t
 Structure for each widget type. More...
 
struct  gui_handle_p
 Common GUI values for widgets. More...
 

Macros

#define GUI_EVT_PARAMTYPE_DISP(x)   (x)->u.disp
 
#define GUI_EVT_PARAMTYPE_TOUCH(x)   (x)->u.td
 
#define GUI_EVT_PARAMTYPE_KEYBOARD(x)   (x)->u.kd
 
#define GUI_EVT_PARAMTYPE_WIDGETPARAM(x)   (x)->u.wp
 
#define GUI_EVT_PARAMTYPE_I16(x)   (x)->u.i16
 
#define GUI_EVT_PARAMTYPE_HANDLE(x)   (x)->u.h
 
#define GUI_EVT_PARAMTYPE_INT(x)   (x)->u.i
 
#define GUI_EVT_RESULTTYPE_TOUCH(x)   (x)->u.ts
 
#define GUI_EVT_RESULTTYPE_KEYBOARD(x)   (x)->u.ks
 
#define GUI_EVT_RESULTTYPE_U8(x)   (x)->u.u8
 

Typedefs

typedef gui_style_tgui_style_p
 Style handle object.
 
typedef uint8_t(* gui_widget_evt_fn) (gui_handle_p h, gui_widget_evt_t evt, gui_evt_param_t *const param, gui_evt_result_t *const result)
 Callback function for widget. More...
 
typedef gui_handle_p(* gui_widget_createfunc_t) (gui_id_t, float, float, float, float, gui_handle_p, gui_widget_evt_fn, uint16_t)
 Widget create function footprint for structures as callbacks.
 

Enumerations

enum  gui_widget_evt_t {
  GUI_EVT_NONE = 0x00, GUI_EVT_PRE_INIT = 0x01, GUI_EVT_EXCLUDELINKEDLIST = 0x02, GUI_EVT_SETPARAM = 0x03,
  GUI_EVT_GETPARAM = 0x04, GUI_EVT_INIT = 0x05, GUI_EVT_CHILDWIDGETCREATED, GUI_EVT_DRAW,
  GUI_EVT_DRAWAFTER, GUI_EVT_CANREMOVE, GUI_EVT_REMOVE, GUI_EVT_FOCUSIN,
  GUI_EVT_FOCUSOUT, GUI_EVT_ACTIVEIN, GUI_EVT_ACTIVEOUT, GUI_EVT_TOUCHSTART,
  GUI_EVT_TOUCHMOVE, GUI_EVT_TOUCHEND, GUI_EVT_CLICK, GUI_EVT_LONGCLICK,
  GUI_EVT_DBLCLICK, GUI_EVT_KEYPRESS, GUI_EVT_SELECTIONCHANGED, GUI_EVT_VALUECHANGED,
  GUI_EVT_TEXTCHANGED, GUI_EVT_INCSELECTION, GUI_EVT_ONDISMISS
}
 Control parameters for widget. More...
 

Detailed Description

Core functions for all widgets.

User can use all function which do not end with __GUI which indicate private functions.

Core widget functions are common functions to all widgets. They can perform:

In general, each widget also uses custom based functions. These are provided in widget specific section.

Typedef Documentation

◆ gui_widget_evt_fn

typedef uint8_t(* gui_widget_evt_fn) (gui_handle_p h, gui_widget_evt_t evt, gui_evt_param_t *const param, gui_evt_result_t *const result)

Callback function for widget.

Handles everything related to widget.

  • Initialization
  • Drawing
  • Touch handling
  • Key presses
  • Value change, selection change
  • and more

Enumeration Type Documentation

◆ gui_widget_evt_t

Control parameters for widget.

Note
Must always start with number 1
Enumerator
GUI_EVT_PRE_INIT 

Called just after widget has been created. Used for internal widget purpose only.

Note
This field is only visible inside GUI library and can't be used in custom widget callback
Parameters
[in]paramNone
[out]resultPointer to uint8_t variable with result. If set to 0 by user, widget will be deleted
GUI_EVT_EXCLUDELINKEDLIST 

Check if widget should not be added to linked list after creation.

Parameters
[in]paramNone
[out]resultPointer to uint8_t variable type to store result to 1 = exclude, 0 = do not exclude
GUI_EVT_SETPARAM 

Set user parameter for widget.

Parameters
[in]paramPointer to gui_evt_param_t structure with custom user parameter for widget
[out]resultNone
GUI_EVT_GETPARAM 

Get parameter for widget.

Parameters
[in]paramPointer to gui_evt_param_t structure with identification and memory where to save parameter value
[out]resultNone
GUI_EVT_INIT 

Widget has been created and ready to init for future setup.

Note
Default values for widget can be set here. Example: Checkbox check can be made and default checkbox value should be set if required
Parameters
[in]paramNone
[out]resultNone
GUI_EVT_CHILDWIDGETCREATED 

A new child widget has been added to parent's linked list. It is called on parent widget.

Parameters
[in]paramChild widget handle
[out]resultNone
GUI_EVT_DRAW 

Draw widget on screen.

Parameters
[in]paramPointer to gui_display_t structure
[out]resultNone
GUI_EVT_DRAWAFTER 

Draw widget on screen after its children widgets were drawn.

Parameters
[in]paramPointer to gui_display_t structure
[out]resultNone
GUI_EVT_CANREMOVE 

Check if widget can be removed. User can perform check if for example widget needs save or similar operation.

Parameters
[in]paramNone
[out]resultPointer to uint8_t variable type to store result to 1 = remove, 0 = do not remove
See also
GUI_EVT_REMOVE
GUI_EVT_REMOVE 

Notification before widget delete will actually happen. In case of specific user allocations in memory, they can be restored here.

Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_CANREMOVE
GUI_EVT_FOCUSIN 

Notification called when widget becomes focused.

Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_FOCUSOUT
GUI_EVT_FOCUSOUT 

Notification called when widget clears widget state.

Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_FOCUSIN
GUI_EVT_ACTIVEIN 

Notification for active status on widget.

Note
Called when widget just become active
Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_ACTIVEOUT
GUI_EVT_ACTIVEOUT 

Notification for cleared active status on widget.

Note
Called when widget just clears active
Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_ACTIVEIN
GUI_EVT_TOUCHSTART 

Notification when touch down event occurs on widget.

Parameters
[in]paramPointer to guii_touch_data_t structure
[out]resultValue of guii_touch_status_t enumeration
See also
GUI_EVT_TOUCHMOVE, GUI_EVT_TOUCHEND
GUI_EVT_TOUCHMOVE 

Notification when touch move event occurs on widget.

Note
If return value from function on this parameter is 1, then GUI_EVT_CLICK event won't be called after released status to prevent collisions between widget events (sliding on widget and click at the same time can cause unknown behaviour on user)
Parameters
[in]paramPointer to guii_touch_data_t structure
[out]resultValue of guii_touch_status_t enumeration
See also
GUI_EVT_TOUCHSTART, GUI_EVT_TOUCHEND
GUI_EVT_TOUCHEND 

Notification when touch up event occurs on widget.

Parameters
[in]paramPointer to guii_touch_data_t structure
[out]resultValue of guii_touch_status_t enumeration
See also
GUI_EVT_TOUCHSTART, GUI_EVT_TOUCHMOVE
GUI_EVT_CLICK 

Notification when click event has been detected.

Parameters
[in]paramPointer to guii_touch_data_t structure with valid touch press location
[out]resultNone
GUI_EVT_LONGCLICK 

Notification when long press has been detected.

Parameters
[in]paramPointer to guii_touch_data_t structure with valid touch press location
[out]resultNone
GUI_EVT_DBLCLICK 

Notification when double click has been detected.

Parameters
[in]paramPointer to guii_touch_data_t structure with valid touch press location
[out]resultNone
GUI_EVT_KEYPRESS 

Notification when key has been pushed to this widget.

Parameters
[in]paramPointer to guii_keyboard_data_t structure
[out]resultValue of guii_keyboard_status_t enumeration
GUI_EVT_SELECTIONCHANGED 

Notification when widget selection has changed.

Note
Called from widget by user when necessary. Not all widget reports this value by itself
Used by widgets where selection can be changed (listbox, selectbox, radio, etc)
Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_VALUECHANGED
GUI_EVT_VALUECHANGED 

Value of widget has been changed.

Note
Called from widget by user when necessary. Not all widget reports this value by itself
Used by widgets where value or status can change (checkbox)
Parameters
[in]paramNone
[out]resultNone
See also
GUI_EVT_SELECTIONCHANGED
GUI_EVT_TEXTCHANGED 

Widget text value has been changed.

Note
Called from widget by user when necessary. Not all widget reports this value by itself
Parameters
[in]paramNone
[out]resultNone
GUI_EVT_INCSELECTION 

Widget should increase/decrease selection.

Note
Called from gui_widget_incselection function to increase/decrease selection for widgets such as listbox or dropdown, where active selection can be changed
Parameters
[in]paramPointer to int16_t variable for amount of increase/decrease value
[out]resultPointer to output uint8_t variable to save status of increase/decrease operation
GUI_EVT_ONDISMISS 

Called when dialog is dismissed.

Note
Callback is activated when dismiss function is called on dialog widget. Notification can be used to proceed with function call
Parameters
[in]paramPointer to int variable passed to dismiss function
[out]resultNone