µGFX  2.9
version 2.9
RadioButton

Detailed Description

RadioButton widget.

RadioButtons need to be grouped together. This is archived by passing a group parameter through gwinRadioCreate().

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

Data Structures

struct  GEventGWinRadio
 A Button Event. More...
 
struct  GRadioObject
 The radio button widget structure. More...
 

Modules

 Renderings
 Built-in rendering functions for the radiobutton widget.
 

Functions

GHandle gwinGRadioCreate (GDisplay *g, GRadioObject *gb, const GWidgetInit *pInit, gU16 group)
 Create a radio widget. More...
 
void gwinRadioPress (GHandle gh)
 Press this radio button (and by definition unset any others in the group) More...
 
gBool gwinRadioIsPressed (GHandle gh)
 Is the radio button currently pressed. More...
 
GHandle gwinRadioGetActive (gU16 group)
 Find the currently pressed radio button in the specified group. More...
 
#define GRADIO_FLG_PRESSED   0x01
 The internal radio button object flags. More...
 

Macros

#define GEVENT_GWIN_RADIO   (GEVENT_GWIN_CTRL_FIRST+3)
 The Event Type for a Radio Event. More...
 

Typedefs

typedef struct GEventGWinRadio GEventGWinRadio
 A Button Event. More...
 
typedef struct GRadioObject GRadioObject
 The radio button widget structure. More...
 

Function Documentation

◆ gwinGRadioCreate()

GHandle gwinGRadioCreate ( GDisplay *  g,
GRadioObject gb,
const GWidgetInit pInit,
gU16  group 
)

Create a radio widget.

Returns
NULL if there is no resultant drawing area, otherwise a window handle.
Parameters
[in]gThe GDisplay to display this window on
[in]gbThe GRadioObject structure to initialise. If this is NULL the structure is dynamically allocated.
[in]pInitThe initialisation parameters
[in]groupThe group of radio buttons this radio button belongs to.
Note
Only one radio button in any group is ever pressed at one time. Pressing one radio button will release all others in the group.
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 radio button 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 radio button 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.

◆ gwinRadioGetActive()

GHandle gwinRadioGetActive ( gU16  group)

Find the currently pressed radio button in the specified group.

Returns
The handle of the pressed radio button or NULL if none are pressed
Parameters
[in]groupThe radio button group to be examined
Returns
The handle of the currently pressed radio button
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gwinRadioIsPressed()

gBool gwinRadioIsPressed ( GHandle  gh)

Is the radio button currently pressed.

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

◆ gwinRadioPress()

void gwinRadioPress ( GHandle  gh)

Press this radio button (and by definition unset any others in the group)

Parameters
[in]ghThe window handle (must be a radio widget)
Function Class: Normal API, this function can be invoked by regular system threads.

Macro Definition Documentation

◆ GEVENT_GWIN_RADIO

#define GEVENT_GWIN_RADIO   (GEVENT_GWIN_CTRL_FIRST+3)

The Event Type for a Radio Event.

Definition at line 33 of file gwin_radio.h.

◆ GRADIO_FLG_PRESSED

#define GRADIO_FLG_PRESSED   0x01

The internal radio button object flags.

Note
Used only for writing a custom draw routine.

Definition at line 53 of file gwin_radio.h.

Typedef Documentation

◆ GEventGWinRadio

A Button Event.

Note
There are currently no GEventGWinRadio listening flags - use 0 as the flags to gwinAttachListener()

◆ GRadioObject

typedef struct GRadioObject GRadioObject

The radio button widget structure.

Note
Do not use the members directly - treat it as a black-box.