Page 1 of 1

Progress bar

PostPosted: Fri Apr 14, 2006 10:43 pm
by Silvio
How I can show one bar in order to show a passed time? and to play each second a sound ?

Example : 2 minutes

PostPosted: Fri Apr 14, 2006 11:53 pm
by Antonio Linares
Silvio,

Use a timer

PostPosted: Sat Apr 15, 2006 12:51 pm
by Silvio
I must show Meter line because I must make a test for my boys at school

Regards

PostPosted: Sat Apr 15, 2006 4:05 pm
by Antonio Linares
Silvio,

I meant: use a timer to update the meter value.

PostPosted: Sat Apr 15, 2006 4:28 pm
by Silvio
can YOu write a small sample to see How I can make it ?

Regards

PostPosted: Sat Apr 15, 2006 4:59 pm
by Antonio Linares
Silvio,
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg, oProg
   
   DEFINE DIALOG oDlg TITLE "Progress and timer"

   @ 1, 3 PROGRESS oProg POSITION 0 SIZE 120, 10
   
   @ 2.5, 10 BUTTON "End" ACTION oDlg:End()
   
   ACTIVATE DIALOG oDlg CENTER ;
      ON INIT Timer( oDlg, oProg )
   
return nil   

function Timer( oDlg, oProg )
   
   local oTmr
   
   DEFINE TIMER oTmr INTERVAL 1000 ;
      ACTION ( oProg:nPosition += 5, MsgBeep(),;
             If( oProg:nPosition == 100, oTmr:End(),) ) OF oDlg

   ACTIVATE TIMER oTmr

return nil   

PostPosted: Sat Apr 15, 2006 10:40 pm
by Silvio
thanks

PostPosted: Sun Apr 16, 2006 9:06 pm
by Silvio
Dear Antonio,

first problem
How I can to set the timer ?
on your example U use interval 1000
it is egual to one minute ?

second problem
How I can to show on progress bar the time remaining ( with number) ?


third problem
I made a game at school
when a boy does not answer well to a question in the test the procedure must remove the remaining time.
It is possible ?
How I can make to call a func to remove time to progress bar ?


Best Regards

PostPosted: Sun Apr 16, 2006 11:11 pm
by Antonio Linares
Silvio,

1. milliseconds

2. Use a TMeter instead of a progress bar.

3. Simply set the meter to 100%.