Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to distinguish between column click for drag or clic
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01368955
Message ID:
01370297
Views:
21
>Hi all
>
>I catch the click() of the grid.column.header so that I can call a sort routine for the column. Now this grid also allows drag-drop of columns. So when the users is click-dragging the sort also gets called once the drag is completed. How can I distinguish between these two types of click so that sort is not called until there is a click on the header for sorting purposes only.
>
>Please advise.

This is an inteface design problem. You need to provide the user a way to tell your system (grd) what the user is trying to do clearly, start a drag or sort on the column. You could decide to use ctrl+c;ick for dragging and that would solve the problem because you could simply check for the ctrl key being pressed when the mousedown occurs. Alternatively, if you don't want to use ctrl-click, or something like that, you could check in the mouse down for the location of the mouse pointer and in the mouse up check again and if the mouse pointer has not moved then sort on the coumen otherwaise do the drag drop action.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform