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

Go to the source code of this file.

Data Structures

struct  gslc_tsXTogglebtn
 Extended data for Togglebtn element. More...
 

Macros

#define GSLC_TYPEX_TOGGLEBTN
 
#define gslc_ElemXTogglebtnCreate_P(pGui, nElemId, nPage, nX, nY, nW, nH, colThumb_, colOnState_, colOffState_, bCircular_, bChecked_, cbTouch)
 Create a Togglebtn button Element. More...
 

Functions

gslc_tsElemRefgslc_ElemXTogglebtnCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXTogglebtn *pXData, gslc_tsRect rElem, gslc_tsColor colThumb, gslc_tsColor colOnState, gslc_tsColor colOffState, bool bCircular, bool bChecked, GSLC_CB_TOUCH cbTouch)
 Create a Togglebtn button Element. More...
 
bool gslc_ElemXTogglebtnGetState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get a Togglebtn element's current state. More...
 
void gslc_ElemXTogglebtnSetState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bOn)
 Set a Togglebtn element's current state. More...
 
void gslc_ElemXTogglebtnToggleState (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Toggle a Togglebtn element's current state. More...
 
bool gslc_ElemXTogglebtnDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Togglebtn element on the screen. More...
 
bool gslc_ElemXTogglebtnTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
 Handle touch events to Togglebtn element. More...
 
gslc_tsElemRefgslc_ElemXTogglebtnFindSelected (gslc_tsGui *pGui, int16_t nGroupId)
 Find the togglebtn within a group that has been selected. More...
 

Macro Definition Documentation

#define gslc_ElemXTogglebtnCreate_P (   pGui,
  nElemId,
  nPage,
  nX,
  nY,
  nW,
  nH,
  colThumb_,
  colOnState_,
  colOffState_,
  bCircular_,
  bChecked_,
  cbTouch 
)

Create a Togglebtn 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]nXX coordinate of element
[in]nYY coordinate of element
[in]nWWidth of element
[in]nHHeight of element
[in]colThumb_Color of thumb
[in]colOnState_Color to indicate on position
[in]colOffState_Color to indicate off position
[in]bCircular_Style of the toggle button circular or rectangular
[in]bChecked_Default state
[in]cbTouchCallback for touch events
Returns
none
#define GSLC_TYPEX_TOGGLEBTN

Function Documentation

gslc_tsElemRef* gslc_ElemXTogglebtnCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXTogglebtn pXData,
gslc_tsRect  rElem,
gslc_tsColor  colThumb,
gslc_tsColor  colOnState,
gslc_tsColor  colOffState,
bool  bCircular,
bool  bChecked,
GSLC_CB_TOUCH  cbTouch 
)

Create a Togglebtn 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 togglebtn size
[in]colThumbColor of thumb
[in]colOnStateColor to indicate on position
[in]colOffStateColor to indicate off position
[in]bCircularStyle of the toggle button circular or rectangular
[in]bCheckedDefault state
[in]cbTouchCallback for touch events
Returns
Pointer to Element reference or NULL if failure
bool gslc_ElemXTogglebtnDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a Togglebtn 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_ElemXTogglebtnFindSelected ( gslc_tsGui pGui,
int16_t  nGroupId 
)

Find the togglebtn within a group that has been selected.

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

Get a Togglebtn element's current state.

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

Set a Togglebtn element's current state.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]bOnNew state
Returns
none
void gslc_ElemXTogglebtnToggleState ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef 
)

Toggle a Togglebtn element's current state.

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

Handle touch events to Togglebtn 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