ugfx/demos/modules/gwin/progressbar/main.c

46 lines
878 B
C
Raw Normal View History

#include "gfx.h"
GHandle ghProgressbar;
static void _createWidget(void) {
GWidgetInit wi;
gwinWidgetClearInit(&wi);
wi.g.show = TRUE;
wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "Progress 1";
ghProgressbar = gwinProgressbarCreate(NULL, &wi);
}
int main(void) {
gfxInit();
gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White);
_createWidget();
2014-04-23 21:56:22 +00:00
#if 1
gwinProgressbarSetResolution(ghProgressbar, 10);
gwinProgressbarStart(ghProgressbar, 500);
2014-04-23 21:43:54 +00:00
gfxSleepMilliseconds(3000);
gwinProgressbarReset(ghProgressbar);
2014-04-23 21:56:22 +00:00
gfxSleepMilliseconds(3000);
gwinDestroy(ghProgressbar);
#else
gwinProgressbarSetPosition(ghProgressbar, 42);
gwinProgressbarIncrement(ghProgressbar);
gwinProgressbarDecrement(ghProgressbar);
#endif
while (1) {
gfxSleepMilliseconds(500);
}
return 0;
}