GUIslice  0.16.0
Embedded GUI in C
XSeekbar.c File Reference
#include "GUIslice.h"
#include "GUIslice_drv.h"
#include "elem/XSeekbar.h"
#include <stdio.h>
Include dependency graph for XSeekbar.c:

Functions

gslc_tsElemRefgslc_ElemXSeekbarCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXSeekbar *pXData, gslc_tsRect rElem, int16_t nPosMin, int16_t nPosMax, int16_t nPos, uint8_t nProgressW, uint8_t nRemainW, uint8_t nThumbSz, gslc_tsColor colProgress, gslc_tsColor colRemain, gslc_tsColor colThumb, bool bVert)
 Create a Seekbar Element. More...
 
void gslc_ElemXSeekbarSetStyle (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bTrimThumb, gslc_tsColor colTrim, bool bFrameThumb, gslc_tsColor colFrame, uint16_t nTickDiv, int16_t nTickLen, gslc_tsColor colTick)
 Set a Seekbar element's style, this includes thumb customizations and tick marks. More...
 
int gslc_ElemXSeekbarGetPos (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get a Seekbar element's current position. More...
 
void gslc_ElemXSeekbarSetPos (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nPos)
 Set a Seekbar element's current position. More...
 
void gslc_ElemXSeekbarSetPosFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_XSEEKBAR_POS funcCb)
 Assign the position callback function for a slider. More...
 
bool gslc_ElemXSeekbarDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Seekbar element on the screen. More...
 
bool gslc_ElemXSeekbarTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
 Handle touch events to Seekbar element. More...
 

Variables

const char GSLC_PMEM ERRSTR_NULL []
 
const char GSLC_PMEM ERRSTR_PXD_NULL []
 

Function Documentation

gslc_tsElemRef* gslc_ElemXSeekbarCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXSeekbar pXData,
gslc_tsRect  rElem,
int16_t  nPosMin,
int16_t  nPosMax,
int16_t  nPos,
uint8_t  nProgressW,
uint8_t  nRemainW,
uint8_t  nThumbSz,
gslc_tsColor  colProgress,
gslc_tsColor  colRemain,
gslc_tsColor  colThumb,
bool  bVert 
)

Create a Seekbar Element.

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]pXDataPtr to extended element data structure
[in]rElemRectangle coordinates defining checkbox size
[in]nPosMinMinimum position value
[in]nPosMaxMaximum position value
[in]nPosStarting position value
[in]nProgressWWidth of progress track
[in]nRemainWWidth of remaining track
[in]nThumbSzSize of the thumb control
[in]colProgressColor of progress fill bar
[in]colRemainColor remaining fill bar
[in]colThumbColor for the thumb indicator
[in]bVertOrientation (true for vertical)
Returns
Pointer to Element reference or NULL if failure
bool gslc_ElemXSeekbarDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a Seekbar element on the screen.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eRedrawRedraw mode
Returns
true if success, false otherwise
int gslc_ElemXSeekbarGetPos ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef 
)

Get a Seekbar element's current position.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
Returns
Current slider position
void gslc_ElemXSeekbarSetPos ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
int16_t  nPos 
)

Set a Seekbar element's current position.

Parameters
[in]pGuiPointer to GUI
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]nPosNew position value
Returns
none
void gslc_ElemXSeekbarSetPosFunc ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
GSLC_CB_XSEEKBAR_POS  funcCb 
)

Assign the position callback function for a slider.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]funcCbFunction pointer to position routine (or NULL for none)
Returns
none
void gslc_ElemXSeekbarSetStyle ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
bool  bTrimThumb,
gslc_tsColor  colTrim,
bool  bFrameThumb,
gslc_tsColor  colFrame,
uint16_t  nTickDiv,
int16_t  nTickLen,
gslc_tsColor  colTick 
)

Set a Seekbar element's style, this includes thumb customizations and tick marks.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]bTrimThumbShow a colored trim for thumb?
[in]colTrimColor of thumb trim
[in]bFrameThumbShow a frame around thumb?
[in]colFrameColor of thumb frame
[in]nTickDivNumber of tick divisions to show (0 for none)
[in]nTickLenLength of tick marks
[in]colTickColor of ticks
Returns
none
bool gslc_ElemXSeekbarTouch ( void *  pvGui,
void *  pvElemRef,
gslc_teTouch  eTouch,
int16_t  nRelX,
int16_t  nRelY 
)

Handle touch events to Seekbar element.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eTouchTouch event type
[in]nRelXTouch X coord relative to element
[in]nRelYTouch Y coord relative to element
Returns
true if success, false otherwise

Variable Documentation

const char GSLC_PMEM ERRSTR_NULL[]
const char GSLC_PMEM ERRSTR_PXD_NULL[]