# Creating Panel Controls

Embedded Panels |

The NOMADS Embedded Panel feature allows the contents of a different panel to be placed at a location within the current panel. A source panel object would typically contain a common set of controls that are intended for reuse to be embedded in other panels throughout the application.

For example, you may have a common format for a set of First, Prior, Next and Last navigation buttons. Rather than recreating these controls on multiple panels, you can create them once in one panel, and then embed the contents of that panel into all the panels that need them. The main advantage to this functionality is that you only need to edit the source panel to have the changes occur wherever those controls are embedded.

At run time, all the controls in the source panel will appear in the current active panel. The embedded panel can contain any of the control types (Button, Multi-Line, Drop Box, etc.) available in the Panel Designer (see Creating Panel Controls), as well as User-Defined CTLS. Embedded panels can be moved around in the container panel but cannot be resized. Multiple embedded panels can be assigned to a panel.

As of PxPlus 2018, you can control the Tab Order and Dependency Definition for the embedded panel in the container panel.

The header logic events (Pre-Display, Post-Display, On-Exit), along with the default program assignment on the embedded panel, can be carried forward to the container panel. The default program in the container panel is used only if one does not exist in the embedded panel. The order of execution for panel header logic events is determined by options in the embedded panel's definition.

#### Note:
Drag and Drop Utility definitions are not carried forward to the container panel.

(Support for User-defined CTLS in embedded panels to carry forward to the container panel was added in PxPlus 2018.)

## Assigning Embedded Controls

To insert embedded controls within the current (container) panel, select the Embed Panel control tool from the Controls Toolbar. Hold down the left mouse button and drag the mouse to create a rectangle to the desired area. Release the mouse button to create the new embedded panel location. Define the specific attributes for the embedded panel. See Embedded Panel Properties.

Once the Panel is Selected

A frame containing the name of the embedded panel will be drawn to indicate where the inherited controls will appear at run time. The frame size will be based on the top left control and the bottom right control of the embedded panel. A message will be displayed if inherited controls cannot fit in the designated region.

#### Note:
Controls with duplicate names are not drawn. A warning message is displayed if there are duplicate control names. No warning message is displayed if the embedded panel does not exist.

## Embedded Panel Properties

When creating or editing an Embedded Panel control, the Embedded Panel Properties dialogue is displayed:

This dialogue is used for viewing and/or changing embedded panel properties:

Library | Embedded library path. Click the drop-down arrow for a list (up to nine) of previous selections. Click the Browse button to look through the directory structure to find the library or type the library path. An expression can also be entered by preceding the expression with an = (equals sign); e.g. =libname$ or ="mylib.en". #### Note: The Library name may be a specific or generic reference. See Cascading Language Suffixes. (Support for entering an expression for a Library name was added in PxPlus 2019.)
Panel | Embedded panel name. Click the drop-down arrow for a list of panels in the selected library.
(Display Embedded Panel in NOMADS) | (Available when a Panel is selected) Button (located next to the Panel drop box) that is used to display the selected panel in the NOMADS Panel Designer where changes can be made if needed and saved. Upon returning to the Embedded Panel Properties dialogue, use the Refresh button to refresh the list of controls on the embedded panel. (The Display Embedded Panel in NOMADS button was added in PxPlus 2021.)
Pre-Display | Determines when the Panel Header Pre-Display logic will execute. Click the drop-down arrow for a list of execute options: When the embedded panel is detected (Default) Ignore
Post-Display | Determines when the Panel Header Post-Display logic will execute. Click the drop-down arrow for a list of execute options: After the embedded controls are drawn (Default) Prior to the main panel logic After the main panel logic Ignore
On-Exit | Determines when the Panel Header On-Exit logic will execute. Click the drop-down arrow for a list of execute options: Prior to main panel logic (Default) After the main panel logic Ignore
Position |
Column | Starting column for the top left corner of the control - numeric expression. Format mask is ##0.00. Valid entries are 0 to 620.
Line | Starting line for the top left corner of the control - numeric expression. Format mask is ##0.00. Valid entries are 0 to 255.
(The capability to specify Column and Line coordinates was added in PxPlus 2016.) (Support for increased Column and Line maximums was added in PxPlus 2021.)
Attributes |
Stretchable | Allows the embedded panel to resize itself automatically to adapt to the width or height of the main window or dialogue into which it is inserted. (Default: Off) #### Important Note: When a control is placed within a certain distance from the horizontal and/or vertical edge of an embedded panel that is flagged as Stretchable, the control will be automatically stretched to the horizontal and/or vertical edge of the main window or dialogue into which the embedded panel is inserted. For desired results, allow additional space between the control and the outer edges of the embedded panel, as any extra blank space will be ignored when the embedded panel is inserted into the main window or dialogue.
Controls on Embedded Panel | (Display Only) Displays information about the controls on the embedded panel. (The Controls on Embedded Panel list box was added in PxPlus 2018.)
(Refresh) | Button that is used to refresh the list of controls on the embedded panel. (The Refresh button was added in PxPlus 2021.)
Notes | Button that is used to add (or edit) notes/comments for the embedded panel. Maximum 1024 characters. (The Notes button was added in PxPlus 2023.)