1 #ifndef _GUISLICE_EX_XPROGRESS_H_ 2 #define _GUISLICE_EX_XPROGRESS_H_ 53 #define GSLC_TYPEX_PROGRESS GSLC_TYPE_BASE_EXTEND + 60 205 #if (GSLC_USE_PROGMEM) 208 #define gslc_ElemXProgressCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 209 nMin_,nMax_,nVal_,colFrame_,colFill_,colGauge_,bVert_) \ 210 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 211 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 212 static gslc_tsXProgress sGauge##nElemId; \ 213 sGauge##nElemId.nMin = nMin_; \ 214 sGauge##nElemId.nMax = nMax_; \ 215 sGauge##nElemId.nVal = nVal_; \ 216 sGauge##nElemId.nValLast = nVal_; \ 217 sGauge##nElemId.bValLastValid = false; \ 218 sGauge##nElemId.colGauge = colGauge_; \ 219 sGauge##nElemId.bVert = bVert_; \ 220 sGauge##nElemId.bFlip = false; \ 221 static const gslc_tsElem sElem##nElemId PROGMEM = { \ 223 nFeatures##nElemId, \ 224 GSLC_TYPEX_PROGRESS, \ 225 (gslc_tsRect){nX,nY,nW,nH}, \ 226 GSLC_GROUP_ID_NONE, \ 227 colFrame_,colFill_,colFrame_,colFill_, \ 228 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 229 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 233 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 236 GSLC_ALIGN_MID_MID, \ 240 (void*)(&sGauge##nElemId), \ 242 &gslc_ElemXProgressDraw, \ 246 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 247 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_PROG | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 252 #define gslc_ElemXProgressCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 253 nMin_,nMax_,nVal_,colFrame_,colFill_,colGauge_,bVert_) \ 254 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 255 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 256 static gslc_tsXProgress sGauge##nElemId; \ 257 sGauge##nElemId.nMin = nMin_; \ 258 sGauge##nElemId.nMax = nMax_; \ 259 sGauge##nElemId.nVal = nVal_; \ 260 sGauge##nElemId.nValLast = nVal_; \ 261 sGauge##nElemId.bValLastValid = false; \ 262 sGauge##nElemId.colGauge = colGauge_; \ 263 sGauge##nElemId.bVert = bVert_; \ 264 sGauge##nElemId.bFlip = false; \ 265 static const gslc_tsElem sElem##nElemId = { \ 267 nFeatures##nElemId, \ 268 GSLC_TYPEX_PROGRESS, \ 269 (gslc_tsRect){nX,nY,nW,nH}, \ 270 GSLC_GROUP_ID_NONE, \ 271 colFrame_,colFill_,colFrame_,colFill_, \ 272 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 273 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 277 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 280 GSLC_ALIGN_MID_MID, \ 284 (void*)(&sGauge##nElemId), \ 286 &gslc_ElemXProgressDraw, \ 290 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 291 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_CONST | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 297 #endif // __cplusplus 298 #endif // _GUISLICE_EX_XPROGRESS_H_ gslc_tsElemRef * gslc_ElemXProgressCreate(gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXProgress *pXData, gslc_tsRect rElem, int16_t nMin, int16_t nMax, int16_t nVal, gslc_tsColor colGauge, bool bVert)
Create a Progress Bar Element.
Definition: XProgress.c:79
gslc_teRedrawType
Redraw types.
Definition: GUIslice.h:370
gslc_tsColor colGauge
Color of gauge fill bar.
Definition: XProgress.h:74
bool bVert
Vertical if true, else Horizontal.
Definition: XProgress.h:75
void gslc_ElemXProgressSetVal(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
Update a Gauge element's current value.
Definition: XProgress.c:125
bool gslc_ElemXProgressDrawHelp(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw)
Helper function to draw a gauge with style: progress bar.
Definition: XProgress.c:225
int16_t nVal
Current control value.
Definition: XProgress.h:68
int16_t nValLast
Last value.
Definition: XProgress.h:70
int16_t nMin
Minimum control value.
Definition: XProgress.h:64
Rectangular region. Defines X,Y corner coordinates plus dimensions.
Definition: GUIslice.h:519
void gslc_ElemXProgressSetGaugeCol(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colGauge)
Set the gauge color.
Definition: XProgress.c:173
bool gslc_ElemXProgressDraw(void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
Draw a gauge element on the screen.
Definition: XProgress.c:197
Element reference structure.
Definition: GUIslice.h:578
Extended data for Gauge element.
Definition: XProgress.h:62
bool bValLastValid
Last value valid?
Definition: XProgress.h:71
int16_t nMax
Maximum control value.
Definition: XProgress.h:65
void gslc_ElemXProgressSetFlip(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bFlip)
Set a Gauge element's fill direction.
Definition: XProgress.c:154
GUI structure.
Definition: GUIslice.h:716
bool bFlip
Reverse direction of gauge.
Definition: XProgress.h:76
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534