Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Canceling mouse events from a mousedown()
Message
De
22/03/2005 16:46:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00998164
Message ID:
00998264
Vues:
11
David,

> Can you give us a bigger picture here, why are you wanting to disable the mouse functionality like this in the first place?

Sure! In this specific app, when my users click on certain controls, hold the mouse button down for 0.5 secs (user adjustable), and keep the mouse position relatively stable (vs. dragging or highlighting) then I set the control's MousePointer to a "+" and allow the users to reposition controls by moving the mouse. If they click near the edge of a control, instead of moving the control, their mouse movements resize the control. Works great and gives users the ability to customize the layout of an executive info panel.

The problem is when the user releases the mouse button, then the mouseup and click (or rightclick) events still fire. In my case, since the mouse down event already handled the user's request, I want to prevent the subsequent mouse events that fire.

As I mentioned in my opening post, I currently do this by having all my mouse events check a control property that indicates the time in seconds() that the last mouse cancel request was made. This also works great, but I think its a crappy design from a long term maintenance perspective because it adds yet another property and scatters logic across different methods. I was hoping for a more self contained solution. For instance JScript/Javascript allows events to be cancelled at any point in the event's "progression". This results in clean, maintainable code.

I'm hoping there's a better way than my current, clunky, scattered logic approach.

Thanks for taking the time to think this through with me,

Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform