EasyGUI  v0.1
Platform independent GUI Library
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_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...
 
GUI_HANDLE_p gui_window_create (GUI_ID_t id, GUI_iDim_t x, GUI_iDim_t y, GUI_Dim_t width, GUI_Dim_t height, GUI_HANDLE_p parent, GUI_WIDGET_CALLBACK_t cb, uint16_t flags)
 Create new window widget. 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.

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

image_widget_window.png
Default window widget

Example code of image above:

handle = gui_window_create(0, 40, 20, 300, 200, gui_window_getdesktop(), 0, 0);
gui_widget_settext(handle, _GT("Window"));

Enumeration Type Documentation

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_HANDLE_p gui_window_create ( GUI_ID_t  id,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_Dim_t  width,
GUI_Dim_t  height,
GUI_HANDLE_p  parent,
GUI_WIDGET_CALLBACK_t  cb,
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 uints of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]cbPointer to GUI_WIDGET_CALLBACK_t callback function. Set to NULL to use default widget callback
[in]flagsFlags for widget creation
Return values
>0: GUI_HANDLE_p object of created widget
0Widget creation failed
GUI_HANDLE_p gui_window_getdesktop ( void  )

Get desktop window.

Return values
Widgethandle of desktop window
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
Return values
1Widget was set ok
0Widget was not set
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,out]hWidget handle
[in]indexColor index. This parameter can be a value of GUI_WINDOW_COLOR_t enumeration
[in]colorColor value
Return values
1Color was set ok
0Color was not set