EasyGUI  v0.1
Platform independent GUI Library

Miscellaneous functions. More...

Functions

uint8_t gui_widget_invalidate (GUI_HANDLE_p h)
 Invalidate widget object and prepare to new redraw. More...
 
uint8_t gui_widget_setuserdata (GUI_HANDLE_p h, void *data)
 Set custom user data to widget. More...
 
void * gui_widget_getuserdata (GUI_HANDLE_p h)
 Get custom user data from widget previously set with gui_widget_setuserdata. More...
 
uint8_t gui_widget_ischildof (GUI_HANDLE_p h, GUI_HANDLE_p parent)
 Check if widget is children of parent. More...
 
uint8_t gui_widget_incselection (GUI_HANDLE_p h, int16_t dir)
 Increase selection for widget. More...
 
uint8_t gui_widget_setfocus (GUI_HANDLE_p h)
 Manually set widget in focus. More...
 
uint8_t gui_widget_setzindex (GUI_HANDLE_p h, int32_t zindex)
 Set z-Index for widgets on the same level. This feature applies on widgets which are not dialogs. More...
 
int32_t gui_widget_getzindex (GUI_HANDLE_p h)
 Get z-index value from widget. More...
 
uint8_t gui_widget_set3dstyle (GUI_HANDLE_p h, uint8_t enable)
 Set 3D mode on widget. More...
 
GUI_ID_t gui_widget_getid (GUI_HANDLE_p h)
 Get widget ID. More...
 
GUI_HANDLE_p gui_widget_getbyid (GUI_ID_t id)
 Get first widget handle by ID. More...
 
uint8_t gui_widget_remove (GUI_HANDLE_p *h)
 Remove widget from memory. More...
 

Detailed Description

Miscellaneous functions.

Function Documentation

GUI_HANDLE_p gui_widget_getbyid ( GUI_ID_t  id)

Get first widget handle by ID.

Note
If multiple widgets have the same ID, first found will be used
Parameters
[in,out]idWidget ID to search for
Return values
>0: Widget handle when widget found
0Widget not found
GUI_ID_t gui_widget_getid ( GUI_HANDLE_p  h)

Get widget ID.

Parameters
[in,out]hWidget handle
Return values
WidgetID
void* gui_widget_getuserdata ( GUI_HANDLE_p  h)

Get custom user data from widget previously set with gui_widget_setuserdata.

Parameters
[in,out]hWidget handle
Return values
Pointerto user data
See also
gui_widget_setuserdata
int32_t gui_widget_getzindex ( GUI_HANDLE_p  h)

Get z-index value from widget.

Parameters
[in,out]hWidget handle
Return values
z-indexvalue
See also
gui_widget_setzindex
uint8_t gui_widget_incselection ( GUI_HANDLE_p  h,
int16_t  dir 
)

Increase selection for widget.

Note
Widget must implement GUI_WC_IncSelection command in callback function and process it
Parameters
[in,out]hWidget handle
[in]dirIncrease direction. Positive number means number of increases, negative is number of decreases
Return values
1Increase/Decrease was ok
0Increase/Decrease was not ok
uint8_t gui_widget_invalidate ( GUI_HANDLE_p  h)

Invalidate widget object and prepare to new redraw.

Parameters
[in,out]hWidget handle
Return values
1Widget was invalidated ok
0Widget was not invalidated
uint8_t gui_widget_ischildof ( GUI_HANDLE_p  h,
GUI_HANDLE_p  parent 
)

Check if widget is children of parent.

Parameters
[in]hWidget handle to test
[in]parentParent widget handle to test if is parent
Return values
1Widget handle is in tree of parent handle
0Widget handle is not in tree of parent handle
uint8_t gui_widget_remove ( GUI_HANDLE_p *  h)

Remove widget from memory.

Note
If widget has child widgets, they will be removed too
Parameters
[in,out]*hPointer to widget handle. If removed, pointer will be invalidated and set to NULL
Return values
1Widget deleted
0Delete failed
uint8_t gui_widget_set3dstyle ( GUI_HANDLE_p  h,
uint8_t  enable 
)

Set 3D mode on widget.

Parameters
[in,out]hWidget handle
[in]enableValue to enable, either 1 or 0
Return values
1Successful
0Failed
uint8_t gui_widget_setfocus ( GUI_HANDLE_p  h)

Manually set widget in focus.

Parameters
[in,out]hWidget handle
Return values
1Widget set to focus
0Widget was not set to focus
uint8_t gui_widget_setuserdata ( GUI_HANDLE_p  h,
void *  data 
)

Set custom user data to widget.

Note
Specially useful in callback processing if required
Parameters
[in,out]hWidget handle
[in]dataPointer to custom user data
Return values
1Data were set OK
0Data were not set
See also
gui_widget_getuserdata
uint8_t gui_widget_setzindex ( GUI_HANDLE_p  h,
int32_t  zindex 
)

Set z-Index for widgets on the same level. This feature applies on widgets which are not dialogs.

Note
Larger z-index value means greater position on screen. In case of multiple widgets on same z-index level, they are automatically modified for correct display
Parameters
[in,out]hWidget handle
[in]zindexZ-Index value for widget. Any value can be used
Return values
1New value is different than previous and modification has been done
0New value was not set
See also
gui_widget_getzindex