Go to the source code of this file.
|
gslc_tsElemRef * | gslc_ElemXTextboxCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXTextbox *pXData, gslc_tsRect rElem, int16_t nFontId, char *pBuf, uint16_t nBufRows, uint16_t nBufCols) |
| Create a Textbox Element. More...
|
|
void | gslc_ElemXTextboxReset (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef) |
| Reset the contents of the textbox. More...
|
|
bool | gslc_ElemXTextboxDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw) |
| Draw a Textbox element on the screen. More...
|
|
void | gslc_ElemXTextboxAdd (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, char *pTxt) |
| Add a text string to the textbox. More...
|
|
void | gslc_ElemXTextboxColSet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor nCol) |
| Insert a color set code into the current buffer position. More...
|
|
void | gslc_ElemXTextboxColReset (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef) |
| Insert a color reset code into the current buffer position. More...
|
|
void | gslc_ElemXTextboxWrapSet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bWrapEn) |
| Enable or disable line wrap within textbox. More...
|
|
void | gslc_ElemXTextboxScrollSet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint8_t nScrollPos, uint8_t nScrollMax) |
| Set the textbox scroll position (nScrollPos) as a fraction of nScrollMax. More...
|
|
#define GSLC_TYPEX_TEXTBOX |
#define GSLC_XTEXTBOX_CODE_COL_RESET |
#define GSLC_XTEXTBOX_CODE_COL_SET |
Definitions for textbox special inline codes.
#define XTEXTBOX_REDRAW_ALL |
#define XTEXTBOX_REDRAW_NONE |
Add a text string to the textbox.
- If it includes a newline then the buffer will advance to the next row
- If wrap has been enabled, then a newline will be forced
- Parameters
-
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference |
[in] | pTxt | Pointer to text string (null-terminated) |
- Returns
- none
Insert a color reset code into the current buffer position.
- Parameters
-
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference |
- Returns
- none
Insert a color set code into the current buffer position.
- Parameters
-
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference |
[in] | nCol | Color to assign for next text written to textbox |
- Returns
- none
Create a Textbox Element.
- The textbox is a scrolling window designed for displaying multi-line text using a monospaced font. A character buffer is defined by nBufRows*nBufCols to capture the added text. If the allocation buffer is larger than the display size (defined by rElem), then a scrollbar will be shown.
- Support for changing color within a row can be enabled with GSLC_FEATURE_XTEXTBOX_EMBED 1
- Note that each color change command will consume 4 of the available "column" bytes.
- Parameters
-
[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 textbox size |
[in] | nFontId | Font ID to use for text area |
[in] | pBuf | Ptr to text buffer (already allocated) with size (nBufRows*nBufCols) chars |
[in] | nBufRows | Number of rows in buffer |
[in] | nBufCols | Number of columns in buffer (incl special codes) |
- Returns
- Pointer to Element reference or NULL if failure
bool gslc_ElemXTextboxDraw |
( |
void * |
pvGui, |
|
|
void * |
pvElemRef, |
|
|
gslc_teRedrawType |
eRedraw |
|
) |
| |
Draw a Textbox element on the screen.
- Parameters
-
[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 |
- Returns
- true if success, false otherwise
Reset the contents of the textbox.
- Clears the buffer and resets the position
- Parameters
-
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference |
- Returns
- none
void gslc_ElemXTextboxScrollSet |
( |
gslc_tsGui * |
pGui, |
|
|
gslc_tsElemRef * |
pElemRef, |
|
|
uint8_t |
nScrollPos, |
|
|
uint8_t |
nScrollMax |
|
) |
| |
Set the textbox scroll position (nScrollPos) as a fraction of nScrollMax.
- Parameters
-
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference |
[in] | nScrollPos | New scroll position |
[in] | nScrollMax | Maximum scroll position |
- Returns
- none
Enable or disable line wrap within textbox.
- Parameters
-
[in] | pGui | Pointer to GUI |
[in] | pElemRef | Pointer to Element reference |
[in] | bWrapEn | Enable line wrap if true |
- Returns
- none