aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/progressbar.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-04-23 23:58:38 +0200
committerJoel Bodenmann <joel@unormal.org>2014-04-23 23:58:38 +0200
commit43a143588c8c62ab1474b896d5afd6c2bf11a8f3 (patch)
treed59054811f896ba6c9e9d34bd08c16bfa685ea21 /src/gwin/progressbar.c
parentc88e25b84fa8d18942df56592cec68f8371a8d41 (diff)
parenta34c0ded1873121431eed41210b7f44c8271ac0a (diff)
downloaduGFX-43a143588c8c62ab1474b896d5afd6c2bf11a8f3.tar.gz
uGFX-43a143588c8c62ab1474b896d5afd6c2bf11a8f3.tar.bz2
uGFX-43a143588c8c62ab1474b896d5afd6c2bf11a8f3.zip
Merge branch 'master' into gwin
Diffstat (limited to 'src/gwin/progressbar.c')
-rw-r--r--src/gwin/progressbar.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gwin/progressbar.c b/src/gwin/progressbar.c
index 37bad3c8..a7acc0ed 100644
--- a/src/gwin/progressbar.c
+++ b/src/gwin/progressbar.c
@@ -29,12 +29,21 @@ static void ResetDisplayPos(GProgressbarObject *gsw) {
gsw->dpos = ((gsw->w.g.width-1)*(gsw->pos-gsw->min))/(gsw->max-gsw->min);
}
+// We have to deinitialize the timer which auto updates the progressbar if any
+static void _destroy(GHandle gh) {
+ #if GFX_USE_GTIMER
+ gtimerDeinit( &((GProgressbarObject *)gh)->gt );
+ #endif
+
+ _gwidgetDestroy(gh);
+}
+
// The progressbar VMT table
static const gwidgetVMT progressbarVMT = {
{
"Progressbar", // The classname
sizeof(GProgressbarObject), // The object size
- _gwidgetDestroy, // The destroy routine
+ _destroy, // The destroy routine
_gwidgetRedraw, // The redraw routine
0, // The after-clear routine
},
@@ -200,6 +209,17 @@ void gwinProgressbarStart(GHandle gh, delaytime_t delay) {
#undef gsw
}
+void gwinProgressbarStop(GHandle gh) {
+ #define gsw ((GProgressbarObject *)gh)
+
+ if (gh->vmt != (gwinVMT *)&progressbarVMT)
+ return;
+
+ gtimerStop(&(gsw->gt));
+
+ #undef gsw
+}
+
/*----------------------------------------------------------
* Custom Draw Routines
*----------------------------------------------------------*/