Skip to main content
Version: 8.1

Popup Windows

A popup window is typically a window that "floats" on top of the main window. It can be resized and moved around by the user, all while the main window is still open in the background. Popup windows are great for displaying additional information about a selected item on the screen, for example a details screen about one particular component. Popup windows are often opened by components in a main window and are meant to be on top of the screen. They are used to view setpoints and zoom into a specific area.

A great thing about popup windows is how they can be parameterized and be reused. One popup window design can be reused for many components as long as the proper information is passed through.

Creating a Popup Window​

Like main windows and docked windows, popup windows are simply windows that have specific settings. In particular, popup windows are floating windows that are not set to start maximized. When adding a new window in the Designer, selecting the popup window option creates a window with these presets. Once you have your popup window created, you can make it as big or small as you want. You can also set properties in the Property Editor to make it closeable, make it resizable, give it a new title, and display the title bar and border in the window.

Opening a Popup Window​

In any window, you can add a script to any component to open your popup. This is easiest to do from a component like a button on the main window using the Navigation Script Builder. Simply select the Open action and the window that you want to open. Clicking on the button will then open the popup window that was selected. Alternately, you can use one of the many scripting functions that open a window.

There are a few properties of the Window that are useful to popups, such as Layer and Location.

Layer​

The Layer property of windows controls the z-order of the windows. Windows with a higher Layer will always be on top of windows with a lower Layer, regardless of which window is in focus. This is useful for keeping popup windows at the forefront. By default, all windows have a Layer of 0, but we can change this so that popups always remain on top. If popups have a layer that is the same as the main window, clicking on your main window makes it look like the popup window disappears, but it’s actually behind your main window. The Windows Menu will show you all the open windows in your Client, with the popup still being open.

The Layer property is located on the window object itself, in the Property Editor. Simply set it to a higher value so that the popup is always on top.

Location​

Popup windows can also be given a specific location to open up at, when the not being automatically centered by the script. In the Vision Property Editor, go to Layout > Location and provide a specific X and Y position (in pixels).

note

When opening a popup window to a specific location, ensure the Open and Center option is unchecked so that it doesn't override the location coordinates.

Parameterized Popup Windows​

Inductive University

Parameterized Popup Window

Watch the video

A parameterized popup window lets you pass information from one window to another window. You can make a single popup window, change what it does and what it points to from a parameter(s) that gets passed into the receiving window using Custom properties. Parameters can range from simple integers and strings, to properties on the window that is opening the popup, and even entire UDT custom properties.

Multiple Instances of a Popup Window​

Inductive University

Popup Window - Multiple Instances

Watch the video

By default, the client only opens a single instance of a popup window, but you can change this behavior. For example, suppose you have four different Tanks passing all the same parameters with the only difference being the individual Tank number. In order to see all four instances of your tanks, you need to configure component scripting to display Additional Instances. This is done by selecting the Additional Instance option when setting up the navigation scripting action.

Alternately, the system.nav.openWindowInstance can be used within a more complex script instead.