Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drag set to auto - can't get focus anymore
Message
De
17/01/2007 19:13:28
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
17/01/2007 17:10:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01186395
Message ID:
01186480
Vues:
29
>>I have a form (sounds familiar, eh?) where I need to drag a few controls and drop them onto an editbox. I've just set the dragmode=1 (automatic) on those, wrote the code in dragdrop method of the editbox, and it works as I wanted it to.
>>
>>Now the trouble is that these controls can't be clicked into. I've worked around this by setting the hotkeys to their labels and having a proper tab order, but that's a kludge.
>>
>>Is there a better way to have drag and drop AND to be able to set focus to the controls by just mouse?
>
>Dragan,
>What I do is:
>-Use manual instead of automatic
>-In mousedown wait for a little time (ie: 0.2secs)
>-if still mdown() start drag manuall (this.drag(1)).

I don't care about your no-stars policy - if I couldn't find this trick elsewhere, then who knows how many others can't. So suffer some stars so this solution can be found next time someone needs it :).

Took me a while to implement this via Bindevent() - because I wanted to select the controls to which to add this by giving them an extra property, and that property wasn't saved. Can't add extra methods to members, I knew that, but didn't quite get it that it would equally not work for properties. So instead of just marking the controls in the PEM window and doing the bindevent() during the recursion through controls, I now have them listed in separate set of bindevent() calls in form's .init() - and it works as advertised, thanks!

How many tries did it take you to find 0.2s as the proper interval? I'd maybe cut it to 0.15 for myself (I'm the only user of this form), but it feels about right.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform