Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you calculate the header height?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00290365
Message ID:
00290655
Vues:
45
>I had a feeling the final calculation would be this complicated. Wouldn't it be nice if the objtoclient returned the screen position rather thant the form position if the current object was not within a container?

Hi Dan,

It really depends on what you're trying to do. In my case, not only did I have to take all that stuff into account, but also had to get the absolute co-ordinates of the form.

Part of this is that VFP (nor any other application) really doesn't "create" the window. Windows does. When we specify the border type, etc., VFP uses passes this information on to Windows when the form is run (CreateWindow()). SYSMETRIC() simply maps to GetSystemMetrics() which does the actual work of returning the requested values.

As far as this is concerned, yeah it'd be nice to have direct access to some mechanism that would tell us these co-ordinates. How useful beyond situations like ours is another story, however.

Just a suggestion. You might want to look at Obj2Bmp for ideas on getting this information. As I mentioned earlier, I had to have the absolute position on the desktop. It wouldn't take much to modify the routines that retrieve an object's top and left co-ordinates. The one's in Obj2Bmp had to be 100% accurate, otherwise the whole system wouldn't work. Further, they had to account for things like objects within a container, within container, etc. within a form. The functions are named GetTop() and GetLeft() and are methods in the Objpicker.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform