EasyGUI  Version v1.0
Window

Basic widget and core parent to all other widgets. More...

Data Structures

struct  gui_window_t
 Window object structure. More...
 

Enumerations

enum  gui_window_color_t { GUI_WINDOW_COLOR_BG = 0x00, GUI_WINDOW_COLOR_TEXT, GUI_WINDOW_COLOR_TOP_BG_FOC, GUI_WINDOW_COLOR_TOP_BG_NOFOC }
 Window color list enumeration. More...
 

Functions

gui_handle_p gui_window_create (gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags)
 Create new window widget. More...
 
gui_handle_p gui_window_getdesktop (void)
 Get desktop window. More...
 
uint8_t gui_window_setactive (gui_handle_p h)
 Set active window for future widgets and for current top window. More...
 
uint8_t gui_window_setcolor (gui_handle_p h, gui_window_color_t index, gui_color_t color)
 Set color to specific part of widget. More...
 

Detailed Description

Basic widget and core parent to all other widgets.

Core functions capable of encoding and decoding UTF-8 UNICODE format.

Decoding of raw unicode bytes can take up to 4 bytes in a row and stores value to 32-bit variable

UNICODE structure table
Number of bytes Bits for code point First code points Last code point Byte 1 Byte 2 Byte 3 Byte 4
1 7 U+0000 U+007F 0xxxxxxx - - -
2 11 U+0080 U+07FF 110xxxxx 10xxxxxx - -
3 16 U+0800 U+FFFF 1110xxxx 10xxxxxx 10xxxxxx -
4 21 U+10000 U+10FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

https://en.wikipedia.org/wiki/UTF-8

Window is the Win98 styled widget which can support children widgets.

image_widget_window.png
Default window widget

Example code of image above:

Enumeration Type Documentation

◆ gui_window_color_t

Window color list enumeration.

Enumerator
GUI_WINDOW_COLOR_BG 

Background color index

GUI_WINDOW_COLOR_TEXT 

Text color index

GUI_WINDOW_COLOR_TOP_BG_FOC 

Top background color when widget in focus

GUI_WINDOW_COLOR_TOP_BG_NOFOC 

Top background color when widget not in focus

Function Documentation

◆ gui_window_create()

gui_handle_p gui_window_create ( gui_id_t  id,
float  x,
float  y,
float  width,
float  height,
gui_handle_p  parent,
gui_widget_evt_fn  evt_fn,
uint16_t  flags 
)

Create new window widget.

Parameters
[in]idWidget unique ID to use for identity for callback processing
[in]xWidget X position relative to parent widget
[in]yWidget Y position relative to parent widget
[in]widthWidget width in units of pixels
[in]heightWidget height in units of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]evt_fnCustom widget callback function. Set to NULL to use default callback
[in]flagsflags for widget creation
Returns
Widget handle on success, NULL otherwise

◆ gui_window_getdesktop()

gui_handle_p gui_window_getdesktop ( void  )

Get desktop window.

Returns
Widget handle of desktop window

◆ gui_window_setactive()

uint8_t gui_window_setactive ( gui_handle_p  h)

Set active window for future widgets and for current top window.

Parameters
[in]hWidget handle to set as active window
Returns
1 on success, 0 otherwise

◆ gui_window_setcolor()

uint8_t gui_window_setcolor ( gui_handle_p  h,
gui_window_color_t  index,
gui_color_t  color 
)

Set color to specific part of widget.

Parameters
[in]hWidget handle
[in]indexColor index
[in]colorColor value
Returns
1 on success, 0 otherwise