Problem with "timer + tprogress"

Post Reply
digordo
Posts: 13
Joined: Mon Aug 02, 2010 5:15 pm

Problem with "timer + tprogress"

Post by digordo »

I am having problems when I use a timer with a tprogress. What happens is that as soon as I call the SetPos of progress, the timer ignores the interval that was previous defined to it.

An example is when I create a timer with a 15 seconds interval and activate it. At the time I call the SetPos of progress, the timer starts to execute at every moment, ignoring the interval.

Follow an example of the code presenting this problem:


Code: Select all | Expand



#include "fivewin.ch"
Function U_NovoTeste()
Local oTimer := TTimer(10000,{||oTimer:DeActivate(),MsgStop("TIMER1"),oTimer:Activate()},oWndMain)
Local oTimer2 := TTimer(15000,{||oTimer2:DeActivate(),MsgStop("TIMER2"),oTimer2:Activate()},oWndMain)
oTimer:Activate()
oTimer2:Activate()
Return U_Proc()




Function U_Proc()
Local oDlg
Local oProgress

DEFINE DIALOG oDlg FROM 0,0 TO 500,500 TITLE "TESTE" PIXEL

oProgress := TProgress():New(50,00,oDlg,0,CLR_RED ,CLR_WHITE,.t.,.f.,oDlg:nWidth,8,,.f.,.f.)

TButton():New( 10,10, "exec", oDlg, {||U_Progress(oProgress)}, 40, 40,;
               , , , .t., , ,;
               ,,, , ,)
               

ACTIVATE DIALOG oDlg

Return


Function U_Progress(oProgress)
If MsgYesNo("Proc?")
    oProgress:SetPos(1)
EndiF
ThreadSleep(10)
Return




Function U_Teste()
TFichaTreino_IMPSercice():Init("01")
Return
 
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: Problem with "timer + tprogress"

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
emotta_no
Posts: 33
Joined: Thu Jul 04, 2013 9:28 pm

Re: Problem with "timer + tprogress"

Post by emotta_no »

João, o problema não é fazer o progress com timer e sim o BUG que acontece. Este é apenas um exemplo simples que simula o BUG.

precisamos de uma solução para o BUG... mas obrigado pela tentativa...
Post Reply