Progress bar

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Progress bar

Post 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
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

Use a timer
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

I must show Meter line because I must make a test for my boys at school

Regards
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

can YOu write a small sample to see How I can make it ?

Regards
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

Code: Select all

#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   
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post 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
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

1. milliseconds

2. Use a TMeter instead of a progress bar.

3. Simply set the meter to 100%.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply