µGFX  2.9
version 2.9
Checkbox

Detailed Description

CheckBox widget.

GWIN allows it to easily create a group of checkbox buttons.

Precondition
GFX_USE_GWIN must be set to GFXON in your gfxconf.h
GWIN_NEED_CHECKBOX must be set to GFXON in your gfxconf.h

Modules

 Renderings
 Built-in rendering functions for the checkbox widget.
 

Functions

GHandle gwinGCheckboxCreate (GDisplay *g, GCheckboxObject *gb, const GWidgetInit *pInit)
 Create a checkbox window. More...
 
void gwinCheckboxCheck (GHandle gh, gBool isChecked)
 Set the state of a checkbox. More...
 
gBool gwinCheckboxIsChecked (GHandle gh)
 Get the state of a checkbox. More...
 
#define GCHECKBOX_FLG_CHECKED   0x01
 The internal checkbox flags. More...
 

Function Documentation

◆ gwinCheckboxCheck()

void gwinCheckboxCheck ( GHandle  gh,
gBool  isChecked 
)

Set the state of a checkbox.

Parameters
[in]ghThe window handle (must be a checkbox window)
[in]isCheckedgTrue to set the check, gFalse to uncheck.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 142 of file gwin_checkbox.c.

References GWindowObject::vmt.

◆ gwinCheckboxIsChecked()

gBool gwinCheckboxIsChecked ( GHandle  gh)

Get the state of a checkbox.

Returns
gTrue if the checkbox is currently checked
Parameters
[in]ghThe window handle (must be a checkbox window)
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 157 of file gwin_checkbox.c.

References GWindowObject::vmt.

◆ gwinGCheckboxCreate()

GHandle gwinGCheckboxCreate ( GDisplay *  g,
GCheckboxObject *  gb,
const GWidgetInit pInit 
)

Create a checkbox window.

Returns
NULL if there is no resultant drawing area, otherwise a window handle.
Parameters
[in]gThe GDisplay to display this window on
[in]gbThe GCheckboxObject structure to initialise. If this is NULL, the structure is dynamically allocated.
[in]pInitThe initialization parameters to use
Note
The drawing color and the background color get set to the current defaults. If you haven't called gwinSetDefaultColor() or gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
The font gets set to the current default font. If you haven't called gwinSetDefaultFont() then there is no default font and text drawing operations will no nothing.
A checkbox remembers its normal drawing state. If there is a window manager then it is automatically redrawn if the window is moved or its visibility state is changed.
A checkbox supports mouse and a toggle input.
When assigning a toggle, only one toggle is supported. If you try to assign more than one toggle it will forget the previous toggle. When assigning a toggle the role parameter must be 0.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 131 of file gwin_checkbox.c.

Macro Definition Documentation

◆ GCHECKBOX_FLG_CHECKED

#define GCHECKBOX_FLG_CHECKED   0x01

The internal checkbox flags.

Note
Used only for writing a custom draw routine.

Definition at line 53 of file gwin_checkbox.h.