- iRidi Studio 2019
- Switching pages and popup windows
Interface navigation: switching pages and popups
Switching pages and windows (popups) in the i3 pro interface, page/popup features and limitations, and examples of interface organization.
Pages and popup windows: purposes and features
Page is the basic interface object and the foundation of the interface. When you create a new interface, it contains one page on which to place graphic items. You can then add other pages and popup windows to the interface.
Page behavior:
- The page has the resolution selected when the interface was created;
- A page effectively covers the "empty space" that contains no interface and does not process user presses. Therefore:
- Pages cannot appear with animation effects or be transparent or semitransparent;
- A page cannot be closed, only replaced by another page;
- Only one page is visible at a time;
- Switching pages closes all popup windows open on the previous page;
- Executing "Show previous page" also reopens the windows that were hidden when that page was replaced;
- You can create portrait and landscape pages and configure them as "alternate" views. They replace each other when the phone/tablet rotates. Opening popups on screen rotation can only be configured using scripts, so rotating interfaces are usually based on pages alone, with a minimum number of popups independent of the current screen orientation (always opening in the same place, for example the top-left corner).
Popup window (popup) is a window containing graphic items that can be opened anywhere on a page. Most projects use one page and many windows because window position and transparency are controllable, windows can be animated, and many can be open simultaneously. A disadvantage is incompatibility with automatic page rotation because windows have no alternate appearances for different screen orientations. Popup behavior:
- a popup cannot be landscape or portrait;
- a popup closes automatically when the page rotates or another page opens;
- a popup can have any size and transparency and open anywhere on a page;
- animation can be applied when a popup opens and closes;
- many popups can be open on one page;
- popups are "opaque" to presses. A popup cannot pass user presses through to items on a page or popup on the layer below;
- popups can be combined into "mutually exclusive" popup groups: opening a popup in a group automatically closes the currently open popup in that same group;
- The "Hide popup group" command closes any open popup belonging to the group.
Creating a page or popup window
The tools for creating pages and popups are in the upper-left corner of the panel labeled PROJECT:

- Create a page. Settings:
- Page name - the page name,
- Orientation - landscape or portrait on the phone/tablet (select landscape for a PC),
- Create a popup window . Settings:
- Popup name - the popup name,
- Left, Top - position on the page: X (Left) and Y (Top) offsets from the page's top-left corner,
- Width, Height - the popup's width and height,
- Draw - draw the popup on the page with the cursor to define its size and position visually.
General page and popup settings (General)
General page and popup window settings are available on the General tab of the Project window:

Page settings:
- Name - the page name,
- Orientation - page orientation (landscape or portrait),
- Alternate View - the page with the opposite orientation that automatically replaces the current page when the panel rotates (if the panel has an orientation sensor). For configuration details, see Automatic page rotation.
Popup window settings:
- Name - the popup window name,
- X/Y - popup position on the page along X and Y,
- Width / Height - popup width / height,
- Lifetime - the time (ms) for which the popup is displayed on the page,
- Drag - enable moving the popup on the page,
- Modal - block presses on items outside the popup,
- Top - redraw the popup above all other windows,
- Show Effect - create / add an effect for the popup's appearance,
- Hide Effect - create / add an effect for hiding the popup.
- For more information on effects when popups appear and hide, see here.
Interface organization
Ways to organize the interface:
-
One page and popup windows The most common development approach. The page is a "base" containing the background image and objects visible almost all the time (project name, equipment connection status, date/time, and so on). All controls are placed in windows that replace one another as needed. Popup-based navigation makes interface behavior predictable and supports transparency and show/hide animation;
-
Several pages and popup windows The only difference from the previous option is that an additional page can serve as a screensaver or menu. Returning from it automatically restores all previously open popups. Use Show previous page for this;
-
*Pages only An interface without popups can take advantage of automatic page rotation: switching between portrait and landscape when the device running i3 pro rotates. In practice, this is very rarely used because it requires duplicating items that appear on many pages, greatly increasing the cost of changes.
Using the free interface "iOS стиль: Умный дом" (iOS style: Smart Home; iridi.com > support > downloads > interfaces > iOS стиль: Умный дом) as an example, the structure can look like this:

