JMart Posted March 4, 2021 Posted March 4, 2021 Good day, I am trying to center a "Floating Window" using the new windows command, i want to accomplish one of two objectives. 1- Open the new windows to the right of the "button" that triggers the script To do this i am using the "GetLayoutObjectAttribute( "VendorWindows" ; "Top" ), and "GetLayoutObjectAttribute( "VendorWindows" ; "Left" ) 2- Open the new window in the center of the screen To do this i am using "Get ( ScreenWidth ) /2" and "Get ( ScreenHigh) / 2" But i cant get either way to work. Both option i am entering it in the "New windows" function What am i doing wrong. Thanks JMart
comment Posted March 4, 2021 Posted March 4, 2021 (edited) On 3/4/2021 at 8:45 AM, JMart said: What am i doing wrong. Expand Hard to say without seeing exactly what you did. Also the description "i cant get either way to work" is pretty useless. Tell us how it fails. The only thing that jumps out is this: if you want to open a floating window to the right of the button, then you should specify its position from left as = GetLayoutObjectAttribute ( "YourButtonObjectName" ; "right" ) Oh, and also, if you want to center the window, you must subtract half of its intended width from the screen center in order to get its position from left. Likewise for the vertical dimension. Edited March 4, 2021 by comment
JMart Posted March 4, 2021 Author Posted March 4, 2021 Thanks for the reply, User Click on the icon next to "Vendor" Once presses a script is executed Windows will appear on the same location every time
comment Posted March 4, 2021 Posted March 4, 2021 I am afraid I am not able to reproduce the problem you describe. The only thing I can think of is that your button's object name is not "VendorWindow". Does the attached demo work as expected for you? NewWindowPos.fmp12Fetching info...
JMart Posted March 4, 2021 Author Posted March 4, 2021 Your test file works perfect, my cant get it to work
JMart Posted March 5, 2021 Author Posted March 5, 2021 Night, I think i figured out the issue i was having, the reason is my button was not a button but a Button Bar. I recreated it to a button and its working fine. Thanks for the help
comment Posted March 5, 2021 Posted March 5, 2021 (edited) On 3/5/2021 at 4:20 AM, JMart said: the reason is my button was not a button but a Button Bar. Expand I don't see why this should be a problem (see attached). Note that a button bar is an object by itself and so are the individual buttons. The only way I was able to reproduce a behavior similar to what you describe was when neither the bar nor any of its buttons had an object name equal to the one used by the script. NewWindowPos2.fmp12Fetching info... Edited March 5, 2021 by comment
JMart Posted July 20, 2021 Author Posted July 20, 2021 (edited) Hi, I think i figured out what my issue is. It seem it has to do with the screen resolution and scale. I use a laptop and the setting are "Scale and Layout" to 125%, with a resolution of 1920 x 1080. if i put the scale to 100% it works fine. Even centering a window does not work. Thanks Rudy Edited July 20, 2021 by JMart
Recommended Posts
This topic is 1359 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now