IonicWind Software

IWBasic => General Questions => Topic started by: Brian on June 15, 2011, 10:01:05 AM

Title: Progress Control with counter
Post by: Brian on June 15, 2011, 10:01:05 AM
Hi,

I'm using the Progress Control, with no problems. I've just loaded a program on my
PC, and the progress control with the installer showed a percentage number, and
counted up until it got to 100%

I notice there are no commands to do that with the Control Pak. Any ideas on
how to go about it? Purely aesthetical, of course!

Brian
Title: Re: Progress Control with counter
Post by: LarryMc on June 15, 2011, 12:37:03 PM
The attached zip contains 3 source file written by Bevets (RIP) who wrote the original Control Pak.

This should be all you need to do whatever you want to do.

Also a couple of screen shots.

LarryMc
Title: Re: Progress Control with counter
Post by: Brian on June 15, 2011, 04:06:43 PM
Thanks, Larry,

Never seen those before

Brian
Title: Re: Progress Control with counter
Post by: Brian on June 16, 2011, 01:58:59 AM
Hmmm,

I don't have any error messages, but I don't seem to be able to get
SetProgressBarColor to do anything

I was setting it to a reddish colour while working, then to green when
it was finished, but get nothing

Brian
Title: Re: Progress Control with counter
Post by: LarryMc on June 16, 2011, 10:04:21 AM
Are you using the Control Pak to create your progressbar or are you using some of the code I posted above?

LarryMc
Title: Re: Progress Control with counter
Post by: LarryMc on June 16, 2011, 10:44:12 AM
Since I don't know what code you are using I can only guess.
This code uses the ControlPak commands.
It starts with a red bar and when it is finished it turns green and stops.

WINDOW win
openwindow win,0,0,230,100,@SIZE|@MINBOX|@MAXBOX,0,"ProgressBar Demo",&mainwindow
ProgressControl(win,10,30,200,20,@BORDER,@EXCLIENTEDGE,50)
SetProgressRange win,50,0,500
SetProgressStep win,50,50
SetProgressBarColor win, 50, RGB(255,0,0)
starttimer win,1000
waituntil iswindowclosed(win)
end

SUB mainwindow
select @CLASS
case @IDCLOSEWINDOW
stoptimer win
closewindow win
case @IDTIMER
if GetProgressPosition(win, 50) >= 500
SetProgressBarColor win, 50, RGB(0,255,0)
stoptimer win
else
ProgressStepIt(win, 50)
SetProgressBarColor win, 50, RGB(255,0,0)
endif
CASE @IDCREATE
CENTERWINDOW win
endselect
return
endsub


Hope this will get you over the hump.

LarryMc
Title: Re: Progress Control with counter
Post by: Brian on June 16, 2011, 11:58:09 AM
Larry,

Yes, I was using the Control Pak

Well, your version works as it should, and I have followed your example,
but can't get mine to work. The only difference is you are using a timer

I've tried the call in different places, with no effect. Still, as I said, it was
really only for aesthetic reasons I was including it

But the your code is stored away . . .

Many thanks,

Brian
Title: Re: Progress Control with counter
Post by: LarryMc on June 16, 2011, 12:05:19 PM
Email me your code and I'll see if I can fix it (if you care to)

LarryMc