- The interface's only page. Popups open above it;
- Popup windows forming the project navigation menu. They contain buttons that execute commands to open and close popups;
- Popups containing equipment controls (activities). They are organized into folders by room.
Project start page
When an iRidi project starts, only 1 page and any number of popup windows open.
Select the start page in Project settings, on Start:

- Start page - the name of the page to open when the iRidi project starts (only one);
- Popups on the start page - the list of popups to open when the project starts. They open in order.
Switching between pages and popups
Any graphic item that processes presses can switch pages and control popups. Button, and sometimes Trigger Button, are most often used for interface navigation.
Pages and popups are controlled using navigation commands (Actions), which must be added to Press or Release in the graphic item's PROGRAMMING panel:

Commands for interface navigation:
- Show page [page name] - show a page in place of the current one. All popups close;
- Show previous page - show the previous page. Any popups that were open on it are restored with the page;
- Show popup [popup name] - show a popup. Specify Top and Left coordinates for where it will appear, or leave them empty to use its original coordinates;
- Hide popup [popup name] - hide a popup;
- Toggle popup [popup name] - toggle a popup (show it if hidden, hide it if shown). The command parameters specify the popup name. Specify Top and Left coordinates for where it will appear, or leave them empty to use its original coordinates;
- Hide popup group [group name] - hide an open popup belonging to the group;
- Hide popups on page [page name] - hide all popups on the specified page;
- Hide all popups - hide all popups open in the project. If Show previous page is used afterward, popups on the restored page will not reopen! Consider this when organizing the interface.
Automatic page rotation
When creating pages, you can select a page with the opposite orientation for automatic project rotation.

- Name - the page name,
- Orientation - page orientation (landscape or portrait),
- Alternate View - the page with the opposite orientation that automatically replaces the current page when the panel rotates (if the panel has an orientation sensor).
A design with automatic rotation must consist of pages only. This recommendation is due to all open popups closing during automatic rotation. To open the required popups when rotation occurs, use JavaScript API.
Previewing a popup on a page
Previewing a popup on a page shows the final popup positions on the selected page and lets you align them relative to page items.
Configure popup preview on PROJECT or by right-clicking an open area of the page or popup:

Select the popups to display on the page for preview:
Popup Group
In the page tree, create folders (Folders) to group pages and popups. This does not affect project operation. You can also create popup groups (Popup Group) by right-clicking the project or a popup.
Popup Group is a set of popups that must never be open simultaneously. Popups added to one group become mutually exclusive. If a popup in the group is already open, opening another closes it automatically.
Popup groups simplify project navigation. You do not need to ensure that unwanted popups have been closed because they close automatically.

- Popups can be moved between groups. To move several popups together, select them using Ctrl + left-click or Shift + left-click, then drag them to the required folder.
The Hide popup group command hides any open popup in the group:

- A popup group can be hidden using a script command: IR.HideGroup("Group")
Project screensaver
A screensaver is a page that appears on the control panel screen after the specified period of panel inactivity. A password-processing script, page animation, and other features can also be assigned to the screensaver page.
Using a dark background for the screensaver page extends the life of the control panel display.
-
Create a screensaver page.
-
Configure a "back" button to return to the project using "Show previous page":

- Select the project's screensaver page in Project settings.

Settings:
- Show screensaver - enable the screensaver;
- Delay - the time in seconds after which the screensaver activates if the project is left untouched;
- Show page - the screensaver opens the specified page;
- Landscape screensaver - select a landscape page for the screensaver;
- Portrait screensaver - select a portrait page for the screensaver;
- Start script - run a script function when the screensaver activates.
- A script can be configured to trigger when the screensaver appears. For example, reduce the device display brightness using IR.SetVariable.