Problem with timer

Problem with timer

Postby driessen » Sun Oct 05, 2008 8: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 :
Code: Select all  Expand view
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Antonio Linares » Sun Oct 05, 2008 8:54 am

Michel,

You have to do it this way:
Code: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby driessen » Sun Oct 05, 2008 9:27 am

Antonio,

Problem solved.

Thanks a lot.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests