Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer _SCREEN
Message
De
27/05/1998 14:30:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00092031
Message ID:
00102458
Vues:
21
>>>In oApp.Init I have this:
>>>
>>> _SCREEN.AddObject("odTimer","timer")
>>> _SCREEN.odTimer.Interval = (1000 * cfgDuration)
>>> _SCREEN.odTimer.Enabled = .T.
>>>
>>> * Ok so far, no errors.
>>>
>>> Q. Where do I add code to the .Timer event?
>>> How do I know if anyone has moved the mouse or pressed a key?
>>> There is no KeyPress for a _SCREEN or formset.
>>> A while loop to check .Forms seems a little sloppy.
>>>
>>>Eric K.
>>
>>_SCREEN doesn't have events. If you use VFP5 you could consider top-level form approach.
>>To customize code in _SCREEN.Timer events you should create your own timer class customizing code in Class Designer, and instanciate object from this class.
>
>Sawadee,
>
> Turns out there is a reasonable way to check activities and log out. I created the timer in the class designer like you said, then instantiate it in main. Then in init of timer I set two custom properties to the FSIZE of a file generated by eventstracking. When the timer event fires I check to see if the sizof the events log has changed, if so, set old size to new size and continue.
>This is handy because you can also set the events to track, but watch out for mousemove, if someone bumps the mouse the app won't timeout till the next loop.
>If someone wants this timer subclass, let me know and I will put it in our anon FTP site. It's a little tricky manipulating the compatible and events tracking modes.
>
>Eric K.

I would love to have the code!!! I would like to be able to have my program shut down if the user doesn't use it. You can email it to me if you like.

Thanks.

trishm@sccsi.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform