Problem with "timer + tprogress"

Problem with "timer + tprogress"

Postby digordo » Thu Oct 23, 2014 4:05 pm

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 view


#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
 
digordo
 
Posts: 13
Joined: Mon Aug 02, 2010 5:15 pm

Re: Problem with "timer + tprogress"

Postby karinha » Fri Oct 24, 2014 11:35 am

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7352
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Problem with "timer + tprogress"

Postby emotta_no » Fri Oct 24, 2014 1:52 pm

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...
emotta_no
 
Posts: 33
Joined: Thu Jul 04, 2013 9:28 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 38 guests