|
GUIslice
0.16.0
Embedded GUI in C
|
#include "GUIslice.h"

Go to the source code of this file.
Data Structures | |
| struct | gslc_tsXListbox |
| Extended data for Listbox element. More... | |
Macros | |
| #define | GSLC_TYPEX_LISTBOX |
| #define | XLISTBOX_SEL_NONE |
| #define | XLISTBOX_SIZE_AUTO |
| #define | XLISTBOX_BUF_OH_R |
Typedefs | |
| typedef bool(* | GSLC_CB_XLISTBOX_SEL) (void *pvGui, void *pvElem, int16_t nSel) |
| Callback function for Listbox feedback. More... | |
Functions | |
| gslc_tsElemRef * | gslc_ElemXListboxCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXListbox *pXData, gslc_tsRect rElem, int16_t nFontId, uint8_t *pBufItems, uint16_t nBufItemsMax, int16_t nSelDefault) |
| Create a Listbox Element. More... | |
| void | gslc_ElemXListboxSetSize (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int8_t nRows, int8_t nCols) |
| Configure the number of rows & columns to display in the listbox. More... | |
| void | gslc_ElemXListboxSetMargin (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int8_t nMarginW, int8_t nMarginH) |
| Configure the margin inside the listbox. More... | |
| void | gslc_ElemXListboxItemsSetSize (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nItemW, int16_t nItemH) |
| Configure the size of the listbox items. More... | |
| void | gslc_ElemXListboxItemsSetGap (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int8_t nGap, gslc_tsColor colGap) |
| Configure the gap between listbox items. More... | |
| void | gslc_ElemXListboxReset (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef) |
| Empty the listbox of all items. More... | |
| bool | gslc_ElemXListboxAddItem (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, const char *pStrItem) |
| Add an item to the listbox. More... | |
| bool | gslc_ElemXListboxInsertItemAt (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint16_t nInsertPos, const char *pStrItem) |
| Insert an item in the listbox at a specific position. More... | |
| bool | gslc_ElemXListboxDeleteItemAt (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint16_t nDeletePos) |
| Insert an item in the listbox at a specific position. More... | |
| bool | gslc_ElemXListboxGetItem (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nItemCurSel, char *pStrItem, uint8_t nStrItemLen) |
| Get the indexed listbox item. More... | |
| int16_t | gslc_ElemXListboxGetItemCnt (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef) |
| Get the number of items in the listbox. More... | |
| bool | gslc_ElemXListboxDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw) |
| Draw a Listbox element on the screen. More... | |
| bool | gslc_ElemXListboxTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY) |
| Handle touch events to Listbox element. More... | |
| int16_t | gslc_ElemXListboxGetSel (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef) |
| Get a Listbox element's current selection. More... | |
| bool | gslc_ElemXListboxSetSel (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nItemCurSel) |
| Set a Listbox element's current selection. More... | |
| bool | gslc_ElemXListboxSetScrollPos (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint16_t nScrollPos) |
| Set the Listbox scroll position. More... | |
| void | gslc_ElemXListboxSetSelFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_XLISTBOX_SEL funcCb) |
| Assign the selection callback function for a Listbox. More... | |
| #define GSLC_TYPEX_LISTBOX |
| #define XLISTBOX_BUF_OH_R |
| #define XLISTBOX_SEL_NONE |
| #define XLISTBOX_SIZE_AUTO |
| typedef bool(* GSLC_CB_XLISTBOX_SEL) (void *pvGui, void *pvElem, int16_t nSel) |
Callback function for Listbox feedback.
| bool gslc_ElemXListboxAddItem | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| const char * | pStrItem | ||
| ) |
Add an item to the listbox.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | pStrItem | String to use when creating the listbox item |
| gslc_tsElemRef* gslc_ElemXListboxCreate | ( | gslc_tsGui * | pGui, |
| int16_t | nElemId, | ||
| int16_t | nPage, | ||
| gslc_tsXListbox * | pXData, | ||
| gslc_tsRect | rElem, | ||
| int16_t | nFontId, | ||
| uint8_t * | pBufItems, | ||
| uint16_t | nBufItemsMax, | ||
| int16_t | nSelDefault | ||
| ) |
Create a Listbox 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] | rElem | Rectangle coordinates defining checkbox size |
| [in] | nFontId | Font ID for item display |
| [in] | pBufItems | Pointer to buffer that will contain list of items |
| [in] | nBufItemsMax | Max size of buffer for list of items (pBufItems) |
| [in] | nSelDefault | Default item to select |
| bool gslc_ElemXListboxDeleteItemAt | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| uint16_t | nDeletePos | ||
| ) |
Insert an item in the listbox at a specific position.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nDeletePos | Position to delete |
| bool gslc_ElemXListboxDraw | ( | void * | pvGui, |
| void * | pvElemRef, | ||
| gslc_teRedrawType | eRedraw | ||
| ) |
Draw a Listbox 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 |
| bool gslc_ElemXListboxGetItem | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| int16_t | nItemCurSel, | ||
| char * | pStrItem, | ||
| uint8_t | nStrItemLen | ||
| ) |
Get the indexed listbox item.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nItemCurSel | Item index to fetch |
| [out] | pStrItem | Ptr to the string buffer to receive the item |
| [in] | nStrItemLen | Maximum buffer length of pStrItem |
| int16_t gslc_ElemXListboxGetItemCnt | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef | ||
| ) |
Get the number of items in the listbox.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| int16_t gslc_ElemXListboxGetSel | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef | ||
| ) |
Get a Listbox element's current selection.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Pointer to Element reference |
| bool gslc_ElemXListboxInsertItemAt | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| uint16_t | nInsertPos, | ||
| const char * | pStrItem | ||
| ) |
Insert an item in the listbox at a specific position.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nInsertPos | Insertion position |
| [in] | pStrItem | String to use when creating the listbox item |
| void gslc_ElemXListboxItemsSetGap | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| int8_t | nGap, | ||
| gslc_tsColor | colGap | ||
| ) |
Configure the gap between listbox items.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nGap | Set the gap between listbox items (0 for none) |
| [in] | colGap | Set the color of the gap between listbox items |
| void gslc_ElemXListboxItemsSetSize | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| int16_t | nItemW, | ||
| int16_t | nItemH | ||
| ) |
Configure the size of the listbox items.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nItemW | Set the width of a listbox item (or -1 to auto-size) |
| [in] | nItemH | Set the height of a listbox item |
| void gslc_ElemXListboxReset | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef | ||
| ) |
Empty the listbox of all items.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| void gslc_ElemXListboxSetMargin | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| int8_t | nMarginW, | ||
| int8_t | nMarginH | ||
| ) |
Configure the margin inside the listbox.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nMarginW | Set the margin (horizontal) inside the listbox (0 for none) |
| [in] | nMarginH | Set the margin (horizontal) inside the listbox (0 for none) |
| bool gslc_ElemXListboxSetScrollPos | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| uint16_t | nScrollPos | ||
| ) |
Set the Listbox scroll position.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Pointer to Element reference |
| [in] | nScrollPos | Scroll the listbox so that the nScrollPos item is at the top (0 default) |
| bool gslc_ElemXListboxSetSel | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| int16_t | nItemCurSel | ||
| ) |
Set a Listbox element's current selection.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Pointer to Element reference |
| [in] | nItemCurSel | Listbox item to select (or -1 for none) |
| void gslc_ElemXListboxSetSelFunc | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| GSLC_CB_XLISTBOX_SEL | funcCb | ||
| ) |
Assign the selection callback function for a Listbox.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Pointer to Element reference |
| [in] | funcCb | Function pointer to selection routine (or NULL for none) |
| void gslc_ElemXListboxSetSize | ( | gslc_tsGui * | pGui, |
| gslc_tsElemRef * | pElemRef, | ||
| int8_t | nRows, | ||
| int8_t | nCols | ||
| ) |
Configure the number of rows & columns to display in the listbox.
| [in] | pGui | Pointer to GUI |
| [in] | pElemRef | Ptr to Element Reference to update |
| [in] | nRows | Number of rows (>= 1, or XLISTBOX_SIZE_AUTO to base on content) |
| [in] | nCols | Number of columns (>= 1) |
| bool gslc_ElemXListboxTouch | ( | void * | pvGui, |
| void * | pvElemRef, | ||
| gslc_teTouch | eTouch, | ||
| int16_t | nRelX, | ||
| int16_t | nRelY | ||
| ) |
Handle touch events to Listbox 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 |