Database Reference
In-Depth Information
UP TO SPEED: WINDOW SIZE AND POSITION CALCULATIONS
The fact that you can set a new window's size and position using a calculation may seem a little
strange. After all, do you really need a bigger window for someone named Kirk than you would for
Janeway? Do you want your windows in a different place on Thursdays?
In fact, though, you can do a lot of interesting things with window size and position calculations.
FileMaker provides a handful of functions that let you find out about the size and position of the
current window, and of the computer screen, and use that information in calculations:
▪ The Get(WindowHeight) function, for instance, returns the height of the current window, in
screen pixels (the little dots on your screen). Its brother, Get(WindowContentHeight) returns
the height of just the window's content area; that is, the area inside the title bar, scroll bars, and
Status toolbar. The Get(WindowWidth) and Get(WindowContentWidth) functions are similar.
▪ The Get(WindowTop) and Get(WindowLeft) functions tell you where the window is on the
screen. The first returns the distance from the top of the window to the top of the screen. The
second tells you the distance from the window's left edge to the screen's left side. Both dis-
tances are measured in pixels.
▪ The Get(WindowDesktopHeight) and Get(Window DesktopWidth) functions tell you how
much desktop space you have. In Windows, it's the area of FileMaker's main program window.
On a Mac, it's the size of the desktop.
▪ Finally, Get(ScreenHeight) and Get(Screen Width) tell you how big the screen is. (If you
have more than one screen, then they tell you about the screen the current window is on.)
By combining these functions in creative ways, you can make your scripts smart about how they
size and position windows. For example, to make the new window appear slightly offset from the
current window, use these settings:
▪ Distance from top: Get(WindowTop) + 45
▪ Distance from left: Get(WindowLeft) + 45
If you're particular, and you want to make sure the new window never hangs off the bottom of the
screen, use this Let() function calculation for the “Distance from top” value:
Let (
[Limit = Get(WindowDesktopHeight) -
Get(WindowHeight);
Offset = Get(WindowTop) + 20;
Best = Min(Limit; Offset)];
Best
)
Search WWH ::




Custom Search