1 #ifndef _GUISLICE_EX_XSLIDER_H_ 2 #define _GUISLICE_EX_XSLIDER_H_ 50 #define GSLC_TYPEX_SLIDER GSLC_TYPE_BASE_EXTEND + 2 98 uint16_t nThumbSz,
bool bVert);
226 #if (GSLC_USE_PROGMEM) 229 #define gslc_ElemXSliderCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH, \ 230 nPosMin_,nPosMax_,nPos_,nThumbSz_,bVert_,colFrame_,colFill_) \ 231 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 232 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_CLICK_EN | GSLC_ELEM_FEA_FILL_EN; \ 233 static gslc_tsXSlider sSlider##nElemId; \ 234 sSlider##nElemId.bVert = bVert_; \ 235 sSlider##nElemId.bSnapEn = false; \ 236 sSlider##nElemId.nThumbSz = nThumbSz_; \ 237 sSlider##nElemId.nPosMin = nPosMin_; \ 238 sSlider##nElemId.nPosMax = nPosMax_; \ 239 sSlider##nElemId.nTickDiv = 0; \ 240 sSlider##nElemId.nTickLen = 0; \ 241 sSlider##nElemId.colTick = GSLC_COL_WHITE; \ 242 sSlider##nElemId.bTrim = false; \ 243 sSlider##nElemId.colTrim = GSLC_COL_BLACK; \ 244 sSlider##nElemId.nPos = nPos_; \ 245 sSlider##nElemId.pfuncXPos = NULL; \ 246 static const gslc_tsElem sElem##nElemId PROGMEM = { \ 248 nFeatures##nElemId, \ 250 (gslc_tsRect){nX,nY,nW,nH}, \ 251 GSLC_GROUP_ID_NONE, \ 252 colFrame_,colFill_,colFrame_,colFill_, \ 253 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 254 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 258 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 261 GSLC_ALIGN_MID_MID, \ 265 (void*)(&sSlider##nElemId), \ 267 &gslc_ElemXSliderDraw, \ 268 &gslc_ElemXSliderTouch, \ 271 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 272 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_PROG | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 277 #define gslc_ElemXSliderCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH, \ 278 nPosMin_,nPosMax_,nPos_,nThumbSz_,bVert_,colFrame_,colFill_) \ 279 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 280 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_CLICK_EN | GSLC_ELEM_FEA_FILL_EN; \ 281 static gslc_tsXSlider sSlider##nElemId; \ 282 sSlider##nElemId.bVert = bVert_; \ 283 sSlider##nElemId.bSnapEn = false; \ 284 sSlider##nElemId.nThumbSz = nThumbSz_; \ 285 sSlider##nElemId.nPosMin = nPosMin_; \ 286 sSlider##nElemId.nPosMax = nPosMax_; \ 287 sSlider##nElemId.nTickDiv = 0; \ 288 sSlider##nElemId.nTickLen = 0; \ 289 sSlider##nElemId.colTick = GSLC_COL_WHITE; \ 290 sSlider##nElemId.bTrim = false; \ 291 sSlider##nElemId.colTrim = GSLC_COL_BLACK; \ 292 sSlider##nElemId.nPos = nPos_; \ 293 sSlider##nElemId.pfuncXPos = NULL; \ 294 static const gslc_tsElem sElem##nElemId = { \ 296 nFeatures##nElemId, \ 298 (gslc_tsRect){nX,nY,nW,nH}, \ 299 GSLC_GROUP_ID_NONE, \ 300 colFrame_,colFill_,colFrame_,colFill_, \ 301 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 302 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 306 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 309 GSLC_ALIGN_MID_MID, \ 313 (void*)(&sSlider##nElemId), \ 315 &gslc_ElemXSliderDraw, \ 316 &gslc_ElemXSliderTouch, \ 319 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 320 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_CONST | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 328 #endif // __cplusplus 329 #endif // _GUISLICE_EX_XSLIDER_H_ int16_t nPos
Current position value of the slider.
Definition: XSlider.h:74
gslc_tsColor colTick
Style: color of ticks.
Definition: XSlider.h:70
bool bVert
Orientation: true if vertical, else horizontal.
Definition: XSlider.h:62
int16_t nPosMax
Maximum position value of the slider.
Definition: XSlider.h:66
void gslc_ElemXSliderSetPosFunc(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_XSLIDER_POS funcCb)
Assign the position callback function for a slider.
Definition: XSlider.c:219
gslc_teRedrawType
Redraw types.
Definition: GUIslice.h:370
bool gslc_ElemXSliderDraw(void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
Draw a Slider element on the screen.
Definition: XSlider.c:236
void gslc_ElemXSliderSetSnapEn(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bSnapEn)
Enable touch to snap to the nearest tick mark.
Definition: XSlider.c:158
int16_t nTickLen
Style: length of tickmarks.
Definition: XSlider.h:69
int gslc_ElemXSliderGetPos(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
Get a Slider element's current position.
Definition: XSlider.c:172
Rectangular region. Defines X,Y corner coordinates plus dimensions.
Definition: GUIslice.h:519
uint16_t nTickDiv
Style: number of tickmark divisions (0 for none)
Definition: XSlider.h:68
bool bSnapEn
Enable for touch snap behavior.
Definition: XSlider.h:63
bool(* GSLC_CB_XSLIDER_POS)(void *pvGui, void *pvElem, int16_t nPos)
Callback function for slider feedback.
Definition: XSlider.h:53
gslc_tsElemRef * gslc_ElemXSliderCreate(gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXSlider *pXData, gslc_tsRect rElem, int16_t nPosMin, int16_t nPosMax, int16_t nPos, uint16_t nThumbSz, bool bVert)
Create a Slider Element.
Definition: XSlider.c:77
void gslc_ElemXSliderSetStyle(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bTrim, gslc_tsColor colTrim, uint16_t nTickDiv, int16_t nTickLen, gslc_tsColor colTick)
Set a Slider element's current position.
Definition: XSlider.c:136
Extended data for Slider element.
Definition: XSlider.h:60
Element reference structure.
Definition: GUIslice.h:578
bool gslc_ElemXSliderTouch(void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
Handle touch events to Slider element.
Definition: XSlider.c:381
gslc_teTouch
Processed event from input raw events and actions.
Definition: GUIslice.h:305
void gslc_ElemXSliderSetPos(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nPos)
Set a Slider element's current position.
Definition: XSlider.c:186
bool bTrim
Style: show a trim color.
Definition: XSlider.h:71
GSLC_CB_XSLIDER_POS pfuncXPos
Callback func ptr for position update.
Definition: XSlider.h:76
GUI structure.
Definition: GUIslice.h:716
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534
gslc_tsColor colTrim
Style: color of trim.
Definition: XSlider.h:72
int16_t nPosMin
Minimum position value of the slider.
Definition: XSlider.h:65
int16_t nThumbSz
Size of the thumb control.
Definition: XSlider.h:64