Normal Topic Programming: XPos/YPos (Read 1242 times)
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Programming: XPos/YPos
Nov 12th, 2017 at 3:59pm
Print Post Print Post  
Hello, in Sesame on Windows, due to hardware acceleration which you cannot turn off as far as I know, the dropdown menus on "Combo Box" fields only stay open for a short time and quickly disappear if you don't mouse over the  dropdown menu or if you scroll down in the form.

I would like for the dropdown menus to stay open until I either A. click on an item or B. Click off anywhere else or on another field for example.

Seeing as I don't know how to do this, and don't even know if it's possible I thought of a work around.

I created a command button that uses the command @PopUpMenu and it seems to work fine. I also used PopupSelectPosition to make the menu popup near the field in question.

However, my problem is this:

https://imgur.com/a/s6pCG

https://imgur.com/a/wbw3D

As you can see, the menu hovers awkwardly right over the field in question. What I would like to do is make that field appear slightly below the field instead.

So what I came up with was using PopupSelectPosition then using the commands XPos and YPos. However, I quickly realized you can't use those commands inside of the PopupSelectPosition command because they don't have the "@" symbol. But the problem is that if you use @XPos or @YPos, it doesn't allow you to specify the exact amount of pixels you want it to be. XPos and YPos are supposed to do that.

Quote:
XPos(LE, N) Sets horizontal position of element to n pixels from the left form margin.


I'm sure there is a way to do this but I'm not figuring it out from my lack of expertise in coding. But here is the code I came up with:

Code
Select All
var vChoice as String

var vX as Int
var vY as Int

vX = @XPos(Equipment)
vY = @YPos(Equipment)

PopupSelectPosition(4, vX, vY)

vChoice = @PopupMenu("Truck;Mitre Saw;Sawz-All;Level;Nailgun;??/","SELECT EQUIPMENT")

FormFieldValue("ACTION", "Equipment", 1, vChoice) 



Here is the example from the Sesame 2 Programming Guide for XPos:

Quote:
XPos(LE, N)
Type: User Interface
Parameters: LE as element reference, N as int
Returns: Nothing
Temporarily sets the horizontal position of layout element LE to n pixels from the left
margin of the form.


Code
Select All
var vint as Int
vint = @XPos(Company)
WriteLn(vint)
XPos(Company, vint + 1)
vint = @XPos(Company)
WriteLn(vint) 



I appreciate any support, thank you for reading my post.

  
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: Programming: XPos/YPos
Reply #1 - Nov 12th, 2017 at 5:55pm
Print Post Print Post  
I think this is what you are looking for?

This code works for me:
Code
Select All
var vChoice as String

PopupSelectPosition(4, @XPos(Equipment)+30, @YPos(Equipment)+35 )

vChoice = @PopupMenu("Truck;Mitre Saw;Sawz-All;Level;Nailgun;??/","SELECT EQUIPMENT")

FormFieldValue("ACTION", "Equipment", 1, vChoice)  


There is no problem with using "@"commands as a variable in any of the other Sesame commands.  Your result may vary, depending on the resolution and video driver, but you can fine tune the result by changing the amount you add onto the original positions.  You can also use a negative number to move Left or Up.
  



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



Posts: 173
Joined: Apr 10th, 2016
Re: Programming: XPos/YPos
Reply #2 - Nov 14th, 2017 at 2:30pm
Print Post Print Post  
Thank you very much sir.
  
Back to top
 
IP Logged