Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MROW() or similar - relative position
Message
De
16/04/1998 16:52:47
Tim Hockin
Illinois State U - Residential Computing
Normal, Illinois, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
MROW() or similar - relative position
Divers
Thread ID:
00092696
Message ID:
00092696
Vues:
67
Is there any simple (fast) way to get the current mouse position relative to the conatiner (not form) the mouse is in?

e.g. - mouse clicks on a container and holds...if mouse moves outside the container - I need to do something. I have a timer, and each loop thru it checks the MCOL() and MROW() values against THIS.LEFT etc. BUT if this class is inside another container (which it is) THIS.Left = 0 (or small number).

What I need is a mechanism of finding out the position of the mouse in a container, or finding the absolute LEFT, TOP of a container.

Right now I am using:

LOCAL o

o = THIS.Parent

lnX = MCOL(THISFORM.Name, 3)
lnY = MROW(THISFORM.name, 3)

DO WHILE (o.baseclass <> "Form")
lnX = lnX - o.LEFT
lnY = lnY - o.TOP
o = o.Parent
ENDDO

Problem is - some classes (namely a "page") do not have LEFT or TOP properties. and this loop is slow in a 30 ms timer loop...

Using VFP 5, btw..

Thanks in advance
Tim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform