FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with timer
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Problem with timer
Posted: Sun Oct 05, 2008 08:18 AM
Hello,

At the start of my application, there is asked for a username and a password. There is also a timer which ends this dialog box after 10 seconds.

This code is used :
DEFINE DIALOG PasDlg NAME "K_PASWINGAVE"

REDEFINE GET pGET[1] VAR cUSER  ID 101 OF PasDlg PICTURE REPLICATE("X",40)
REDEFINE GET pGET[2] VAR OldPas ID 102 OF PasDlg PICTURE "!!!!!!" VALID CtrPaswOK()

pGET[1]:bGotFocus := {|| SYSREFRESH(),pGET[1]:Assign(),pGET[1]:SetSel(0,LEN(RTRIM(cUSER )))}
pGET[2]:bGotFocus := {|| SYSREFRESH(),pGET[2]:Assign(),pGET[2]:SetSel(0,LEN(RTRIM(OldPas)))}
pGET[2]:lPassword := .T.

DEFINE TIMER PWTim INTERVAL 10000 ACTION (PasDlg:End())
ACTIVATE TIMER PWTim

ACTIVATE DIALOG PasDlg CENTERED


Until some time ago, this was working fine. But suddenly the timer refused to work : the dialog box is not closed ater 10 seconds.

Anyone any idea why ?

Thanks a lot in advance for any help.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problem with timer
Posted: Sun Oct 05, 2008 08:54 AM
Michel,

You have to do it this way:
#include "FiveWin.ch" 

function Main() 

   local oDlg

   DEFINE DIALOG oDlg TITLE "Test" 

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT BuildTimer( oDlg )

return nil 

function BuildTimer( oDlg )

   local oTmr
   
   DEFINE TIMER oTmr OF oDlg INTERVAL 10000 ACTION oDlg:End()

   ACTIVATE TIMER oTmr 

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Problem with timer
Posted: Sun Oct 05, 2008 09:27 AM

Antonio,

Problem solved.

Thanks a lot.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion