GUIslice  0.16.0
Embedded GUI in C
Page Functions

Functions that operate at the page level. More...

Functions

int gslc_GetPageCur (gslc_tsGui *pGui)
 Fetch the current page ID. More...
 
void gslc_SetStackPage (gslc_tsGui *pGui, uint8_t nStackPos, int16_t nPageId)
 Assign a page to the page stack. More...
 
void gslc_SetStackState (gslc_tsGui *pGui, uint8_t nStackPos, bool bActive, bool bDoDraw)
 Change the status of a page in a page stack. More...
 
void gslc_SetPageBase (gslc_tsGui *pGui, int16_t nPageId)
 Assigns a page for the base layer in the page stack. More...
 
void gslc_SetPageCur (gslc_tsGui *pGui, int16_t nPageId)
 Select a page for the current layer in the page stack. More...
 
void gslc_SetPageOverlay (gslc_tsGui *pGui, int16_t nPageId)
 Select a page for the overlay layer in the page stack. More...
 
void gslc_PopupShow (gslc_tsGui *pGui, int16_t nPageId, bool bModal)
 Show a popup dialog. More...
 
void gslc_PopupHide (gslc_tsGui *pGui)
 Hides the currently active popup dialog. More...
 
void gslc_PageRedrawSet (gslc_tsGui *pGui, bool bRedraw)
 Update the need-redraw status for the current page. More...
 
bool gslc_PageRedrawGet (gslc_tsGui *pGui)
 Get the need-redraw status for the current page. More...
 
void gslc_PageAdd (gslc_tsGui *pGui, int16_t nPageId, gslc_tsElem *psElem, uint16_t nMaxElem, gslc_tsElemRef *psElemRef, uint16_t nMaxElemRef)
 Add a page to the GUI. More...
 
gslc_tsElemRefgslc_PageFindElemById (gslc_tsGui *pGui, int16_t nPageId, int16_t nElemId)
 Find an element in the GUI by its Page ID and Element ID. More...
 

Detailed Description

Functions that operate at the page level.

Function Documentation

int gslc_GetPageCur ( gslc_tsGui pGui)

Fetch the current page ID.

Parameters
[in]pGuiPointer to GUI
Returns
Page ID
void gslc_PageAdd ( gslc_tsGui pGui,
int16_t  nPageId,
gslc_tsElem psElem,
uint16_t  nMaxElem,
gslc_tsElemRef psElemRef,
uint16_t  nMaxElemRef 
)

Add a page to the GUI.

  • This call associates an element array with the collection within the page
  • Once a page has been added to the GUI, elements can be added to the page by specifying the same page ID
Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to assign
[in]psElemInternal element array storage to associate with the page
[in]nMaxElemMaximum number of elements that can be added to the internal element array (ie. RAM))
[in]psElemRefInternal element reference array storage to associate with the page. All elements, whether they are located in the internal element array or in external Flash (PROGMEM) storage, require an entry in the element reference array.
[in]nMaxElemRefMaximum number of elements in the reference array. This is effectively the maximum number of elements that can appear on a page, irrespective of whether it is stored in RAM or Flash (PROGMEM).
Returns
none
gslc_tsElemRef* gslc_PageFindElemById ( gslc_tsGui pGui,
int16_t  nPageId,
int16_t  nElemId 
)

Find an element in the GUI by its Page ID and Element ID.

Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to search
[in]nElemIdElement ID to search
Returns
Ptr to an element or NULL if none found
bool gslc_PageRedrawGet ( gslc_tsGui pGui)

Get the need-redraw status for the current page.

Parameters
[in]pGuiPointer to GUI
Returns
True if redraw required, false otherwise
void gslc_PageRedrawSet ( gslc_tsGui pGui,
bool  bRedraw 
)

Update the need-redraw status for the current page.

Parameters
[in]pGuiPointer to GUI
[in]bRedrawTrue if redraw required, false otherwise
Returns
none
void gslc_PopupHide ( gslc_tsGui pGui)

Hides the currently active popup dialog.

Parameters
[in]pGuiPointer to GUI
Returns
none
void gslc_PopupShow ( gslc_tsGui pGui,
int16_t  nPageId,
bool  bModal 
)

Show a popup dialog.

  • Popup dialogs use the overlay layer in the page stack
Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to use as the popup dialog
[in]bModalIf true, popup is modal (other layers won't accept touch). If false, popup is modeless (other layers still accept touch)
Returns
none
void gslc_SetPageBase ( gslc_tsGui pGui,
int16_t  nPageId 
)

Assigns a page for the base layer in the page stack.

Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to select (or GSLC_PAGE_NONE to disable)
Returns
none
void gslc_SetPageCur ( gslc_tsGui pGui,
int16_t  nPageId 
)

Select a page for the current layer in the page stack.

Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to select
Returns
none
void gslc_SetPageOverlay ( gslc_tsGui pGui,
int16_t  nPageId 
)

Select a page for the overlay layer in the page stack.

Parameters
[in]pGuiPointer to GUI
[in]nPageIdPage ID to select (or GSLC_PAGE_NONE to disable)
Returns
none
void gslc_SetStackPage ( gslc_tsGui pGui,
uint8_t  nStackPos,
int16_t  nPageId 
)

Assign a page to the page stack.

Parameters
[in]pGuiPointer to GUI
[in]nStackPosPosition to update in the page stack (0..GSLC_STACK__MAX-1)
[in]nPageIdPage ID to select as current
Returns
none
void gslc_SetStackState ( gslc_tsGui pGui,
uint8_t  nStackPos,
bool  bActive,
bool  bDoDraw 
)

Change the status of a page in a page stack.

Parameters
[in]pGuiPointer to GUI
[in]nStackPosPosition to update in the page stack (0..GSLC_STACK__MAX-1)
[in]bActiveIndicate if page should receive touch events
[in]bDoDrawIndicate if page should continue to be redrawn. If pages in the stack are overlapping and an element in a lower layer continues to receive updates, then the element may "show through" the layers above it. In such cases where pages in the stack are overlapping and lower pages contain dynamically updating elements, it may be best to disable redraw while the overlapping page is visible (by setting bDoDraw to false).
Returns
none