Normal Topic pop up menu postion (Read 471 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
pop up menu postion
May 31st, 2007 at 3:27am
Print Post Print Post  
I have been trying to make a popup menu come up on the right side edge of a field on a form.  I h have set This Element but am having trouble with the calculations.  Everything seems to be from top corner of form.

This is not working...
PopupSelectPosition(4, @Xpos(ThisElement)+@Width(ThisElement), @Ypos(ThisElement))

I have changed the 4 to all the other numbers but none does it right.  Now I am using this by having a fixed value form trial and error...
PopupSelectPosition(4, @Xpos(ThisElement)+210, @Ypos(ThisElement))

I thought that the first formula would go the X of ThisElement and add the width of the field to make the correct position of the popup menu but it shows up in top left corner of screen.  is there another value to make the positioin relative to ThisElement instead of relative to the form?  If not then maybe this will be in the next new version?
  
Back to top
 
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: pop up menu postion
Reply #1 - May 31st, 2007 at 3:51am
Print Post Print Post  
okay here is some more information.  Using the nomber 3 option seems to be the closest.  This is what that looks like....
PopupSelectPosition(3, @Xpos(ThisElement)+@Width(ThisElement), @Ypos(ThisElement)) 

But the popup window still overlaps the button that is ThisElement.  But when I look close it appears that maybe the center of the popup menu is in the right position.  i thought that the X and Y would be the top left location like everything else.  is this some kind of a bug?  If i knew the width of the popup menu then i could add half of that to X and make it coume out ok like this...

PopupSelectPosition(3, @Xpos(ThisElement)+@Width(ThisElement)+@Width(popupmenu)/2, @Ypos(ThisElement)) 

but i was still expecting the X and Y to be the top left, not the center.  I looked in the manual and cannot find how to get the width of the popupmenu.  I even looked in the secret Sesaem Change Log.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: pop up menu postion
Reply #2 - May 31st, 2007 at 5:14am
Print Post Print Post  
I believe, the width of popup is controlled by the width of the widest entity in the display.
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: pop up menu postion
Reply #3 - May 31st, 2007 at 3:33pm
Print Post Print Post  
It sounds like the question is how the X position of the menu is calculated. 

Bharat, I think you are right that the width is controlled by the longest value, but that should not affect the X position.  It should be a function of the X and Y values in the formula.

I also think that obfusc88 should be using the "4" vs. the "3" because it uses the reference of the form edge, not the window.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged