GUIslice  0.16.0
Embedded GUI in C
XCheckbox.c File Reference
#include "GUIslice.h"
#include "GUIslice_drv.h"
#include "elem/XCheckbox.h"
#include <stdio.h>
Include dependency graph for XCheckbox.c:

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...
 
gslc_tsElemRefgslc_ElemXCheckboxFindChecked (gslc_tsGui *pGui, int16_t nGroupId)
 Find the checkbox within a group that has been checked. 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...
 
void gslc_ElemXCheckboxSetStateHelp (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bChecked, bool bDoCb)
 
void gslc_ElemXCheckboxSetState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bChecked)
 Set a Checkbox element's current state. More...
 
void gslc_ElemXCheckboxToggleState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Toggle a Checkbox element's current state. 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...
 

Variables

const char GSLC_PMEM ERRSTR_NULL []
 
const char GSLC_PMEM ERRSTR_PXD_NULL []
 

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_ElemXCheckboxSetStateHelp ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
bool  bChecked,
bool  bDoCb 
)
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

Variable Documentation

const char ERRSTR_NULL
const char GSLC_PMEM ERRSTR_PXD_NULL[]