2013-12-01 22:53:42 +00:00
|
|
|
#include "gfx.h"
|
|
|
|
|
|
|
|
GHandle ghProgressbar;
|
|
|
|
|
|
|
|
static void _createWidget(void) {
|
|
|
|
GWidgetInit wi;
|
|
|
|
|
2014-05-09 11:25:31 +00:00
|
|
|
gwinWidgetClearInit(&wi);
|
2018-06-23 03:02:07 +00:00
|
|
|
wi.g.show = gTrue;
|
2013-12-01 22:53:42 +00:00
|
|
|
|
|
|
|
wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "Progress 1";
|
2014-05-11 03:10:50 +00:00
|
|
|
ghProgressbar = gwinProgressbarCreate(0, &wi);
|
2013-12-01 22:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
gfxInit();
|
|
|
|
|
|
|
|
gwinSetDefaultFont(gdispOpenFont("UI2"));
|
2018-06-23 03:02:07 +00:00
|
|
|
gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse);
|
2018-03-10 10:36:12 +00:00
|
|
|
gdispClear(GFX_WHITE);
|
2013-12-01 22:53:42 +00:00
|
|
|
|
|
|
|
_createWidget();
|
|
|
|
|
2014-04-23 21:56:22 +00:00
|
|
|
#if 1
|
2013-12-01 22:53:42 +00:00
|
|
|
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
|
2013-12-01 22:53:42 +00:00
|
|
|
|
|
|
|
while (1) {
|
|
|
|
gfxSleepMilliseconds(500);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|