GUIslice  0.16.0
Embedded GUI in C
Element: Creation Functions

Functions that create GUI elements. More...

Collaboration diagram for Element: Creation Functions:

Functions

gslc_tsElemRefgslc_ElemCreateTxt (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, char *pStrBuf, uint8_t nStrBufMax, int16_t nFontId)
 Create a Text Element. More...
 
gslc_tsElemRefgslc_ElemCreateBtnTxt (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, char *pStrBuf, uint8_t nStrBufMax, int16_t nFontId, GSLC_CB_TOUCH cbTouch)
 Create a textual Button Element. More...
 
gslc_tsElemRefgslc_ElemCreateBtnImg (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, gslc_tsImgRef sImgRef, gslc_tsImgRef sImgRefSel, GSLC_CB_TOUCH cbTouch)
 Create a graphical Button Element. More...
 
gslc_tsElemRefgslc_ElemCreateBox (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem)
 Create a Box Element. More...
 
gslc_tsElemRefgslc_ElemCreateLine (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1)
 Create a Line Element. More...
 
gslc_tsElemRefgslc_ElemCreateImg (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsRect rElem, gslc_tsImgRef sImgRef)
 Create an image Element. More...
 

Detailed Description

Functions that create GUI elements.

Function Documentation

gslc_tsElemRef* gslc_ElemCreateBox ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsRect  rElem 
)

Create a Box Element.

  • Draws a box with frame and fill
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]rElemRectangle coordinates defining box size
Returns
Pointer to the Element reference or NULL if failure
gslc_tsElemRef* gslc_ElemCreateBtnImg ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsRect  rElem,
gslc_tsImgRef  sImgRef,
gslc_tsImgRef  sImgRefSel,
GSLC_CB_TOUCH  cbTouch 
)

Create a graphical Button Element.

  • Creates a clickable element that uses a BMP image with no frame or fill
  • Transparency is supported by bitmap color (0xFF00FF)
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]rElemRectangle coordinates defining image size
[in]sImgRefImage reference to load (unselected state)
[in]sImgRefSelImage reference to load (selected state)
[in]cbTouchCallback for touch events
Returns
Pointer to the Element reference or NULL if failure
gslc_tsElemRef* gslc_ElemCreateBtnTxt ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsRect  rElem,
char *  pStrBuf,
uint8_t  nStrBufMax,
int16_t  nFontId,
GSLC_CB_TOUCH  cbTouch 
)

Create a textual Button Element.

  • Creates a clickable element that has a textual label with frame and fill
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]rElemRectangle coordinates defining text background size
[in]pStrBufString to copy into element
[in]nStrBufMaxMaximum length of string buffer (pStrBuf). Only applicable if GSLC_LOCAL_STR=0. Ignored if GSLC_LOCAL_STR=1.)
[in]nFontIdFont ID to use for text display
[in]cbTouchCallback for touch events
Returns
Pointer to the Element reference or NULL if failure
gslc_tsElemRef* gslc_ElemCreateImg ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsRect  rElem,
gslc_tsImgRef  sImgRef 
)

Create an image Element.

  • Draws an image
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]rElemRectangle coordinates defining box size
[in]sImgRefImage reference to load
Returns
Pointer to the Element reference or NULL if failure
gslc_tsElemRef* gslc_ElemCreateLine ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
int16_t  nX0,
int16_t  nY0,
int16_t  nX1,
int16_t  nY1 
)

Create a Line Element.

  • Draws a line with fill color
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]nX0X coordinate of line startpoint
[in]nY0Y coordinate of line startpoint
[in]nX1X coordinate of line endpoint
[in]nY1Y coordinate of line endpoint
Returns
Pointer to the Element reference or NULL if failure
gslc_tsElemRef* gslc_ElemCreateTxt ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsRect  rElem,
char *  pStrBuf,
uint8_t  nStrBufMax,
int16_t  nFontId 
)

Create a Text Element.

  • Draws a text string with filled background
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]rElemRectangle coordinates defining text background size
[in]pStrBufString to copy into element
[in]nStrBufMaxMaximum length of string buffer (pStrBuf). Only applicable if GSLC_LOCAL_STR=0. Ignored if GSLC_LOCAL_STR=1.)
[in]nFontIdFont ID to use for text display
Returns
Pointer to the Element reference or NULL if failure