GUIslice  0.16.0
Embedded GUI in C
Internal: Element Collection Functions
Collaboration diagram for Internal: Element Collection Functions:

Functions

void gslc_CollectReset (gslc_tsCollect *pCollect, gslc_tsElem *asElem, uint16_t nElemMax, gslc_tsElemRef *asElemRef, uint16_t nElemRefMax)
 Reset the members of an element collection. More...
 
gslc_tsElemRefgslc_CollectElemAdd (gslc_tsGui *pGui, gslc_tsCollect *pCollect, const gslc_tsElem *pElem, gslc_teElemRefFlags eFlags)
 Add an element to a collection. More...
 
bool gslc_CollectGetRedraw (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Determine if any elements in a collection need redraw. More...
 
gslc_tsElemRefgslc_CollectFindElemById (gslc_tsGui *pGui, gslc_tsCollect *pCollect, int16_t nElemId)
 Find an element in a collection by its Element ID. More...
 
gslc_tsElemRefgslc_CollectFindElemFromCoord (gslc_tsGui *pGui, gslc_tsCollect *pCollect, int16_t nX, int16_t nY)
 Find an element in a collection by a coordinate coordinate. More...
 
int gslc_CollectGetNextId (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Allocate the next available Element ID in a collection. More...
 
gslc_tsElemRefgslc_CollectGetElemRefTracked (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Get the element within a collection that is currently being tracked. More...
 
void gslc_CollectSetElemTracked (gslc_tsGui *pGui, gslc_tsCollect *pCollect, gslc_tsElemRef *pElemRef)
 Set the element within a collection that is currently being tracked. More...
 
int16_t gslc_CollectGetFocus (gslc_tsGui *pGui, gslc_tsCollect *pCollect)
 Get the element index within a collection that is currently in focus. More...
 
void gslc_CollectSetFocus (gslc_tsGui *pGui, gslc_tsCollect *pCollect, int16_t nElemInd)
 Set the element index within a collection that is currently in focus. More...
 
bool gslc_CollectFindFocusStep (gslc_tsGui *pGui, gslc_tsCollect *pCollect, bool bNext, bool *pbWrapped, int16_t *pnElemInd)
 
void gslc_CollectSetParent (gslc_tsGui *pGui, gslc_tsCollect *pCollect, gslc_tsElemRef *pElemRefParent)
 Assign the parent element reference to all elements within a collection. More...
 

Detailed Description

Function Documentation

gslc_tsElemRef* gslc_CollectElemAdd ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
const gslc_tsElem pElem,
gslc_teElemRefFlags  eFlags 
)

Add an element to a collection.

  • Note that the contents of pElem are copied to the collection's element array so the pElem pointer can be discarded are the call is complete.
Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
[in]pElemPtr to the element to add
[in]eFlagsFlags describing the element (eg. whether the element should be stored in internal RAM array or is located in Flash/PROGMEM).
Returns
Pointer to the element reference in the collection that has been added or NULL if there was an error
gslc_tsElemRef* gslc_CollectFindElemById ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
int16_t  nElemId 
)

Find an element in a collection by its Element ID.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
[in]nElemIdElement ID to search for
Returns
Pointer to the element reference in the collection that was found or NULL if no matches found
gslc_tsElemRef* gslc_CollectFindElemFromCoord ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
int16_t  nX,
int16_t  nY 
)

Find an element in a collection by a coordinate coordinate.

  • A match is found if the element is "clickable" (bClickEn=true) and the coordinate falls within the element's bounds (rElem).
Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
[in]nXAbsolute X coordinate to use for search
[in]nYAbsolute Y coordinate to use for search
Returns
Pointer to the element reference in the collection that was found or NULL if no matches found
bool gslc_CollectFindFocusStep ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
bool  bNext,
bool *  pbWrapped,
int16_t *  pnElemInd 
)
Todo:
Doc. This API is experimental and subject to change
gslc_tsElemRef* gslc_CollectGetElemRefTracked ( gslc_tsGui pGui,
gslc_tsCollect pCollect 
)

Get the element within a collection that is currently being tracked.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
Returns
Pointer to the element reference in the collection that is currently being tracked or NULL if no elements are being tracked
int16_t gslc_CollectGetFocus ( gslc_tsGui pGui,
gslc_tsCollect pCollect 
)

Get the element index within a collection that is currently in focus.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
Returns
Element index or GSLC_IND_NONE for none
int gslc_CollectGetNextId ( gslc_tsGui pGui,
gslc_tsCollect pCollect 
)

Allocate the next available Element ID in a collection.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
Returns
Element ID that is reserved for use
bool gslc_CollectGetRedraw ( gslc_tsGui pGui,
gslc_tsCollect pCollect 
)

Determine if any elements in a collection need redraw.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to Element collection
Returns
True if redraw required, false otherwise
void gslc_CollectReset ( gslc_tsCollect pCollect,
gslc_tsElem asElem,
uint16_t  nElemMax,
gslc_tsElemRef asElemRef,
uint16_t  nElemRefMax 
)

Reset the members of an element collection.

Parameters
[in]pCollectPointer to the collection
[in]asElemInternal element array storage to associate with the collection
[in]nElemMaxMaximum number of elements that can be added to the internal element array (ie. RAM))
[in]asElemRefInternal element reference array storage to associate with the collection. 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]nElemRefMaxMaximum number of elements in the reference array. This is effectively the maximum number of elements that can appear in the collection, irrespective of whether it is stored in RAM or Flash (PROGMEM).
Returns
none
void gslc_CollectSetElemTracked ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
gslc_tsElemRef pElemRef 
)

Set the element within a collection that is currently being tracked.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
[in]pElemRefPtr to element reference to mark as being tracked
Returns
none
void gslc_CollectSetFocus ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
int16_t  nElemInd 
)

Set the element index within a collection that is currently in focus.

Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
[in]nElemIndElement index to set in focus, GSLC_IND_NONE for none
Returns
none
void gslc_CollectSetParent ( gslc_tsGui pGui,
gslc_tsCollect pCollect,
gslc_tsElemRef pElemRefParent 
)

Assign the parent element reference to all elements within a collection.

  • This is generally used in the case of compound elements where updates to a sub-element should cause the parent (compound element) to be redrawn as well.)
Parameters
[in]pGuiPointer to GUI
[in]pCollectPointer to the collection
[in]pElemRefParentPtr to element reference that is the parent
Returns
none