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

Functions

void gslc_ElemXKeyPadReset_Alpha (void *pvConfig)
 Callback function to reset internal state. More...
 
void gslc_ElemXKeyPadTxtInit_Alpha (void *pvKeyPad)
 Callback function to update internal state whenever the text field is manually set via gslc_ElemXKeyPadValSet(). More...
 
void gslc_ElemXKeyPadLabelGet_Alpha (void *pvKeyPad, uint8_t nId, uint8_t nStrMax, char *pStr)
 Callback function to retrieve the label associated with a KeyPad button. More...
 
void gslc_ElemXKeyPadStyleGet_Alpha (void *pvKeyPad, uint8_t nId, bool *pbVisible, gslc_tsColor *pcolTxt, gslc_tsColor *pcolFrame, gslc_tsColor *pcolFill, gslc_tsColor *pcolGlow)
 Callback function to retrieve the style associated with a KeyPad button. More...
 
void gslc_ElemXKeyPadBtnEvt_Alpha (void *pvKeyPad, uint8_t nId, gslc_tsXKeyPadResult *psResult)
 Callback function activated when a key has been pressed. More...
 
gslc_tsXKeyPadCfg_Alpha gslc_ElemXKeyPadCfgInit_Alpha ()
 Initialize the KeyPad config structure. More...
 
gslc_tsElemRefgslc_ElemXKeyPadCreate_Alpha (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXKeyPad *pXData, int16_t nX0, int16_t nY0, int8_t nFontId, gslc_tsXKeyPadCfg_Alpha *pConfig)
 Create a KeyPad Element. More...
 

Variables

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

Function Documentation

void gslc_ElemXKeyPadBtnEvt_Alpha ( void *  pvKeyPad,
uint8_t  nId,
gslc_tsXKeyPadResult psResult 
)

Callback function activated when a key has been pressed.

This callback is used to enable the KeyPad variant to handle any events associated with the key press and update any internal state.

  • The callback is also used to determine whether any redraw actions need to be taken.
Parameters
[in]pvKeyPadVoid ptr to the KeyPad
[in]nIdKeyPad key ID
[out]psResultThe returned state vector (including redraw)
Returns
none
gslc_tsXKeyPadCfg_Alpha gslc_ElemXKeyPadCfgInit_Alpha ( )

Initialize the KeyPad config structure.

  • This routine should be called to initialize the configuration data structure before calling any of the KeyPad config APIs
Returns
Initialized KeyPad config structure
gslc_tsElemRef* gslc_ElemXKeyPadCreate_Alpha ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXKeyPad pXData,
int16_t  nX0,
int16_t  nY0,
int8_t  nFontId,
gslc_tsXKeyPadCfg_Alpha pConfig 
)

Create a KeyPad 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]nX0X KeyPad Starting Coordinate
[in]nY0Y KeyPad Starting Coordinate
[in]nFontIdFont ID to use for drawing the element
[in]pConfigPtr to config options
Returns
Pointer to Element or NULL if failure
void gslc_ElemXKeyPadLabelGet_Alpha ( void *  pvKeyPad,
uint8_t  nId,
uint8_t  nStrMax,
char *  pStr 
)

Callback function to retrieve the label associated with a KeyPad button.

This is called during the drawing of the KeyPad layout.

Parameters
[in]pvKeyPadVoid ptr to the KeyPad
[in]nIdKeyPad key ID
[in]nStrMaxMaximum length of return string (including NULL)
[out]pStrBuffer for the returned label
Returns
none
void gslc_ElemXKeyPadReset_Alpha ( void *  pvConfig)

Callback function to reset internal state.

Parameters
[in]pvConfigVoid ptr to the KeyPad config
Returns
none
void gslc_ElemXKeyPadStyleGet_Alpha ( void *  pvKeyPad,
uint8_t  nId,
bool *  pbVisible,
gslc_tsColor pcolTxt,
gslc_tsColor pcolFrame,
gslc_tsColor pcolFill,
gslc_tsColor pcolGlow 
)

Callback function to retrieve the style associated with a KeyPad button.

This is called during the drawing of the KeyPad layout.

  • This function is used to assign the color and visibility state of the keys at runtime.
  • This function can also be used to change the appearance dynamically, according to internal state (eg. dimmed buttons).
Parameters
[in]pvKeyPadVoid ptr to the KeyPad
[in]nIdKeyPad key ID
[out]pbVisibleThe returned visibility state
[out]pcolTxtThe returned text color
[out]pcolFrameThe returned key's frame color
[out]pcolFillThe returned key's fill color
[out]pcolGlowThe returned key's fill color when highlighted
Returns
none
void gslc_ElemXKeyPadTxtInit_Alpha ( void *  pvKeyPad)

Callback function to update internal state whenever the text field is manually set via gslc_ElemXKeyPadValSet().

  • This is used to ensure any KeyPad variant state can be kept in sync with the text string.
  • For example, if a numeric KeyPad is initiaized with a string that contains a minus sign, an internal negation flag might be set.
Parameters
[in]pvKeyPadVoid ptr to the KeyPad
Returns
none

Variable Documentation

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