In answer to 1, I work out the basic size I want and set it. Once the base size is determined for the dialog box, I tend to reuse the same values.
For #2, I try not to let the user go to actual full screen. Instead I script this and set it a few pixels (points?) smaller then full size. This makes the transitions much smoother.
Thanks, but I'm afraid those solutions aren't going to work for me. Having to arrive at the dimensions in pixels by trial and error is a very inefficiant way to work. And I don't think shrinking the size of the main window, even by just a couple of pixels is going to fool any Windows users.You get that second title bar (which, combined with the status area, wastes a lot of space). I have enough trouble fitting everything they want on a layout as it is.
Unless anyone has a better idea, I'm going to have the script go a full screen layout that serves as a dialog. I had hoped the modal window attribute (which is clearly intended for dialogs) would actually look and behave like a real Windows dialog.
- In attempting to use the new modal (dialog) window feature, I found that the only criteria the script step accepts is pixels. FMP12 doesn't use pixels anywhere else, so determining the size of the window from the rulers on the layout is something of an ordeal.
The rulers default to "in", but like the dimensions used in the Inspector, you can click on the "in" and it will change to "cm". Click on it again and it changes to "pt". "pt" is short for "points". From what I have observed with working with objects in layout mode, this is the same as "pixels" in the Window dimensions.
You may find it useful to calculate the dimensions of the new modal window based on the current situation. The functions Get(ScreenWidth), Get(ScreenHeight), Get(WindowTop), Get(WindowHeight), etc., may be useful here. All of these functions return a result in pixels.
Something that may help is one of the many screen measurement tools out there - on the Mac, I use XScope all the time. Before we got multiple guides in FM 12, XScope's on-screen guide and ruler tools were invaluable. You can also draw out boxes to get measurements along with many other useful things.
Sounds like you're on Windows - I'm sure there is something similar out there.
While not the perfect solution that we need, this can help.
In shrinking the size of the window, I find that it works because when I design/build the layout, it is setup to fit in a specific size window. Then allow for items to stretch and fill available space when it is appropriate. As long as the elements of the layout don't exceed the window size, you don't get scroll bars.
Ok, That stated... In looking at the new window and GTRR set ups, they are asking for Pixels. This might possibly be considered a bug, since the setup for a layout has been switched to points. The saving grace, is that all of the other script commands are still in pixels. So you can set a window size by using get statements. As in: Get ( WindowDesktopHeight ) - 1 or by script as in:
Move/Resize Window [ Current Window; Height: Get ( WindowDesktopHeight ) - 1; Width: Get ( WindowDesktopWidth ) -1; Top: 0; Left: 0 ]
This would adjust a window to 1 pixel smaller then max in height and width and put it in the upper left corner. If everything on the layout fit, no scroll bars and to the average eye should look almost like a maxed window. Opening another window would not resize this window. You can put the get functions in the open window and GTRR window size fields so that it does this on window open.
I would love the ability to pop-up a lightbox or similar dialog window like you can do with java. Hmmm, I wonder if you could to it using ScriptMaster.
In the meantime, I have resorted to using a custom function that pings the size of the application window, then sizes the window to fit that. Not maximized, but fits just inside that window. And I hide the Status Area...and replicate the functions in a much smaller space.
My users haven't really noticed that they are not maximized. Unless they resized the app window manually. Then I give them buttons that mimic the "maximize" function, and look like them, while hiding the original button in the windows.