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

Functions

gslc_tsElemRefgslc_ElemXSpinnerCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXSpinner *pXData, gslc_tsRect rElem, int16_t nMin, int16_t nMax, int16_t nVal, int16_t nIncr, int8_t nFontId, int8_t nButtonSz, GSLC_CB_INPUT cbInput)
 Create a Spinner Element. More...
 
bool gslc_ElemXSpinnerSetChars (void *pvGui, gslc_tsElemRef *pElemRef, uint8_t cIncr, uint8_t cDecr)
 Set Up and Down characters for the Spinner element. More...
 
bool gslc_ElemXSpinnerDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Spinner element on the screen. More...
 
int gslc_ElemXSpinnerGetCounter (gslc_tsGui *pGui, gslc_tsXSpinner *pSpinner)
 Get the current counter associated with Spinner. More...
 
void gslc_ElemXSpinnerSetCounter (gslc_tsGui *pGui, gslc_tsXSpinner *pSpinner, int16_t nCount)
 Set the current counter associated with Spinner. More...
 
bool gslc_ElemXSpinnerClick (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY)
 Handle a click event within the Spinner. More...
 
bool gslc_ElemXSpinnerTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
 Handle touch (up,down,move) events to Spinner element. More...
 

Variables

const char GSLC_PMEM ERRSTR_NULL []
 
const char GSLC_PMEM ERRSTR_PXD_NULL []
 
static const int16_t SPINNER_ID_BTN_INC
 
static const int16_t SPINNER_ID_BTN_DEC
 
static const int16_t SPINNER_ID_TXT
 

Function Documentation

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

Handle a click event within the Spinner.

  • This is called internally by the Spinner 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_ElemXSpinnerCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXSpinner pXData,
gslc_tsRect  rElem,
int16_t  nMin,
int16_t  nMax,
int16_t  nVal,
int16_t  nIncr,
int8_t  nFontId,
int8_t  nButtonSz,
GSLC_CB_INPUT  cbInput 
)

Create a Spinner 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 overall size
[in]nMinMinimum value of Spinner
[in]nMaxMaximum value of Spinner
[in]nValStarting value of Spinner
[in]nIncrIncrement Spinner by this value
[in]nFontIdFont ID to use for drawing the element
[in]nButtonSzSize of individual buttons
[in]cbInputCallback for touch events
Returns
Pointer to Element or NULL if failure
bool gslc_ElemXSpinnerDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a Spinner 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_ElemXSpinnerGetCounter ( gslc_tsGui pGui,
gslc_tsXSpinner pSpinner 
)

Get the current counter associated with Spinner.

Parameters
[in]pGuiPtr to GUI
[in]pSpinnerPtr to Element
Returns
Current counter value
bool gslc_ElemXSpinnerSetChars ( void *  pvGui,
gslc_tsElemRef pElemRef,
uint8_t  cIncr,
uint8_t  cDecr 
)

Set Up and Down characters for the Spinner element.

  • Called during redraw
Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pElemRefPtr to ElementRef
[in]cIncrCharacter to use to indicate incrementing the spinner
[in]cDecrCharacter to use to indicate decrementing the spinner
Returns
true if success, false otherwise
void gslc_ElemXSpinnerSetCounter ( gslc_tsGui pGui,
gslc_tsXSpinner pSpinner,
int16_t  nCount 
)

Set the current counter associated with Spinner.

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

Handle touch (up,down,move) events to Spinner 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 SPINNER_ID_BTN_DEC
static
const int16_t SPINNER_ID_BTN_INC
static
const int16_t SPINNER_ID_TXT
static