discoverpixy
Data Structures | Macros | Typedefs | Functions
Checkbox
Collaboration diagram for Checkbox:

Data Structures

struct  CHECKBOX_STRUCT
 

Macros

#define CHECKBOX_WIN_FG_COLOR   RGB(32,161,34)
 

Typedefs

typedef void(* CHECKBOX_CALLBACK) (void *checkbox, bool checked)
 

Functions

bool gui_checkbox_add (CHECKBOX_STRUCT *checkbox)
 
void gui_checkbox_remove (CHECKBOX_STRUCT *checkbox)
 
void gui_checkbox_update (CHECKBOX_STRUCT *checkbox)
 
void gui_checkbox_redraw (CHECKBOX_STRUCT *checkbox)
 

Detailed Description

The Checkbox Gui-Element is a clickable, rectangular box with an optional tickmark inside of it. When the checkbox is pressed and released it's tick state changes and you will be notified via the provided callback.

Macro Definition Documentation

#define CHECKBOX_WIN_FG_COLOR   RGB(32,161,34)

Typedef Documentation

typedef void(* CHECKBOX_CALLBACK) (void *checkbox, bool checked)

Prototype for Event Listeners (called when the checkbox state has changed)

Note
You should NOT execute long running things in this callback nor should you update the gui. But you can call gui_screen_navigate() for instance.
Parameters
checkboxThe pointer to the CHECKBOX_STRUCT where to corresponding Checkbox has changed the state
checkedA boolean which indicates whether the checkbox is now checked or not.

Function Documentation

bool gui_checkbox_add ( CHECKBOX_STRUCT checkbox)

Adds a checkbox. Your Callback will be called from now on, if the checkbox changes state

Parameters
checkboxA Pointer to the preinitialized CHECKBOX_STRUCT
Returns
true on success

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_checkbox_redraw ( CHECKBOX_STRUCT checkbox)

Redraws the checkbox. Call this method if you have to redraw the entire screen or if you want to draw a checkbox on top of an image.

Parameters
checkboxA Pointer to the CHECKBOX_STRUCT

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_checkbox_remove ( CHECKBOX_STRUCT checkbox)

Removes the checkbox. You will no longer receive events for this checkbox. This function will not overdraw the region where the checkbox was located.

Parameters
checkboxA Pointer to the CHECKBOX_STRUCT

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_checkbox_update ( CHECKBOX_STRUCT checkbox)

Updates the checkbox. Call this function when you change the state of the checkbox through code.

Parameters
checkboxA Pointer to the CHECKBOX_STRUCT

Here is the call graph for this function:

Here is the caller graph for this function: