2 Replies Latest reply on Oct 10, 2012 8:37 AM by philmodjunk

    Layouts - Centering

    Annette

      Title

      Layouts - Centering

      Post

            Hi,

           Is there a way in page setup when I'm making a layout that the layout will centre on the screen regardless of the monitor size / resolution?  Or does this happen by default when you create a layout. 

        • 1. Re: Layouts - Centering
          schamblee

                 I set a script trigger when layout loads then center the main window.  . 

               This is my Open script

               Show/Hide Toolbars[Hide]
               Allow Formatting Bar[Off]
               Go to Layout ["Main Layout"]
               Adjust Window[Resize to Fit]
               Move/Resize Window [Current WIndow, Top:(Get(WIndowDesktopHeight)-Get(WindowHeight))/2;Left:(Get(WindowDesktopWidth)-Get(WindowWidth))/2]

                

               To set script trigger go to

               File, File Options, Script Triggers, OnFirstWindowOpen then select the Above script

                

                

          • 2. Re: Layouts - Centering
            philmodjunk

                 On the inspector's position tab, is a section named "Autosizing". In it you can specify "anchors" for any object on your layout. The default setting is to anchor each object to the top and left edges to your window. With those settings, when you change the window size, the objects keep the same distance from the top and left edges of the window. If you anchor the object to the right instead of the left, it will keep the same distance from the right hand edge of the window. If you select both right and left edges, the size of the object will change as the window size changes. The same is true for top and bottom anchors. This can be a handy way to have a portal expand and contract to show different numbers of portal rows as a window size changes. (And in FM GO, rotating the device changes the window size so anchors can help your layout adjust for the change in device orientation.)

                 Unfortunately, if you group all your layout objects into a single group and select all anchors, the objects will not resize as a single object, you get a mishmash of overlapping layout objects as each changes size individually, but if you select all the objects on your layout and group them, then remove all anchors, the group of objects will stay the same size, but be centered in the center of the window for any given window size.