1 #ifndef _GUISLICE_EX_XSEEKBAR_H_ 2 #define _GUISLICE_EX_XSEEKBAR_H_ 52 #define GSLC_TYPEX_SEEKBAR GSLC_TYPE_BASE_EXTEND + 6 111 uint8_t nProgressW,uint8_t nRemainW,uint8_t nThumbSz,
233 #if (GSLC_USE_PROGMEM) 236 #define gslc_ElemXSeekbarCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,nPosMin_,nPosMax_, \ 237 nPos_,nProgressW_,nRemainW_,nThumbSz_,colProgress_,colRemain_,colThumb_,bVert_, \ 238 colFrame_,colFill_) \ 239 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 240 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_CLICK_EN | GSLC_ELEM_FEA_FILL_EN; \ 241 static gslc_tsXSeekbar sSeekbar##nElemId; \ 242 sSeekbar##nElemId.bVert = bVert_; \ 243 sSeekbar##nElemId.nProgressW = nProgressW_; \ 244 sSeekbar##nElemId.nRemainW = nRemainW_; \ 245 sSeekbar##nElemId.nThumbSz = nThumbSz_; \ 246 sSeekbar##nElemId.nPosMin = nPosMin_; \ 247 sSeekbar##nElemId.nPosMax = nPosMax_; \ 248 sSeekbar##nElemId.colProgress = colProgress_; \ 249 sSeekbar##nElemId.colRemain = colRemain_; \ 250 sSeekbar##nElemId.colThumb = colThumb_; \ 251 sSeekbar##nElemId.nPos = nPos_; \ 252 sSeekbar##nElemId.pfuncXPos = NULL; \ 253 static const gslc_tsElem sElem##nElemId PROGMEM = { \ 255 nFeatures##nElemId, \ 256 GSLC_TYPEX_SEEKBAR, \ 257 (gslc_tsRect){nX,nY,nW,nH}, \ 258 GSLC_GROUP_ID_NONE, \ 259 colFrame_,colFill_,colFrame_,colFill_, \ 260 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 261 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 265 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 268 GSLC_ALIGN_MID_MID, \ 272 (void*)(&sSeekbar##nElemId), \ 274 &gslc_ElemXSeekbarDraw, \ 275 &gslc_ElemXSeekbarTouch, \ 278 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 279 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_PROG | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 284 #define gslc_ElemXSeekbarCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,nPosMin_,nPosMax_, \ 285 nPos_,nProgressW_,nRemainW_,nThumbSz_,colProgress_,colRemain_,colThumb_,bVert_, \ 286 colFrame_,colFill_) \ 287 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 288 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_CLICK_EN | GSLC_ELEM_FEA_FILL_EN; \ 289 static gslc_tsXSeekbar sSeekbar##nElemId; \ 290 sSeekbar##nElemId.bVert = bVert_; \ 291 sSeekbar##nElemId.nProgressW = nProgressW_; \ 292 sSeekbar##nElemId.nRemainW = nRemainW_; \ 293 sSeekbar##nElemId.nThumbSz = nThumbSz_; \ 294 sSeekbar##nElemId.nPosMin = nPosMin_; \ 295 sSeekbar##nElemId.nPosMax = nPosMax_; \ 296 sSeekbar##nElemId.colProgress = colProgress_; \ 297 sSeekbar##nElemId.colRemain = colRemain_; \ 298 sSeekbar##nElemId.colThumb = colThumb_; \ 299 sSeekbar##nElemId.nPos = nPos_; \ 300 sSeekbar##nElemId.pfuncXPos = NULL; \ 301 static const gslc_tsElem sElem##nElemId = { \ 303 nFeatures##nElemId, \ 304 GSLC_TYPEX_SEEKBAR, \ 305 (gslc_tsRect){nX,nY,nW,nH}, \ 306 GSLC_GROUP_ID_NONE, \ 307 colFrame_,colFill_,colFrame_,colFill_, \ 308 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 309 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 313 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 316 GSLC_ALIGN_MID_MID, \ 320 (void*)(&sSeekbar##nElemId), \ 322 &gslc_ElemXSeekbarDraw, \ 323 &gslc_ElemXSeekbarTouch, \ 326 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 327 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_CONST | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 335 #endif // __cplusplus 336 #endif // _GUISLICE_EX_XSEEKBAR_H_ gslc_tsColor colTrim
Style: color of trim.
Definition: XSeekbar.h:78
int16_t nTickLen
Style: length of tickmarks.
Definition: XSeekbar.h:75
bool bFrameThumb
Style: draw frame around thumb.
Definition: XSeekbar.h:79
uint8_t nThumbSz
Size of the thumb control.
Definition: XSeekbar.h:67
int gslc_ElemXSeekbarGetPos(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
Get a Seekbar element's current position.
Definition: XSeekbar.c:171
gslc_teRedrawType
Redraw types.
Definition: GUIslice.h:370
gslc_tsColor colRemain
Style: color remaining fill bar.
Definition: XSeekbar.h:72
int16_t nPosMin
Minimum position value of the slider.
Definition: XSeekbar.h:68
int16_t nPosMax
Maximum position value of the slider.
Definition: XSeekbar.h:69
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. ...
Definition: XSeekbar.c:147
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.
Definition: XSeekbar.c:79
gslc_tsColor colProgress
Style: color of progress fill bar.
Definition: XSeekbar.h:71
gslc_tsColor colThumb
Style: color of thumb.
Definition: XSeekbar.h:73
bool(* GSLC_CB_XSEEKBAR_POS)(void *pvGui, void *pvElem, int16_t nPos)
Callback function for slider feedback.
Definition: XSeekbar.h:55
bool gslc_ElemXSeekbarDraw(void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
Draw a Seekbar element on the screen.
Definition: XSeekbar.c:235
void gslc_ElemXSeekbarSetPosFunc(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_XSEEKBAR_POS funcCb)
Assign the position callback function for a slider.
Definition: XSeekbar.c:218
Rectangular region. Defines X,Y corner coordinates plus dimensions.
Definition: GUIslice.h:519
void gslc_ElemXSeekbarSetPos(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nPos)
Set a Seekbar element's current position.
Definition: XSeekbar.c:185
bool bTrimThumb
Style: show a trim color for thumb.
Definition: XSeekbar.h:77
uint8_t nRemainW
Width of remaining track.
Definition: XSeekbar.h:66
Element reference structure.
Definition: GUIslice.h:578
Extended data for Seekbar element.
Definition: XSeekbar.h:62
gslc_tsColor colFrame
Style: color of trim.
Definition: XSeekbar.h:80
gslc_tsColor colTick
Style: color of ticks.
Definition: XSeekbar.h:76
int16_t nPos
Current position value of the slider.
Definition: XSeekbar.h:82
uint16_t nTickDiv
Style: number of tickmark divisions (0 for none)
Definition: XSeekbar.h:74
gslc_teTouch
Processed event from input raw events and actions.
Definition: GUIslice.h:305
bool gslc_ElemXSeekbarTouch(void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
Handle touch events to Seekbar element.
Definition: XSeekbar.c:418
GUI structure.
Definition: GUIslice.h:716
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534
uint8_t nProgressW
Width of progress track.
Definition: XSeekbar.h:65
bool bVert
Orientation: true if vertical, else horizontal.
Definition: XSeekbar.h:64
GSLC_CB_XSEEKBAR_POS pfuncXPos
Callback func ptr for position update.
Definition: XSeekbar.h:84