aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gwin/progressbar/main.c
blob: 374728cf5dc506f63b51af727fb1db64306fa908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#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(0, &wi);
}

int main(void) {
	gfxInit();

	gwinSetDefaultFont(gdispOpenFont("UI2"));
	gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
	gdispClear(GFX_WHITE);

	_createWidget();

#if 1
	gwinProgressbarSetResolution(ghProgressbar, 10);
	gwinProgressbarStart(ghProgressbar, 500);

	gfxSleepMilliseconds(3000);
	gwinProgressbarReset(ghProgressbar);

	gfxSleepMilliseconds(3000);
	gwinDestroy(ghProgressbar);
#else
	gwinProgressbarSetPosition(ghProgressbar, 42);
	gwinProgressbarIncrement(ghProgressbar);
	gwinProgressbarDecrement(ghProgressbar);
#endif

	while (1) {
		gfxSleepMilliseconds(500);
	}

	return 0;
}