Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mouse Click - TreeView
Message
From
02/08/2003 05:27:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00816165
Message ID:
00816171
Views:
19
Daniel,
Couldn't clearly understand nor tested the situation. As far as I can understand if you can swap the lastkey value with 13 your problem would end ?
If so :
if lastkey()=27
 keyboard '{Enter}' && Swap lastkey value with 13
 =inkey()           && Clear [enter] from buffer
endif
Cetin

>Whilst using a simple TreeView connection to a Table all is fine.
>
>I decided that a side menu activated by the Right-Click,(button=2) would be
>good idea.
>
>Yes, it all worked well until testing !
>
>It was the USERs fault !
>
>They decided to simultaniously click both the Left & Right mouse button at the same time. It stop the application, and my Treeview was all over the place.
>
>I found the the Left&Right Mouse click created a LASTKEY()=27.
>
>OK. So I trapped the problem. But how to I change the Lastkey() value ?
>
>
>Sample
>
>Object : oTrreview Procedure: MouseUp
>*** ActiveX Control Event ***
>LPARAMETERS button, shift, x, y
>
>IF LASTKEY()==27
>
>???
>
>ENDIF
>
>IF button==2
>DO CASE
>CASE ALLTRIM(datalog.type)=='EQUIP'
>DO core_eq.mpr
>RELEASE MENU core_eq
>CASE ALLTRIM(datalog.type)=='FOLDER'
>DO core_ut.mpr
>RELEASE MENU core_ut
>ENDCASE
>
>RETURN
>
>ENDIF
>
>I have to release & clear but to no avail.
>
>Am I missing something very basic in my old age ?
>
>
>========================================================
>The actual action by the user is going up and down the treeview very fast, sometimes clicking the left and sometimes clicking the right. During this test... no problems, however when the user starts clicking using both left and right very fast, my problems start.
>
>My right click on the node loses the function of the menu ?
>
>I tried to trap the problem.
>1. Button=3 in Mouse Move will trap it
>2. Lastkey()=27 in MouseUP or MouseDown will trap it
>
>During Runtime the only way out is to press the Escape Key a few times. That
>with even with SET Escape OFF.
>
>I noted that during the debug, that normally the LASTKEY() value is 13, however during this very fast left & right together clicking it changes value.
>
>I have alter the SET Typeahead, I have cleared the Typehead - no avail.
>
>I have tried CLEAR commands - no avail.
>
>Obviously, something is hanging in there - what I do not know.
>
>If I remove the Side Menu code in MouseUp altogether - the problem is gone.
>I therefore tried other ways of firing the menu - POP/PUSH instead of DO, the problem is still there.
>
>Again, this only happened on very, very fast clicking of left and right mouse together.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform