Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for mouse click in buffer
Message
De
03/03/2006 14:29:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
03/03/2006 03:44:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01101174
Message ID:
01101351
Vues:
15
>Hi All
>
>I have a button which allows a user to view the next record. I want to allow the user to be able to very quickly click this button and only when there are no more mouse clicks waiting in the queue do I want to actually retrieve the record from the database. I will move the record pointer for each click but only retrieve the actual data for the last mouse click / record that the user is now on. How can I check whether there are still more mouse clicks waiting in the queue?
>
>Thanks

You can go up the array aStack() will return, and check if there's a .click() method up there. If there is, there's an older one being processed, and is interrupted by the one you're currently doing. Then just increase a counter somewhere (a form property, maybe). Anywhere in the click processing code check for this counter - if still the value recorded when you started processing, proceed, else just return.

Suppose there were no clicks, and the counter is at zero. The first click increases it to 1 and keeps 1 in a variable it passes to each piece of code it calls. Now anything that is called checks that parameter against the current value of the counter, and if it isn't equal, it returns. Now the second click comes, increases the counter to 2, and passes the 2 to whatever it calls. Its calls see the counter is equal to the counter, and do their job. Now processing returns to the remainder of the process for the first click, and the next piece of code that needs to run still gets 1 passed, sees that the counter is now 2, does nothing, returns.

There's no reset for this counter - it gets destroyed with the form.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform