Fixed enable bug in progress bar
This commit is contained in:
parent
b37370bdb5
commit
763fd061ec
1 changed files with 9 additions and 14 deletions
|
@ -43,7 +43,7 @@ static const gwidgetVMT progressbarVMT = {
|
|||
{
|
||||
"Progressbar", // The classname
|
||||
sizeof(GProgressbarObject), // The object size
|
||||
_destroy, // The destroy routine
|
||||
_destroy, // The destroy routine
|
||||
_gwidgetRedraw, // The redraw routine
|
||||
0, // The after-clear routine
|
||||
},
|
||||
|
@ -180,7 +180,7 @@ void gwinProgressbarDecrement(GHandle gh) {
|
|||
}
|
||||
|
||||
// used by gwinProgressbarStart();
|
||||
void _progressbarCallback(void *param) {
|
||||
static void _progressbarCallback(void *param) {
|
||||
#define gsw ((GProgressbarObject *)gh)
|
||||
GHandle gh = (GHandle)param;
|
||||
|
||||
|
@ -206,11 +206,13 @@ void gwinProgressbarStart(GHandle gh, delaytime_t delay) {
|
|||
gtimerInit(&(gsw->gt));
|
||||
gtimerStart(&(gsw->gt), _progressbarCallback, gh, FALSE, gsw->delay);
|
||||
|
||||
// if this is not made, the progressbar will not start when the it's already visible
|
||||
if (gsw->w.g.flags & GWIN_FLG_VISIBLE) {
|
||||
gwinSetVisible(gh, FALSE);
|
||||
gwinSetVisible(gh, TRUE);
|
||||
}
|
||||
#if 0
|
||||
// if this is not made, the progressbar will not start when it's already visible
|
||||
if (gsw->w.g.flags & GWIN_FLG_VISIBLE) {
|
||||
gwinSetVisible(gh, FALSE);
|
||||
gwinSetVisible(gh, TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef gsw
|
||||
}
|
||||
|
@ -239,13 +241,6 @@ void gwinProgressbarDraw_Std(GWidgetObject *gw, void *param) {
|
|||
if (gw->g.vmt != (gwinVMT *)&progressbarVMT)
|
||||
return;
|
||||
|
||||
// disable the auto-update timer if any
|
||||
#if GFX_USE_GTIMER
|
||||
if (gtimerIsActive(&(gsw->gt)) && !(gw->g.flags & GWIN_FLG_ENABLED)) {
|
||||
gtimerStop(&(gsw->gt));
|
||||
}
|
||||
#endif
|
||||
|
||||
// get the colors right
|
||||
if ((gw->g.flags & GWIN_FLG_ENABLED))
|
||||
pcol = &gw->pstyle->pressed;
|
||||
|
|
Loading…
Add table
Reference in a new issue