Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid method - GridHitTest
Message
From
02/08/2001 12:28:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/08/2001 11:58:15
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00538901
Message ID:
00538929
Views:
15
>I am using a grid to display fields of a table.
>I want to give the user a multiple-line selection tool with teh mouse.
>The user clicks on lets say first row of the grid and releases the mouse over the 10th row. at this point I want to selected lines between 1 and 10.
>By select I mean to mark a field in the table as selected.
>
>I tried to use MouseUp Event of the text object in the column and to use GridHittest to get the relative row and relative column where the user released the mouse, but I always get 0 for these relative positions....But even if it's going to work I am not sure how I am going to find the positions in the source table....
>
>Do you have any suggestions?
>
>Thanks,
>Vali

Vali,
GridHitTest works. How do you code it ? MouseDown object (typically a control in grid.column) gets MouseUp also. ie :
*mdown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
store 0 to nWhere, nRelrow, nRelCol
with This.parent.parent
 .GridHittest(nXCoord, nYCoord, @nWhere, @nRelRow, @nRelCol)
 .tag = transform(nWhere)+transform(nRelRow)+transform(nRelCol)
endwith
*mup
LPARAMETERS nButton, nShift, nXCoord, nYCoord
store 0 to nWhere, nRelrow, nRelCol
with This.parent.parent
 .GridHittest(nXCoord, nYCoord, @nWhere, @nRelRow, @nRelCol)
 .tag = .tag+chr(13)+transform(nWhere)+transform(nRelRow)+transform(nRelCol)
 messagebox(.Tag)
endwith
You could easily find out start and end rows with a little math. However you should control scrolling too.
Cetin
Ç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
Next
Reply
Map
View

Click here to load this message in the networking platform