A window is a device used to display the user interface of an application. When a user opens a FileMaker solution, it will open a new window. Since FileMaker Pro 7, there has been support for multiple windows for a single file.
Opening a new window
The simplest way to open a new window is to choose Window > New Window. A new window created in this way is a duplicate of the current window – same size, same layout, same found set, same sort order. However, the windows are independent – each can display a different layout, found set and sort order.
A developer can also use the equivalent script step – New Window. This provides additional options such as a choice of four window styles (see below), setting the window name, changing the layout and setting the size/position. There are also options to show or hide various window features such as the Close button (see below).
A developer can also use the Go to Related Record script step to create a new window. Using the Show in new window option provides the same options as above.
FileMaker window styles
Scripted new windows provide a choice of four window styles.
This is the standard modeless FileMaker window. It is used to provide a second view into the file such as displaying a different set of records (perhaps from a different table) so that the two sets can be compared side by side.
This is just like a document window except that it is always on top of all other windows. If multiple floating windows are created, any one can be selected to be in front, but all floating windows will always be in front of any document windows.
If a script creates multiple floating windows, any of those windows can be selected and brought to the front. However, if a new floating window is created from an existing floating window (using Window > New Window), then that floating window remains behind all others (but still in front of document windows). Weird eh?
A dialog window is modal. Opening a dialog window will prevent access to all other windows for the current file. The dialog window must be closed to resume use of other windows. Dialog windows are therefore used in a similar way to custom dialogs but with more flexibility in the design (being based on a layout).
Card windows were introduced in FileMaker Pro 16. They are created inside the parent window and are modal to it – the parent window cannot be used until the card window is closed. However, card windows allow the use of other windows.
Being a new window, card windows can display a completely different context (layout) to the parent window. This makes them particularly useful in interface design.
Each window can have only one card window open at any time. The card window can be positioned outside the bounds of the parent window.
When scripting creation of a new window, there are options for display:
The options available vary by window style.
- Document and Floating Document: all except Dim parent window
- Dialog: all except Minimize and Dim parent window
- Card: only Close and Dim parent window
When creating a new window, any of the available options can be turned off. However, developers are well advised to carefully test their choices to ensure that the user can proceed. For example, if there is no Close button on a Dialog or Card window, the user may not be able to close the window at all and therefore be effectively locked in the solution.
Window script triggers
There are four file triggers available through File > File Options… that relate to windows. They are:
The OnFirstWindowOpen and OnLastWindowClose triggers are activated when the file opens and closes respectively.
OnWindowOpen is activated when any new window is opened for the file. This includes the first window when the file opens. It occurs after the OnFirstWindowOpen trigger.
OnWindowClose is activated when any window is closed for the file. This includes the last window is closed. It occurs before the OnLastWindowClose trigger.