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

Functions

gslc_tsElemRefgslc_ElemXSelNumCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXSelNum *pXData, gslc_tsRect rElem, int8_t nFontId)
 Create a SelNum Element. More...
 
bool gslc_ElemXSelNumDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a SelNum element on the screen. More...
 
int gslc_ElemXSelNumGetCounter (gslc_tsGui *pGui, gslc_tsXSelNum *pSelNum)
 Get the current counter associated with SelNum. More...
 
void gslc_ElemXSelNumSetCounter (gslc_tsGui *pGui, gslc_tsXSelNum *pSelNum, int16_t nCount)
 Set the current counter associated with SelNum. More...
 
bool gslc_ElemXSelNumClick (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY)
 Handle a click event within the SelNum. More...
 
bool gslc_ElemXSelNumTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
 Handle touch (up,down,move) events to SelNum element. More...
 

Variables

const char GSLC_PMEM ERRSTR_NULL []
 
const char GSLC_PMEM ERRSTR_PXD_NULL []
 
static const int16_t SELNUM_ID_BTN_INC
 
static const int16_t SELNUM_ID_BTN_DEC
 
static const int16_t SELNUM_ID_TXT
 

Function Documentation

bool gslc_ElemXSelNumClick ( void *  pvGui,
void *  pvElemRef,
gslc_teTouch  eTouch,
int16_t  nX,
int16_t  nY 
)

Handle a click event within the SelNum.

  • This is called internally by the SelNum touch handler
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]nXTouch X coord
[in]nYTouch Y coord
Returns
none
gslc_tsElemRef* gslc_ElemXSelNumCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXSelNum pXData,
gslc_tsRect  rElem,
int8_t  nFontId 
)

Create a SelNum 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 element size
[in]nFontIdFont ID to use for drawing the element
Returns
Pointer to Element or NULL if failure
bool gslc_ElemXSelNumDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a SelNum element on the screen.

  • Called during redraw
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
int gslc_ElemXSelNumGetCounter ( gslc_tsGui pGui,
gslc_tsXSelNum pSelNum 
)

Get the current counter associated with SelNum.

Parameters
[in]pGuiPtr to GUI
[in]pSelNumPtr to Element
Returns
Current counter value
void gslc_ElemXSelNumSetCounter ( gslc_tsGui pGui,
gslc_tsXSelNum pSelNum,
int16_t  nCount 
)

Set the current counter associated with SelNum.

Parameters
[in]pGuiPointer to GUI
[in]pSelNumPtr to Element
[in]nCountNew counter value
Returns
none
bool gslc_ElemXSelNumTouch ( void *  pvGui,
void *  pvElemRef,
gslc_teTouch  eTouch,
int16_t  nRelX,
int16_t  nRelY 
)

Handle touch (up,down,move) events to SelNum 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 GSLC_PMEM ERRSTR_NULL[]
const char GSLC_PMEM ERRSTR_PXD_NULL[]
const int16_t SELNUM_ID_BTN_DEC
static
const int16_t SELNUM_ID_BTN_INC
static
const int16_t SELNUM_ID_TXT
static