Steve Martino Posted May 26, 2017 Posted May 26, 2017 Hi Forum. I'm trying to do the standard center the window on a desktop when the DB first opens. The problem I am having is if I shrink the db window down to a small size, then close the db, when I reopen the window won't center unless I run the script twice, or change the script to have 2 Move/Resize script steps-the first to make the window the size I want, and the second to center. I feel like I'm probably doing something simply wrong. I attached the script that works. I also attached the file=Admin, no P/W. The file is set with OnFirstWindowOpen script trigger where the resize and move are all in one step. To replicate the behavior, open the db, manually resize the db to a small window, close then reopen. Any thoughts or advice is always appreciated. Thanks Steve Sample.fmp12
Josh Ormond Posted May 26, 2017 Posted May 26, 2017 It's probably not necessary to use 2 Move/Resize Window steps. // Freeze Window Go to Layout [ “Dashboard” (DASHBOARD) ; Animation: None ] Move/Resize Window [ Current Window ; Height: 989 ; Width: 1620 ; Top: ( Get ( WindowDesktopHeight ) - 989 ) / 2 ; Left: ( Get ( WindowDesktopWidth ) - 1620 ) / 2 ] # Set Global Variable for 'Show/Hide Toolbars' developer script. Set Variable [ $$toolbar ; Value: 1 ] # You are also not accounting for the full width and height of the window. You are dividing it in half. Also, another consideration or 3: Some users want that file to open in the same place they left it. You may want to account for that. Do any users work on a resolution of less than 989 x 1620? I like to push the centering of windows into a utility script that I can pass in as parameters the dimensions I want. That way I can just call that script, pass in the dimensions as parameters and use that script anywhere.
Steve Martino Posted May 26, 2017 Author Posted May 26, 2017 Hey Josh, thanks for your thoughts. I'm not quite following you. This DB is only for my use so just one resolution to consider. If I shrink the db window and close the database, then, if I use the script pictured to open the file, it works fine. If I take the same script, remove line 3, and put the size along with the top and left parameters into just one script step, it won't work. It only works by setting the size in one script step, then setting top and left in the next. I just wanted to know if the script shown is correct and/or how to correct it. Thanks Steve p.s I attached the same file with all the resizing in one script step Sample.fmp12
Josh Ormond Posted May 26, 2017 Posted May 26, 2017 (edited) With the script I posted, it works fine for me. Sample.fmp12.zip Edited May 26, 2017 by Josh Ormond added attachment
Lee Smith Posted May 26, 2017 Posted May 26, 2017 2 hours ago, Josh Ormond said: Some users want that file to open in the same place they left it. You may want to account for that That is a BIG consideration. 48 minutes ago, Steve Martino said: p.s I attached the same file with all the resizing in one script step Please add a version number or mod to your updates. i.e. SampleMod.fmp12 works
Steve Martino Posted May 26, 2017 Author Posted May 26, 2017 @Lee Smith-duly noted @Josh Ormond-Thanks...It is sinking in Thanks again Steve
Recommended Posts
This topic is 2738 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