Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simulate a standby situation
Message
De
04/01/2006 09:04:38
 
 
À
04/01/2006 08:55:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01083079
Message ID:
01083098
Vues:
17
>i dont use classes, i have only a principal form with command button, textbox, combo.
>Now you say that every time the user click on a command or type in a text box or do something over controls i have to reset the timer at the 5 minuts.
>In this way j have to control all the controls over the form right??


Yes. For example, code in the txtBox.InteractiveChange() resets the timer.

This is an example of what the framework I use (VMP) has in InteractiveChange():
*  report user activity to oApp in case there
*  is a timeout in effect
IF VARTYPE(oApp) = "O"
  oApp.SetLastUserActivity()
ENDIF
SetLastUserActivity() is called by InteractiveChange() in all controls and all it does is basically resetting the timer.



Note: You should use classes and OOP. Else you are re-inventing the wheel every time you create a new program. One of the main advantages of Object Oriented Programming is reusability. In this example, you would have to add the codeto every textbox you use in every form, today and tommorrow on the next form. If you create your own txtBox class that already has this code (this behavior) in it, all you have to do is drop an instance of your textbox, instead of VFP's base textbox and it already works! If you also used a subclass of the base form that has the timer code, all your programs will inherit this behavior without any more work!


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform