Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding ScaleMode and control coordinates
Message
From
14/09/2008 12:07:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01347419
Message ID:
01347428
Views:
23
>Hi,
>
>Some time ago I got a good suggestion on how to display a popup menu right above a button. The coordinates for the button position were determined as following:
>
>
>Thisform.ScaleMode = 0		&& Foxels
>lnPosX = This.Left 
>lnPosY = This.Top 
>Thisform.ScaleMode = 3                        && Back to Pixels
>
>define popup MyPopupMenu shortcut relative from (lnPosY), (lnPosX)
>
>
>The above worked very well.
>
>Until I changed the position of the container on which the button reside. Here is more detailed explanation. The button at which I want to pop a menu is on a container. The container is on on one of the pages of the pageframe. What I did is in the INIT method of the form I dynamically increased the form and moved the pageframe down (by changing the TOP property value of the pageframe). All containers and controls on the pageframe moved accordinigly, no problem. But the coordinate of the button (as determined above) didn't change. That is, when user clicks on the button the popup menu appears much higher than the button. That is, the popup menu appears in the position where the button would have been had I not moved the pageframe down.
>
>How can I change the way the button coordinates are determined to make sure that the popup menu moves with the button?
>
>Thank you in advance for any suggestions.

You may need to add the this.parent.top and this.parent.left to lnPosX/Y, all the way up to the point where the parent is the form itself - i.e. you need to get the coordinates of your object relative to the form, not to its immediate parent.

BTW, the value of a foxel depends on form's font, IIRC, so that may throw your calculation off... or I may be wrong, it's now eleven years since I last tried to use foxels.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform