version 2.8
Checkbox

Detailed Description

CheckBox widget.

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

Precondition
GFX_USE_GWIN must be set to TRUE in your gfxconf.h
GWIN_NEED_CHECKBOX must be set to TRUE 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, bool_t isChecked)
 Set the state of a checkbox. More...
 
bool_t gwinCheckboxIsChecked (GHandle gh)
 Get the state of a checkbox. More...
 
#define GCHECKBOX_FLG_CHECKED   0x01
 The internal checkbox flags. More...
 

Function Documentation

void gwinCheckboxCheck ( GHandle  gh,
bool_t  isChecked 
)

Set the state of a checkbox.

Parameters
[in]ghThe window handle (must be a checkbox window)
[in]isCheckedTRUE to set the check, FALSE 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::flags, GCHECKBOX_FLG_CHECKED, and GWindowObject::vmt.

bool_t gwinCheckboxIsChecked ( GHandle  gh)

Get the state of a checkbox.

Returns
TRUE 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 GWidgetStyle::disabled, GWidgetStyle::enabled, FALSE, GWindowObject::flags, GWidgetObject::g, GCHECKBOX_FLG_CHECKED, GWidgetStyle::pressed, GWidgetObject::pstyle, TRUE, and GWindowObject::vmt.

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 White and 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.

References GWidgetInit::g, gwinSetVisible(), and GWindowInit::show.

Macro Definition Documentation

#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.

Referenced by gwinCheckboxCheck(), gwinCheckboxDraw_CheckOnLeft(), gwinCheckboxDraw_CheckOnRight(), and gwinCheckboxIsChecked().