1. progress bar

--=======AVGMAIL-3FD4560407D9=======

------=_NextPart_000_000A_01C3BDD4.5C7E3FC0

Im using this syntax to display my progress bar;

setScrollPos( ProgressBar29,  curpos )
setText(LText28, sprintf("%d%% (%d)",
                     {floor(100*curpos/currange[2]),curpos}))

this is in procedure Window1_onActivate (integer self, integer event, sequence
params)

The progress bar displays in text format eg: 56%(56)
How do I get the progress bar to fill instead.

If I move the 
setScrollPos( ProgressBar29,  curpos )
setText(LText28, sprintf("%d%% (%d)",
                     {floor(100*curpos/currange[2]),curpos}))
to after 
WinMain( Window1,Normal )

Then it works but I'd rather have it in
Window1_onActivate (integer self, integer event, sequence params)

tu!




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.548 / Virus Database: 341 - Release Date: 5/12/03
------=_NextPart_000_000A_01C3BDD4.5C7E3FC0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Im using this syntax to display my progress 
bar;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>setScrollPos( ProgressBar29,&nbsp; curpos 
)<BR>setText(LText28, sprintf("%d%% 
(%d)",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>this is in&nbsp;procedure Window1_onActivate 
(integer self, integer event, sequence params)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The progress bar displays in text format eg: 
56%(56)</FONT></DIV>
<DIV><FONT face=Arial size=2>How do I get the progress bar to fill 
instead.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>If I move the 
<DIV><FONT face=Arial size=2>setScrollPos( ProgressBar29,&nbsp; curpos 
)<BR>setText(LText28, sprintf("%d%% 
(%d)",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))</FONT></DIV>
<DIV>to after </DIV>
<DIV>WinMain( Window1,Normal )</DIV>
<DIV>&nbsp;</DIV>
<DIV>Then it works but I'd rather have it in</DIV>
<DIV>Window1_onActivate (integer self, integer event, sequence params)</DIV>
<DIV>&nbsp;</DIV>
<DIV>tu!</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by AVG 
anti-virus system (<A 
href="http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: 6.0.548 /

------=_NextPart_000_000A_01C3BDD4.5C7E3FC0--
--=======AVGMAIL-3FD4560407D9=======
Content-Type: text/plain; x-avg=cert; charset=iso-8859-2
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Description: "AVG certification"

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.548 / Virus Database: 341 - Release Date: 5/12/03

--=======AVGMAIL-3FD4560407D9=======--

new topic     » topic index » view message » categorize

2. Re: progress bar

----- Original Message ----- 
>From: Hayden McKay 
>Subject: progress bar
>
>
>
>Im using this syntax to display my progress bar;
>
>setScrollPos( ProgressBar29,  curpos )
>setText(LText28, sprintf("%d%% (%d)",
>                     {floor(100*curpos/currange[2]),curpos}))
>
>this is in procedure Window1_onActivate (integer self, integer event, sequence
>params)
>
>The progress bar displays in text format eg: 56%(56)
>How do I get the progress bar to fill instead.
>
>If I move the 
>setScrollPos( ProgressBar29,  curpos )
>setText(LText28, sprintf("%d%% (%d)",
>                     {floor(100*curpos/currange[2]),curpos}))
>to after 
>WinMain( Window1,Normal )
>
>Then it works but I'd rather have it in
>Window1_onActivate (integer self, integer event, sequence params)

I dispute that it "works" when placed after the WinMain() call, because by the
time WinMain() returns, all your windows are closed and destroyed.

The Activate event only occurs once, after a window is opened. It is not
normally the right place to put a progress bar update. In the Activate event, you
might call setScrollRange(ProgressBar29, 1, 100) to set the low and hiogh limits
of the progrssbar's scrolling range.

You would call setScrollPos(ProgressBar29,  curpos ) in the routine that updates
'curpos'. You might need a doEvents(0) call if this in a loop within an event
handler.

I can see you have used some code from the demo program 'progressbar.exw", and
if you notice in that demo, the progress bar gets updated every Tick, not just
when the window is activated.

-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

3. Re: progress bar

--=======AVGMAIL-3FD471790AA9=======

------=_NextPart_000_000F_01C3BDE4.CD68DAA0

I fixed it by replacing
setScrollPos( ProgressBar29,  curpos )
> >setText(LText28, sprintf("%d%% (%d)",
> >                     {floor(100*curpos/currange[2]),curpos}))
with
setScrollPos( ProgressBar29,  curpos )
> >setText(ProgressBar29, sprintf("%d%% (%d)",
> >                     {floor(100*curpos/currange[2]),curpos}))

The progressbar is updated 14 times. In the onActivate procedure.
When the proggie opens it reads a heap of files.
The onActivate procedure uses "call_proc(progbar,{})" to read files and updates
the bar.
All seems to be working properly now.

U were right about not working after WinMain( Window1,Normal )
I made a little test proggie to work out the bar. And now I look at it again and
WinMain( Window1,Normal ) was after
setScrollPos( ProgressBar29,  curpos )
> >setText(LText28, sprintf("%d%% (%d)",
> >                     {floor(100*curpos/currange[2]),curpos}))
some reason I thought this was after WinMain( Window1,Normal )








----- Original Message ----- setScrollPos( ProgressBar29,  curpos )
> >setText(LText28, sprintf("%d%% (%d)",
> >                     {floor(100*curpos/currange[2]),curpos}))

From: "Derek Parnell" <ddparnell at bigpond.com>
To: <EUforum at topica.com>
Sent: Monday, December 08, 2003 10:29 PM
Subject: Re: progress bar


> ============ The Euphoria Mailing List ============ 
> 
> 
> ----- Original Message ----- 
> >From: Hayden McKay 
> >To: EUforum at topica.com 
> >Sent: Monday, December 08, 2003 9:43 PM
> >Subject: progress bar
> >
> >
> >Im using this syntax to display my progress bar;
> >
> >> >
> >this is in procedure Window1_onActivate (integer self, integer event,
> >sequence params)
> >
> >The progress bar displays in text format eg: 56%(56)
> >How do I get the progress bar to fill instead.
> >
> >If I move the 
> >setScrollPos( ProgressBar29,  curpos )
> >setText(LText28, sprintf("%d%% (%d)",
> >                     {floor(100*curpos/currange[2]),curpos}))
> >to after 
> >WinMain( Window1,Normal )
> >
> >Then it works but I'd rather have it in
> >Window1_onActivate (integer self, integer event, sequence params)
> 
> I dispute that it "works" when placed after the WinMain() call, because by the
> time WinMain() returns, all your windows are closed and destroyed.
> 
> The Activate event only occurs once, after a window is opened. It is not
> normally the right place to put a progress bar update. In the Activate event, you
> might call setScrollRange(ProgressBar29, 1, 100) to set the low and hiogh limits
> of the progrssbar's scrolling range.
> 
> You would call setScrollPos(ProgressBar29,  curpos ) in the routine that
> updates 'curpos'. You might need a doEvents(0) call if this in a loop within an
> event handler.
> 
> I can see you have used some code from the demo program 'progressbar.exw", and
> if you notice in that demo, the progress bar gets updated every Tick, not just
> when the window is activated.
> 
> -- 
> Derek
> 
> --^----------------------------------------------------------------
> This email was sent to: hmck1 at dodo.com.au
> 
> EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b60Ray.aG1jazFA
> Or send an email to: EUforum-unsubscribe at topica.com
> 
> TOPICA - Start your own email discussion group. FREE!
> http://www.topica.com/partner/tag02/create/index2.html
> --^----------------------------------------------------------------
> 
> 
> -- 
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.548 / Virus Database: 341 - Release Date: 5/12/03
> 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.548 / Virus Database: 341 - Release Date: 5/12/03
------=_NextPart_000_000F_01C3BDE4.CD68DAA0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>I fixed it by replacing</FONT></DIV>
<DIV><FONT face=Arial size=2>setScrollPos( ProgressBar29,&nbsp; curpos )<BR>&gt;
&gt;setText(<FONT color=#ff0000><STRONG>LText28</STRONG></FONT>, sprintf("%d%% 
(%d)",<BR>&gt; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))</FONT></DIV>
<DIV><FONT face=Arial size=2>with</FONT></DIV>
<DIV><FONT face=Arial size=2>setScrollPos( ProgressBar29,&nbsp; curpos )<BR>&gt;
&gt;setText(<STRONG><FONT color=#ff0000>ProgressBar29</FONT></STRONG>, 
sprintf("%d%% (%d)",<BR>&gt; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The progressbar is updated&nbsp;14 times.&nbsp;In 
the onActivate procedure.</FONT></DIV>
<DIV><FONT face=Arial size=2>When the&nbsp;proggie opens it reads a heap of 
files.</FONT></DIV>
<DIV><FONT face=Arial size=2>The onActivate procedure uses 
"call_proc(progbar,{})" to read files and updates the bar.</FONT></DIV>
<DIV><FONT face=Arial size=2>All seems to be working properly now.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>U were right about not working after WinMain( 
Window1,Normal )</FONT></DIV>
<DIV><FONT face=Arial size=2>I made a little test proggie to work out the bar. 
And now I look at it again and</FONT></DIV>
<DIV><FONT face=Arial size=2>WinMain( Window1,Normal ) was after</FONT></DIV>
<DIV><FONT face=Arial size=2>setScrollPos( ProgressBar29,&nbsp; curpos )<BR>&gt;
&gt;setText(<FONT color=#ff0000><STRONG>LText28</STRONG></FONT>, sprintf("%d%% 
(%d)",<BR>&gt; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))</FONT></DIV>
<DIV><FONT face=Arial size=2>some reason I thought this was after WinMain( 
Window1,Normal )</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV>
<DIV><BR><BR></DIV></FONT>
<DIV><FONT face=Arial size=2>----- Original Message ----- setScrollPos( 
ProgressBar29,&nbsp; curpos )<BR>&gt; &gt;setText(LText28, sprintf("%d%% 
(%d)",<BR>&gt; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))<BR></FONT>
<DIV><FONT face=Arial size=2>From: "Derek Parnell" &lt;</FONT><A 
href="mailto:ddparnell at bigpond.com"><FONT face=Arial 
size=2>ddparnell at bigpond.com</FONT></A><FONT face=Arial
size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>To: &lt;</FONT><A 
href="mailto:EUforum at topica.com"><FONT face=Arial 
size=2>EUforum at topica.com</FONT></A><FONT face=Arial size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Monday, December 08, 2003 10:29 
PM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: Re: progress bar</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>&gt; ============ The Euphoria Mailing List 
============ <BR>&gt; <BR>&gt; <BR>&gt; ----- Original Message ----- <BR>&gt; 
&gt;From: Hayden McKay <BR>&gt; &gt;To: </FONT><A 
href="mailto:EUforum at topica.com"><FONT face=Arial 
size=2>EUforum at topica.com</FONT></A><FONT face=Arial size=2> <BR>&gt;
&gt;Sent:
Monday, December 08, 2003 9:43 PM<BR>&gt; &gt;Subject: progress bar<BR>&gt; 
&gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;Im using this syntax to display my 
progress bar;<BR>&gt; &gt;<BR>&gt; &gt;&gt; &gt;<BR>&gt; &gt;this is in 
procedure Window1_onActivate (integer self, integer event, sequence 
params)<BR>&gt; &gt;<BR>&gt; &gt;The progress bar displays in text format eg: 
56%(56)<BR>&gt; &gt;How do I get the progress bar to fill instead.<BR>&gt; 
&gt;<BR>&gt; &gt;If I move the <BR>&gt; &gt;setScrollPos( ProgressBar29,&nbsp; 
curpos )<BR>&gt; &gt;setText(LText28, sprintf("%d%% (%d)",<BR>&gt; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{floor(100*curpos/currange[2]),curpos}))<BR>&gt; &gt;to after <BR>&gt; 
&gt;WinMain( Window1,Normal )<BR>&gt; &gt;<BR>&gt; &gt;Then it works but I'd 
rather have it in<BR>&gt; &gt;Window1_onActivate (integer self, integer event, 
sequence params)<BR>&gt; <BR>&gt; I dispute that it "works" when placed after 
the WinMain() call, because by the time WinMain() returns, all your windows are 
closed and destroyed. <BR>&gt; <BR>&gt; The Activate event only occurs once, 
after a window is opened. It is not normally the right place to put a progress 
bar update. In the Activate event, you might call setScrollRange(ProgressBar29, 
1, 100) to set the low and hiogh limits of the progrssbar's scrolling range. 
<BR>&gt; <BR>&gt; You would call setScrollPos(ProgressBar29,&nbsp; curpos ) in 
the routine that updates 'curpos'. You might need a doEvents(0) call if this in 
a loop within an event handler.<BR>&gt; <BR>&gt; I can see you have used some 
code from the demo program 'progressbar.exw", and if you notice in that demo, 
the progress bar gets updated every Tick, not just when the window is 
activated.<BR>&gt; <BR>&gt; -- <BR>&gt; Derek<BR>&gt; <BR>&gt; 
--^----------------------------------------------------------------<BR>&gt; This
email was sent to: </FONT><A href="mailto:hmck1 at dodo.com.au"><FONT face=Arial
size=2>hmck1 at dodo.com.au</FONT></A><BR><FONT face=Arial size=2>&gt; <BR>&gt; 
EASY UNSUBSCRIBE click here: </FONT><A 
href="http://topica.com/u/?b1dd66.b60Ray.aG1jazFA"><FONT face=Arial 
size=2>http://topica.com/u/?b1dd66.b60Ray.aG1jazFA</FONT></A><BR><FONT 
face=Arial size=2>&gt; Or send an email to: </FONT><A 
href="mailto:EUforum-unsubscribe at topica.com"><FONT face=Arial 
size=2>EUforum-unsubscribe at topica.com</FONT></A><BR><FONT face=Arial
size=2>&gt;
<BR>&gt; TOPICA - Start your own email discussion group. FREE!<BR>&gt; </FONT><A
href="http://www.topica.com/partner/tag02/create/index2.html"><FONT face=Arial 
size=2>http://www.topica.com/partner/tag02/create/index2.html</FONT></A><BR><FONT
face=Arial size=2>&gt; 
--^----------------------------------------------------------------<BR>&gt; 
<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; -- <BR>&gt; 
Incoming mail is certified Virus Free.<BR>&gt; Checked by AVG anti-virus system 
(</FONT><A href="http://www.grisoft.com"><FONT face=Arial 
size=2>http://www.grisoft.com</FONT></A><FONT face=Arial size=2>).<BR>&gt; 
Version: 6.0.548 / Virus Database: 341 - Release Date: 5/12/03<BR>&gt; 
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><BR>---<BR>Outgoing mail is certified Virus 
Free.<BR>Checked by AVG anti-virus system (<A 
href="http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: 6.0.548 /

------=_NextPart_000_000F_01C3BDE4.CD68DAA0--
--=======AVGMAIL-3FD471790AA9=======
Content-Type: text/plain; x-avg=cert; charset=iso-8859-2
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Description: "AVG certification"

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.548 / Virus Database: 341 - Release Date: 5/12/03

--=======AVGMAIL-3FD471790AA9=======--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu