Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Sam
  Where is Sam?
 HK
 Hong Kong
 Sam
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Auto-exit idle form
Thread ID: 209678 Message ID: 209682 # Views: 4 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Tuesday, December 30, 2008 1:30:37 PM         
   


> > Hi all,
> >
> > Is it possible to exit an idle form automatically, using timer? How?
> > eg. When a user leave his seat, foxpro detects the form being idle for 1 min. and automatically exit the form.
> >
> > Thanks in advance
> >
> Hi Sam,
>
> Yes, you can for instance do something like "Clear Events" or "Thisform.Release()" in yourTimer.Timer() and in form.MouseMove() and/or form.KeyPress() (while form.KeyPreview=.T.) do a yourTimer.Reset()
>
>
> hth
> -Stefan
>
>
>
> LOCAL oForm as Form
> oForm = CREATEOBJECT('TestForm')
> oForm.Show(1)
> RETURN
> 
> DEFINE CLASS TestForm as Form
> 	AutoCenter = .T.
> 	KeyPreview = .T.
> 	PROCEDURE KeyPress(nKeyCode, nShiftAltCtrl)
> 		This.tmrShutdown.Reset()
> 	ENDPROC
> 	PROCEDURE MouseMove(nButton, nShift, nXCoord, nYCoord)
> 		This.tmrShutdown.Reset()
> 	ENDPROC
> 
> 	ADD OBJECT tmrShutdown as Timer WITH Interval = 60*1000
> 	PROCEDURE tmrShutdown.Timer
> 		Thisform.Release() && or "Clear Events" for an app shut-down
> 	ENDPROC
> 
> 	ADD OBJECT Text1 as Textbox WITH Left = 10, Top = 30
> 	ADD OBJECT Text2 as Textbox WITH Left = 10, Top = 60
> 	ADD OBJECT Text3 as Textbox WITH Left = 10, Top = 90
> 	ADD OBJECT Text4 as Textbox WITH Left = 10, Top = 120
> ENDDEFINE
> 


Thanks.
But Stefan, will the form always be released, no matter what the user do?
(because the timer is set to 1000*60)



SAM

ENTIRE THREAD

Auto-exit idle form Posted by Sam @ 12/30/2008 1:04:39 PM
RE: Auto-exit idle form Posted by Stefan Wuebbe @ 12/30/2008 1:13:17 PM
RE: Auto-exit idle form Posted by Sam @ 12/30/2008 1:30:37 PM
RE: Auto-exit idle form Posted by Stefan Wuebbe @ 12/30/2008 3:03:50 PM
RE: Auto-exit idle form Posted by Sam @ 12/30/2008 3:14:58 PM
RE: Auto-exit idle form Posted by Bhushan Sahni @ 12/30/2008 1:20:39 PM
RE: Auto-exit idle form Posted by Sam @ 12/30/2008 1:31:22 PM
RE: Auto-exit idle form Posted by Bhushan Sahni @ 12/30/2008 1:39:22 PM
RE: Auto-exit idle form Posted by Sam @ 12/30/2008 3:14:28 PM
RE: Auto-exit idle form Posted by Ciprian Zaharia @ 12/30/2008 1:52:31 PM
RE: Auto-exit idle form Posted by Sam @ 12/30/2008 3:17:11 PM
RE: Auto-exit idle form Posted by Yousfi Benameur @ 12/30/2008 2:26:41 PM
RE: Auto-exit idle form Posted by Sam @ 12/30/2008 3:16:43 PM