Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clear buffer of mouse clicks
Message
From
15/01/1999 13:53:22
 
 
To
15/01/1999 13:25:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00176355
Message ID:
00176620
Views:
38
>>>>>>>>>Is there a way to clear the mouse clicks from the buffer, equivalent to clear typeahead, or to limit the number of buffered clicks ??
>>>>>>>>
>>>>>>>>DOEVENTS should do the trick.
>>>>>>>
>>>>>>>Except DOEVENTS will process the mouse clicks, and not dispose of them.
>>>>>>
>>>>>>Hmm, I've used DOEVENTS to clear mouse clicks (users pressing buttons while processing going on) and it seems to work for me. Windows may have processed the mouse clicks, but VFP doesn't.
>>>>>
>>>>>This is fairly simple to test
>>>>>
>>>>>Place 2 buttons on a form, and in one:
>>>>>
>>>>>* Some query that will take about 5 seconds.
>>>>>SELECT * FROM Mytable INTO CURSOR Whatever
>>>>>DOEVENTS
>>>>>
>>>>>In the other button,
>>>>>MESSAGEBOX('Howdy')
>>>>>
>>>>>Click the first button, and while the query is running click the second. On my machine, the messagebox still appears.
>>>>
>>>>VFP 5 or 6? I'm still using 5...
>>>
>>>Both. Have you tested like this?
>>
>>
>>No, I have not tried your test. The "processing" I was referring to was SQLs to build a cursor for a report and running the report. When I used to return from the report, if the user had pressed the button while this was going on, the report would run again. DOEVENTS stopped that for me.
>
>Hmm. I have never even thought of trying that; I use flags for similar situations:
>
>Click()
>IF !THISFORM.ReportAlreadyRan
>REPORT FORM Whatever
>THISFORM.ReportAlreadyRajn = .T.
>ENDIF

Erik, I just ran a similar test to yours and you are correct it does NOT stop the second button from being pressed, but it does stop the button that started the process. If I remove the DOEVENTS, the process for the first button will be repeated. So it looks like we are both kinda-sorta right on this, but I guess I don't have a solution for clearing mouse clicks in general.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform