GUIslice
0.16.0
Embedded GUI in C
|
Functions | |
void | gslc_ElemXKeyPadReset (gslc_tsXKeyPad *pKeyPad) |
void | gslc_ElemXKeyPadCfgInit (gslc_tsXKeyPadCfg *pConfig) |
Provide default initialization for the base XKeyPad. More... | |
int16_t | gslc_XKeyPadLookupId (gslc_tsKey *pKeys, uint8_t nKeyId) |
Find a key ID within a KeyPad label array and return it's index into the array. More... | |
void | gslc_XKeyPadDrawLayout (gslc_tsGui *pGui, void *pXData, gslc_tsColor cColFrame, gslc_tsColor cColFill, gslc_tsColor cColText, gslc_teRedrawType eRedraw) |
void | gslc_XKeyPadDrawKey (gslc_tsGui *pGui, gslc_tsXKeyPad *pXData, gslc_tsKey *pKey) |
Draw a key to the screen. More... | |
gslc_tsElemRef * | gslc_XKeyPadCreateBase (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXKeyPad *pXData, int16_t nX0, int16_t nY0, int8_t nFontId, gslc_tsXKeyPadCfg *pConfig) |
Create a KeyPad Element. More... | |
void | gslc_XKeyPadAdjustScroll (gslc_tsXKeyPad *pKeyPad) |
bool | gslc_XKeyPadLayoutSet (gslc_tsXKeyPadCfg *pConfig, int8_t eLayoutSel) |
Select a new KeyPad layout. More... | |
void | gslc_ElemXKeyPadValSet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, const char *pStrBuf) |
Set the current value for the editable text field. More... | |
void | gslc_ElemXKeyPadTargetRefSet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsElemRef *pTxtRef) |
Set target element reference for KeyPad return value. More... | |
int16_t | gslc_ElemXKeyPadDataTargetIdGet (gslc_tsGui *pGui, void *pvData) |
Fetch the element target ID associated with this KeyPad. More... | |
char * | gslc_ElemXKeyPadDataValGet (gslc_tsGui *pGui, void *pvData) |
Fetch the final value string of the KeyPad from a callback. More... | |
bool | gslc_ElemXKeyPadValGet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, char *pStrBuf, uint8_t nStrBufLen) |
Fetch the current value string associated with KeyPad element. More... | |
bool | gslc_XKeyPadDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw) |
Draw a KeyPad element on the screen. More... | |
void | gslc_ElemXKeyPadValSetCb (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_INPUT pfuncCb) |
Set the callback function associated with the KeyPad. More... | |
void | gslc_XKeyPadSizeAllGet (gslc_tsKey **pLayouts, uint8_t nNumLayouts, uint8_t *pnRows, uint8_t *pnCols) |
Calculate the overall dimensions of the KeyPad control encompassing all available layouts for the KeyPad, leveraging the computation in gslc_XKeyPadSizeGet(). More... | |
void | gslc_XKeyPadSizeGet (gslc_tsKey *pLayout, uint8_t *pnRows, uint8_t *pnCols) |
Calculate the overall dimensions of the KeyPad control encompassing the text field and key buttons. More... | |
int16_t | gslc_XKeyPadMapEvent (gslc_tsGui *pGui, void *pXData, int16_t nRelX, int16_t nRelY) |
bool | gslc_XKeyPadTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY) |
Handle touch (up,down,move) events to KeyPad element. More... | |
bool | gslc_XKeyPadTxtDelCh (gslc_tsXKeyPad *pKeyPad, uint8_t nPos) |
Remove a character from the KeyPad text field at the specified offset (nPos). More... | |
bool | gslc_XKeyPadTxtAddCh (gslc_tsXKeyPad *pKeyPad, char ch, uint8_t nPos) |
Add a character to the KeyPad text field at the specified offset (nPos). More... | |
bool | gslc_XKeyPadTxtAddStr (gslc_tsXKeyPad *pKeyPad, const char *pStr, uint8_t nPos) |
Add a string to the KeyPad text field at the specified offset (nPos). More... | |
void | gslc_ElemXKeyPadCfgSetButtonSz (gslc_tsXKeyPadCfg *pConfig, int8_t nButtonSzW, int8_t nButtonSzH) |
Update the KeyPad configuration to define the KeyPad button sizing. More... | |
void | gslc_ElemXKeyPadCfgSetButtonSpace (gslc_tsXKeyPadCfg *pConfig, int8_t nSpaceX, int8_t nSpaceY) |
Update the KeyPad configuration to define the KeyPad button spacing. More... | |
void | gslc_ElemXKeyPadCfgSetRoundEn (gslc_tsXKeyPadCfg *pConfig, bool bEn) |
Update the KeyPad configuration to enable rounded button corners. More... | |
void | gslc_XKeyPadDrawVirtualTxt (gslc_tsGui *pGui, gslc_tsRect rElem, gslc_tsXKeyPad *pKeyPad, gslc_tsColor cColFrame, gslc_tsColor cColFill, gslc_tsColor cColTxt) |
Draw a virtual Text Element. More... | |
void | gslc_XKeyPadDrawVirtualBtn (gslc_tsGui *pGui, gslc_tsRect rElem, char *pStrBuf, uint8_t nStrBufMax, int16_t nFontId, gslc_tsColor cColFrame, gslc_tsColor cColFill, gslc_tsColor cColText, bool bRoundedEn) |
Draw a virtual textual Button Element. More... | |
void | gslc_ElemXKeyPadInputAsk (gslc_tsGui *pGui, gslc_tsElemRef *pKeyPadRef, int16_t nPgPopup, gslc_tsElemRef *pTxtRef) |
Trigger a KeyPad popup and associate it with a text element. More... | |
char * | gslc_ElemXKeyPadInputGet (gslc_tsGui *pGui, gslc_tsElemRef *pTxtRef, void *pvCbData) |
Complete a KeyPad popup by retrieving the input data and storing it in the text element. More... | |
Variables | |
const char GSLC_PMEM | ERRSTR_NULL [] |
const char GSLC_PMEM | ERRSTR_PXD_NULL [] |
void gslc_ElemXKeyPadCfgInit | ( | gslc_tsXKeyPadCfg * | pConfig | ) |
Provide default initialization for the base XKeyPad.
[in] | pConfig | Ptr to the KeyPad base config structure |
void gslc_ElemXKeyPadCfgSetButtonSpace | ( | gslc_tsXKeyPadCfg * | pConfig, |
int8_t | nSpaceX, | ||
int8_t | nSpaceY | ||
) |
Update the KeyPad configuration to define the KeyPad button spacing.
[in,out] | pConfig | Pointer to the XKeyPad base config structure |
[in] | nSpaceX | Amount to inset button in horizontal direction (pixels) |
[in] | nSpaceY | Amount to inset button in vertical direction (pixels) |
void gslc_ElemXKeyPadCfgSetButtonSz | ( | gslc_tsXKeyPadCfg * | pConfig, |
int8_t | nButtonSzW, | ||
int8_t | nButtonSzH | ||
) |
Update the KeyPad configuration to define the KeyPad button sizing.
[in,out] | pConfig | Pointer to the XKeyPad base config structure |
[in] | nButtonSzW | Width of buttons in pixels |
[in] | nButtonSzH | Height of buttons in pixels |
void gslc_ElemXKeyPadCfgSetRoundEn | ( | gslc_tsXKeyPadCfg * | pConfig, |
bool | bEn | ||
) |
Update the KeyPad configuration to enable rounded button corners.
[in,out] | pConfig | Pointer to the XKeyPad base config structure |
[in] | bEn | Enable rounded corners |
int16_t gslc_ElemXKeyPadDataTargetIdGet | ( | gslc_tsGui * | pGui, |
void * | pvData | ||
) |
Fetch the element target ID associated with this KeyPad.
[in] | pGui | Pointer to GUI |
[in] | pvData | : Void ptr to callback data structure |
char* gslc_ElemXKeyPadDataValGet | ( | gslc_tsGui * | pGui, |
void * | pvData | ||
) |
Fetch the final value string of the KeyPad from a callback.
[in] | pGui | Pointer to GUI |
[out] | pvData | : Void ptr to callback data structure |
void gslc_ElemXKeyPadInputAsk | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pKeyPadRef, | ||
int16_t | nPgPopup, | ||
gslc_tsElemRef * | pTxtRef | ||
) |
Trigger a KeyPad popup and associate it with a text element.
[in] | pGui | Pointer to GUI |
[in] | pKeyPadRef | Pointer to KeyPad element reference |
[in] | nPgPopup | Page enum that contains the popup to show |
[in] | pTxtRef | Pointer to associated text field element reference |
char* gslc_ElemXKeyPadInputGet | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pTxtRef, | ||
void * | pvCbData | ||
) |
Complete a KeyPad popup by retrieving the input data and storing it in the text element.
[in] | pGui | Pointer to GUI |
[in] | pTxtRef | Pointer to associated text field element reference |
[in] | pvCbData | Void pointer to callback function's pvData |
void gslc_ElemXKeyPadReset | ( | gslc_tsXKeyPad * | pKeyPad | ) |
void gslc_ElemXKeyPadTargetRefSet | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
gslc_tsElemRef * | pTargetRef | ||
) |
Set target element reference for KeyPad return value.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Ptr to KeyPad Element reference |
[in] | pTargetRef | Element reference for target of KeyPad value |
bool gslc_ElemXKeyPadValGet | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
char * | pStrBuf, | ||
uint8_t | nStrBufMax | ||
) |
Fetch the current value string associated with KeyPad element.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Ptr to KeyPad Element reference |
[out] | pStrBuf | String buffer |
[in] | nStrBufMax | Maximum length of string buffer (pStrBuf) including terminator |
void gslc_ElemXKeyPadValSet | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
const char * | pStrBuf | ||
) |
Set the current value for the editable text field.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Ptr to KeyPad Element reference |
[in] | pStrBuf | String to copy into keypad |
void gslc_ElemXKeyPadValSetCb | ( | gslc_tsGui * | pGui, |
gslc_tsElemRef * | pElemRef, | ||
GSLC_CB_INPUT | pfuncCb | ||
) |
Set the callback function associated with the KeyPad.
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element Reference for KeyPad |
[in] | pfuncCb | Callback function pointer |
void gslc_XKeyPadAdjustScroll | ( | gslc_tsXKeyPad * | pKeyPad | ) |
gslc_tsElemRef* gslc_XKeyPadCreateBase | ( | gslc_tsGui * | pGui, |
int16_t | nElemId, | ||
int16_t | nPage, | ||
gslc_tsXKeyPad * | pXData, | ||
int16_t | nX0, | ||
int16_t | nY0, | ||
int8_t | nFontId, | ||
gslc_tsXKeyPadCfg * | pConfig | ||
) |
Create a KeyPad Element.
[in] | pGui | Pointer to GUI |
[in] | nElemId | Element ID to assign (0..16383 or GSLC_ID_AUTO to autogen) |
[in] | nPage | Page ID to attach element to |
[in] | pXData | Ptr to extended element data structure |
[in] | nX0 | X KeyPad Starting Coordinate |
[in] | nY0 | Y KeyPad Starting Coordinate |
[in] | nFontId | Font ID to use for drawing the element |
[in] | pConfig | Pointer to base Config options |
bool gslc_XKeyPadDraw | ( | void * | pvGui, |
void * | pvElemRef, | ||
gslc_teRedrawType | eRedraw | ||
) |
Draw a KeyPad element on the screen.
[in] | pvGui | Void ptr to GUI (typecast to gslc_tsGui*) |
[in] | pvElemRef | Void ptr to Element reference (typecast to gslc_tsElemRef*) |
[in] | eRedraw | Redraw mode |
void gslc_XKeyPadDrawKey | ( | gslc_tsGui * | pGui, |
gslc_tsXKeyPad * | pXData, | ||
gslc_tsKey * | pKey | ||
) |
Draw a key to the screen.
[in] | pGui | Pointer to GUI |
[in] | pXData | Ptr to extended element data structure |
[in] | pKey | Ptr to key being drawn |
void gslc_XKeyPadDrawLayout | ( | gslc_tsGui * | pGui, |
void * | pXData, | ||
gslc_tsColor | cColFrame, | ||
gslc_tsColor | cColFill, | ||
gslc_tsColor | cColText, | ||
gslc_teRedrawType | eRedraw | ||
) |
void gslc_XKeyPadDrawVirtualBtn | ( | gslc_tsGui * | pGui, |
gslc_tsRect | rElem, | ||
char * | pStrBuf, | ||
uint8_t | nStrBufMax, | ||
int16_t | nFontId, | ||
gslc_tsColor | cColFrame, | ||
gslc_tsColor | cColFill, | ||
gslc_tsColor | cColTxt, | ||
bool | bRoundedEn | ||
) |
Draw a virtual textual Button Element.
[in] | pGui | Pointer to GUI |
[in] | rElem | Rectangle coordinates defining element size |
[in] | pStrBuf | String to copy into element |
[in] | nStrBufMax | Maximum length of string buffer (pStrBuf). |
[in] | nFontId | Font ID to use for text display |
[in] | cColFrame | Frame color for element |
[in] | cColFill | Fill color for element |
[in] | cColTxt | Text color for element |
[in] | bRoundedEn | Use Rounded Corners? |
void gslc_XKeyPadDrawVirtualTxt | ( | gslc_tsGui * | pGui, |
gslc_tsRect | rElem, | ||
gslc_tsXKeyPad * | pKeyPad, | ||
gslc_tsColor | cColFrame, | ||
gslc_tsColor | cColFill, | ||
gslc_tsColor | cColTxt | ||
) |
Draw a virtual Text Element.
[in] | pGui | Pointer to GUI |
[in] | rElem | Rectangle coordinates defining element size |
[in] | pKeyPad | Pointer to KeyPad struct |
[in] | cColFrame | Frame color for element |
[in] | cColFill | Fill color for element |
[in] | cColTxt | Text color for element |
bool gslc_XKeyPadLayoutSet | ( | gslc_tsXKeyPadCfg * | pConfig, |
int8_t | eLayoutSel | ||
) |
Select a new KeyPad layout.
[in] | pConfig | Ptr to the KeyPad configuration |
[in] | eLayoutSel | Layout index to select |
int16_t gslc_XKeyPadLookupId | ( | gslc_tsKey * | pKeys, |
uint8_t | nKeyId | ||
) |
Find a key ID within a KeyPad label array and return it's index into the array.
[in] | pKeys | Ptr to the Keypad label array |
[in] | nKeyId | Key ID to look for |
int16_t gslc_XKeyPadMapEvent | ( | gslc_tsGui * | pGui, |
void * | pXData, | ||
int16_t | nRelX, | ||
int16_t | nRelY | ||
) |
void gslc_XKeyPadSizeAllGet | ( | gslc_tsKey ** | pLayouts, |
uint8_t | nNumLayouts, | ||
uint8_t * | pnRows, | ||
uint8_t * | pnCols | ||
) |
Calculate the overall dimensions of the KeyPad control encompassing all available layouts for the KeyPad, leveraging the computation in gslc_XKeyPadSizeGet().
[in] | pLayouts | Ptr to the array of KeyPad layouts |
[in] | nNumLayouts | Number of layouts in pLayouts |
[out] | pnRows | Ptr for the number of rows |
[out] | pnCols | Ptr for the number of columns |
void gslc_XKeyPadSizeGet | ( | gslc_tsKey * | pLayout, |
uint8_t * | pnRows, | ||
uint8_t * | pnCols | ||
) |
Calculate the overall dimensions of the KeyPad control encompassing the text field and key buttons.
The dimension is calculated in units of the configured key size (width and height), and accounts for any column spans.
[in] | pLayout | Ptr to the KeyPad layout |
[out] | pnRows | Ptr for the number of rows |
[out] | pnCols | Ptr for the number of columns |
bool gslc_XKeyPadTouch | ( | void * | pvGui, |
void * | pvElemRef, | ||
gslc_teTouch | eTouch, | ||
int16_t | nRelX, | ||
int16_t | nRelY | ||
) |
Handle touch (up,down,move) events to KeyPad element.
[in] | pvGui | Void ptr to GUI (typecast to gslc_tsGui*) |
[in] | pvElemRef | Void ptr to Element reference (typecast to gslc_tsElemRef*) |
[in] | eTouch | Touch event type |
[in] | nRelX | Touch X coord relative to element |
[in] | nRelY | Touch Y coord relative to element |
bool gslc_XKeyPadTxtAddCh | ( | gslc_tsXKeyPad * | pKeyPad, |
char | ch, | ||
uint8_t | nPos | ||
) |
Add a character to the KeyPad text field at the specified offset (nPos).
Providing an offset equal to the end of the existing buffer length will cause the addition to the end, whereas an offset within the buffer will cause an insert.
[in] | pKeyPad | Ptr to the KeyPad |
[in] | ch | Character to add |
[in] | nPos | Buffer position for the insertion |
bool gslc_XKeyPadTxtAddStr | ( | gslc_tsXKeyPad * | pKeyPad, |
const char * | pStr, | ||
uint8_t | nPos | ||
) |
Add a string to the KeyPad text field at the specified offset (nPos).
Providing an offset equal to the end of the existing buffer length will cause the addition to the end, whereas an offset within the buffer will cause an insert.
[in] | pKeyPad | Ptr to the KeyPad |
[in] | pStr | String to add |
[in] | nPos | Buffer position for the insertion |
bool gslc_XKeyPadTxtDelCh | ( | gslc_tsXKeyPad * | pKeyPad, |
uint8_t | nPos | ||
) |
Remove a character from the KeyPad text field at the specified offset (nPos).
[in] | pKeyPad | Ptr to the KeyPad |
[in] | nPos | Buffer position for the removal |
const char GSLC_PMEM ERRSTR_NULL[] |
const char GSLC_PMEM ERRSTR_PXD_NULL[] |