GUIslice  0.16.0
Embedded GUI in C
XCheckbox.h File Reference
#include "GUIslice.h"
Include dependency graph for XCheckbox.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gslc_tsXCheckbox
 Extended data for Checkbox element. More...
 

Macros

#define GSLC_TYPEX_CHECKBOX
 
#define gslc_ElemXCheckboxCreate_P(pGui, nElemId, nPage, nX, nY, nW, nH, colFill, bFillEn, nGroup, bRadio_, nStyle_, colCheck_, bChecked_)
 Create a Checkbox or Radio button Element in Flash. More...
 

Typedefs

typedef bool(* GSLC_CB_XCHECKBOX) (void *pvGui, void *pvElemRef, int16_t nSelId, bool bChecked)
 Callback function for checkbox/radio element state change. More...
 

Enumerations

enum  gslc_teXCheckboxStyle { GSLCX_CHECKBOX_STYLE_BOX, GSLCX_CHECKBOX_STYLE_X, GSLCX_CHECKBOX_STYLE_ROUND }
 Checkbox drawing style. More...
 

Functions

gslc_tsElemRefgslc_ElemXCheckboxCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXCheckbox *pXData, gslc_tsRect rElem, bool bRadio, gslc_teXCheckboxStyle nStyle, gslc_tsColor colCheck, bool bChecked)
 Create a Checkbox or Radio button Element. More...
 
bool gslc_ElemXCheckboxGetState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get a Checkbox element's current state. More...
 
void gslc_ElemXCheckboxSetState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bChecked)
 Set a Checkbox element's current state. More...
 
gslc_tsElemRefgslc_ElemXCheckboxFindChecked (gslc_tsGui *pGui, int16_t nGroupId)
 Find the checkbox within a group that has been checked. More...
 
void gslc_ElemXCheckboxToggleState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Toggle a Checkbox element's current state. More...
 
void gslc_ElemXCheckboxSetStateFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_XCHECKBOX pfuncCb)
 Assign the state callback function for a checkbox/radio button. More...
 
bool gslc_ElemXCheckboxDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Checkbox element on the screen. More...
 
bool gslc_ElemXCheckboxTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
 Handle touch events to Checkbox element. More...
 

Macro Definition Documentation

#define gslc_ElemXCheckboxCreate_P (   pGui,
  nElemId,
  nPage,
  nX,
  nY,
  nW,
  nH,
  colFill,
  bFillEn,
  nGroup,
  bRadio_,
  nStyle_,
  colCheck_,
  bChecked_ 
)

Create a Checkbox or Radio button Element in Flash.

Parameters
[in]pGuiPointer to GUI
[in]nElemIdUnique element ID to assign
[in]nPagePage ID to attach element to
[in]nXX coordinate of element
[in]nYY coordinate of element
[in]nWWidth of element
[in]nHHeight of element
[in]colFillColor for the control background fill
[in]bFillEnTrue if background filled, false otherwise (recommend True)
[in]nGroupGroup ID that radio buttons belong to (else GSLC_GROUP_NONE)
[in]bRadio_Radio-button functionality if true
[in]nStyle_Drawing style for checkbox / radio button
[in]colCheck_Color for inner fill when checked
[in]bChecked_Default state
Returns
none
#define GSLC_TYPEX_CHECKBOX

Typedef Documentation

typedef bool(* GSLC_CB_XCHECKBOX) (void *pvGui, void *pvElemRef, int16_t nSelId, bool bChecked)

Callback function for checkbox/radio element state change.

  • nSelId: Selected element's ID or GSLC_ID_NONE
  • bChecked: Element was selected if true, false otherwise

Enumeration Type Documentation

Checkbox drawing style.

Enumerator
GSLCX_CHECKBOX_STYLE_BOX 

Inner box.

GSLCX_CHECKBOX_STYLE_X 

Crossed.

GSLCX_CHECKBOX_STYLE_ROUND 

Circular.

Function Documentation

gslc_tsElemRef* gslc_ElemXCheckboxCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXCheckbox pXData,
gslc_tsRect  rElem,
bool  bRadio,
gslc_teXCheckboxStyle  nStyle,
gslc_tsColor  colCheck,
bool  bChecked 
)

Create a Checkbox or Radio button Element.

Parameters
[in]pGuiPointer to GUI
[in]nElemIdElement ID to assign (0..16383 or GSLC_ID_AUTO to autogen)
[in]nPagePage ID to attach element to
[in]pXDataPtr to extended element data structure
[in]rElemRectangle coordinates defining checkbox size
[in]bRadioRadio-button functionality if true
[in]nStyleDrawing style for checkbox / radio button
[in]colCheckColor for inner fill when checked
[in]bCheckedDefault state
Returns
Pointer to Element reference or NULL if failure
bool gslc_ElemXCheckboxDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a Checkbox element on the screen.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eRedrawRedraw mode
Returns
true if success, false otherwise
gslc_tsElemRef* gslc_ElemXCheckboxFindChecked ( gslc_tsGui pGui,
int16_t  nGroupId 
)

Find the checkbox within a group that has been checked.

Parameters
[in]pGuiPointer to GUI
[in]nGroupIdGroup ID to search
Returns
Element Ptr or NULL if none checked
bool gslc_ElemXCheckboxGetState ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef 
)

Get a Checkbox element's current state.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
Returns
Current state
void gslc_ElemXCheckboxSetState ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
bool  bChecked 
)

Set a Checkbox element's current state.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]bCheckedNew state
Returns
none
void gslc_ElemXCheckboxSetStateFunc ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
GSLC_CB_XCHECKBOX  pfuncCb 
)

Assign the state callback function for a checkbox/radio button.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]pfuncCbFunction pointer to callback routine (or NULL for none)
Returns
none
void gslc_ElemXCheckboxToggleState ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef 
)

Toggle a Checkbox element's current state.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
Returns
none
bool gslc_ElemXCheckboxTouch ( void *  pvGui,
void *  pvElemRef,
gslc_teTouch  eTouch,
int16_t  nRelX,
int16_t  nRelY 
)

Handle touch events to Checkbox element.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eTouchTouch event type
[in]nRelXTouch X coord relative to element
[in]nRelYTouch Y coord relative to element
Returns
true if success, false otherwise