Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids - Multiple Row Select
Message
 
À
03/12/2004 09:03:46
Jeffrey Havelock
Skipton Information Group
Leeds, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00966662
Message ID:
00966786
Vues:
10
We created a class for achieving this, basically all We do is put a Custom object in the form and set one of it's properties to the name of the grid that we want to be Multi-Selected. This class in the init places an invisible shape covering the data area of the grid and it intercepts all events, preventing them to go directly to the grid, this way we can handle and decide what to do, once we know what to do, we send a click to the grid (if applies) to do it's default action (moving the record, firing the events, etc)

To mark the records as selected, we do not use a flag field, for that would be not to easy to implement at a class level, instead we create a cursor with only one field, which is the recno() of the parent table/view of the grid and set a relation to RECNO() something like:
create cursor c_selected (nrecord i)
index on nrecord tag nrecord
select (Grid.RecordSource)
set relation to recno() into c_selected
Because we handle all keyboard/mouse input in the invisible shape, it allows us to simulate all the selection as you can do in the explorer, handling Shift, Control, Shift+Control, etc.

We wrote this class some years ago, so details are fading out :)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform