# Creating Panel Controls

External Controls - *Browser, ActiveX (COM), PVX Plus, .NET |

The PxPlus External Control Properties dialogue allows you to integrate external components produced by third-party vendors into your MS Windows-based PxPlus application (e.g. progress bar, spreadsheet, browser or calendar). This dialogue is used to obtain information about, as well as access to, the internal properties and methods of the external control being used.

This table lists the types of external controls that can be created:

Chromium Browser | The Chromium Browser Object allows you to embed a Chromium Browser into PxPlus windows. This object can be used to display a Web page, execute JavaScript, and subscribe to browser events. The Chromium Browser was developed as an alternative to the Microsoft Web Browser (Shell Explorer). #### Important Note: For security purposes, Google prevents embedded browsers from being able to sign into Google accounts to combat a form of phishing known as "man in the middle" (MITM), which can be done through embedded browsers to steal users' information. This Google decision affects both the PxPlus *BROWSER embedded Chromium Browser object/control and the Shell.Explorer embedded browser COM control. See *BROWSER Chromium Browser Object for more information. (The Chromium Browser Object was added in PxPlus 2017.)
ActiveX Controls | ActiveX controls are specific components that provide applet-like functionality for Web pages. These controls can be accessed and executed via Web browsers and other applications over the Internet. However, ActiveX offers little cross-platform support, compared to Java, and is limited to software based on Microsoft's Component Object Model (COM).
PVX Plus Controls | The types of PVX Plus external controls that can be created are Ace Editor Control, Google Maps Control, Signature Capture Control and TinyMCE® Editor Control.
.NET Controls | The .NET Interface allows .NET objects to be added to applications and used like any PxPlus object. #### Important Note: All formats are Windows only, and you must have installed Windows Desktop Runtime 8. If using 64-bit PxPlus, you must have the x64 Runtime installed. If using 32-bit PxPlus, you must have the x86 Runtime installed. The .NET interface can be used when running under WindX, in which case, Windows Desktop Runtime 8 must be installed on client machines. The following How To Tutorials provide detailed steps on how to create .NET Button and .NET Calendar controls and add a .NET Calendar query button to a NOMADS Multi-Line control: How to Create a .NET Button (NOMADS) How to Create a .NET Calendar Control (NOMADS) How to Display a Date in a PxPlus Multi-Line from a NOMADS .NET Calendar (The .NET interface was added in PxPlus 2025.)

To add an external control to a NOMADS panel, see Adding an External Control.

To define an external control once it has been added to a panel, see Defining an External Control.

For information on handling events for an external control, see Handling Events.

## Adding an External Control

To add an external control to your panel, select the External Control button from the Controls Toolbar in the Panel Designer. Hold down the left mouse button and drag the mouse to create a rectangle to the desired size. Release the mouse button to create the new object. Select the type of external control you want to create and define its properties.

For making other adjustments, see Modifying Objects.

## External Control Properties

When creating or editing an external control, the External Control Properties dialogue is displayed:

This dialogue is divided into the following tabbed panels for viewing and/or changing external control properties: Display, Properties and Logic. The control properties that display depend on the type of external control being created.

Object Name | Enter a unique name for the external control. NOMADS provides a default; e.g. EXT_1. Naming conventions for variables apply. When a new control name is entered, it will be checked against the Reserved Words list to determine if it is restricted for use as a NOMADS control name. If it is found, a warning message will display. (User Reserved Words Maintenance was added in PxPlus 2020.)
Ext. Control | Click the Query button to select the type of external control to create:
Chromium Browser | Used for adding a Chromium Browser control to the current NOMADS panel.
ActiveX Controls | Launches a separate ActiveX Controls dialogue with a list of ActiveX controls registered on the system. Highlighting an ActiveX control also displays the Programmatic ID for that control. If you already know the Programmatic ID of a control, you can enter it in the Ext. Control field instead of selecting from the list (some controls may not be listed). For a description of ActiveX controls, see Concepts and Terminology.
PVX Plus Controls | Launches a separate PVX Plus Controls dialogue. Select from the list of available PVX Plus external controls: Ace Editor Control, Google Maps Control, Signature Capture Control and TinyMCE® Editor Control.
.NET Controls | Used for adding a .NET control to the current NOMADS panel. When selected, additional fields display for specifying a .NET DLL Name, Object Name and any optional Arguments. The following How To Tutorials provide detailed steps on how to create .NET Button and .NET Calendar controls and add a .NET Calendar query button to a NOMADS Multi-Line control: How to Create a .NET Button (NOMADS) How to Create a .NET Calendar Control (NOMADS) How to Display a Date in a PxPlus Multi-Line from a NOMADS .NET Calendar
See Defining an External Control. (The Chromium Browser Object was added in PxPlus 2017.) (Support for .NET controls was added in PxPlus 2025.)
Alternate control names to load at runtime if primary not found | (Applicable only for ActiveX Controls) Assign alternate control names (separated by semi-colons) to be used at runtime if the generic name cannot be found. This field is shown only when creating ActiveX controls; otherwise, it is hidden.
Browse System DLLs | (Applicable only for .NET Controls) This button simplifies the input of a Windows system DLL and its associated object. This button is enabled only when: The DLL Name drop box is set to Fixed, and No DLL Name has been entered. Clicking this button displays a list of available Windows system DLLs. After a DLL is selected, a second list displays the objects in that DLL. Selecting an object automatically populates both the DLL Name and Object Name fields. (The Browse System DLLs button was added in PxPlus 2026.)
DLL Name | (Applicable only for .NET Controls) Enter the .NET DLL name. Can be a Fixed value or an Expression. This field is shown only when creating .NET controls; otherwise, it is hidden. Click the Browse button (folder icon) to select a fixed value for the .NET DLL file location. If the DLL name or file location has been defined as a global variable or defined in such a way that its value can be evaluated now (when the .NET control is being created, as well as at run time), change the drop box from Fixed to Expression and then enter the expression. (The DLL Name field was added in PxPlus 2025.) (The ability to define the DLL Name as an expression was added in PxPlus 2026.)
Object Name | (Applicable only for .NET Controls) Enter the .NET object name. This field is shown only when creating .NET controls; otherwise, it is hidden. Clicking the Query button in the Object Name field displays a list of all objects in the DLL (if a DLL Name has been entered). #### Important Note: The object name is case sensitive, as .NET objects are case sensitive. Example: "System.Windows.Forms.MonthCalendar" (The Object Name field was added in PxPlus 2025.)
Arguments | (Applicable only for .NET Controls) Enter any optional arguments to be used by the .NET control. This field is shown only when creating .NET controls; otherwise, it is hidden. These arguments can be either a PxPlus numeric or string variable or a numeric or string literal. String literals must be quoted. Multiple numeric or string arguments can be specified and must be separated by commas. Example: mystr$,42,"A String",mynum This example shows four comma-separated arguments: the mystr$ string variable, the number 42, the string "A String", and the contents of the mynum numeric variable. (The Arguments field was added in PxPlus 2025.)
Display
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.
(Support for increased Column and Line maximums was added in PxPlus 2021.)
Size |
Width | Width of the control in number of columns - numeric expression. Format mask is #0.00. Valid entries are 0 to 620.
Height | Height of the control in number of lines - numeric expression. Format mask is #0.00. Valid entries are 0 to 255.
(Support for increased Width and Height maximums was added in PxPlus 2021.)
Properties
Objects | Assign property/method values (Fixed or Expression) and set up logic that will execute when an external control event is triggered. See Defining an External Control.
Logic
Default Program | Displays the name of the Default Program used in the Panel Header definition. (The Default Program was added for display in PxPlus 2019.)
Post Create | Logic to be processed after the external control is drawn. Click the drop-down arrow for a list of selections. See Events Logic. Click the Program Logic button beside the Perform or Call action to launch the default program editor, which is typically the *IT - Integrated Toolkit. To make Ed+ the default program editor, change the setting for the %NOMADS'Program_Editor property to Ed+. (The ability to set Ed+ as the default program editor was added in PxPlus 2023.)
Groups | Button used to assign the external control to a group. See Group Assignment.
Notes | Add notes/comments for the external control. Maximum 1024 characters. These notes also display in the Wiki Help documentation for the panel. See NOMADS Wiki Help. (The Notes button was added in PxPlus 2023.)

## Defining an External Control

After an external control is created on the panel (see Adding an External Control), the control's properties need to be defined.

This table lists the steps to define a new external control. (These steps are based on the Folder Style version of the NOMADS Panel Designer.)

Step | Description
1. Select an external control | In the External Control Properties dialogue, click the Query button for the Ext. Control property. Available selections are Chromium Browser, ActiveX Controls, PVX Plus Controls and .NET Controls.
2. Define Properties | Once the Ext. Control is selected, assign property/method values using the Properties tab. The Item grid lists all the sub-objects, properties and methods for the external control selected. This grid consists of the following:
Item | Contains the property or method name.
Type | Contains the details on each item; i.e. Num|Str, Num, Str, pNum|Str, pNum, Meth, Obj, pObj, pArray or Array (where "p" indicates a PxPlus property or object).
Current Value | Contains the current value for an item.
Value/Expression | If enabled, the Value/Expression column accepts either an expression or a value, depending on the Exp check box selection. PxPlus properties are prefixed with Pvx. Both properties and methods are sorted in alphabetical order and will later be set in alphabetical order. If the assigned value for a property is an expression, place a check mark in the Exp column for that property. The default is no check mark, indicating a literal value. Use the Value/Expression column to assign a value to the property. The value is assigned after the external control is created. If the property is Read Only, this cell will be locked. Methods are identified by "Meth" (in the Type column) and by empty brackets appended to their name; e.g. AboutBox( ). If the method accepts a string value as a single parameter, it may be defined in the Value/Expression column. Example: Ext. Control: *browser Item Value/Expression Navigate2( ) www.pvxplus.com Both properties and methods may also be defined in the Post Create logic (on the Logic tab). If an application needs access to methods that take no parameters, numeric parameters or more than one parameter, then it must be defined either in the Post Create logic or within the application itself. Example: Ext. Control: *browser Post Create Logic: Execute EXT_1.CTL'Navigate2("www.pvxplus.com")
3. Define Events | The Events grid contains all the events available for the external control. This grid consists of the following:
Event | Event names are obtained from the 'PVXEVENTS$ property (see Extended Properties and Methods) and are loaded into the Event column in alphabetical order.
Function | Describes how the event (if any) will execute. The following preset values are available in the drop-down list:
Ignore | No event occurs.
Link | Invoke a panel. Syntax: "object name","[ library ]"[, arg_1$ , arg_2$ ... arg_20$ ]
Perform | Perform a program with optional label entry point. (For proper syntax, see PERFORM directive.)
Call | Call a sub-program with optional label entry point. (For proper syntax, see CALL directive.)
Execute | Run a series of PxPlus commands separated by semi-colons.
Logic | Contains associated logic that will execute when an event signal is triggered. If the Function is a Perform or Call, you can click the magnifying glass button in the Logic cell to launch the Program Editor. If the program and label already exist for the event, then the Editor will be positioned to that label automatically. If the program label on an event does not exist, then NOMADS will generate a label automatically (eventname+"_"+control) and insert it in the program. The program will be created if it does not exist. See Events Logic.
4. Assign Post Create Logic | Add/edit Post Create logic using the Logic tab. Enter the program/entry point to be performed, called or executed after the external control is created. See Events Logic.

## Handling Events

It is strongly recommended that event functions be kept relatively short and simple. One reason for this is that normal code execution will be suspended when an event is handled and will not resume until the event function is finished. It is also possible to introduce code (or use commands, such as MSGBOX) to create a re-entrance issue in the event function.

How NOMADS Handles the Events

External controls generate a unique CTL value for each event defined in NOMADS. NOMADS reserves CTL values between 22001 and 22999. These are loaded into a table at run time after the external control is created using:

> ON EVENT "event_name" FROM EXT_id PREINPUT CTL_value

#### Note:
EXT_id is stored in control_name.ctl. When an event occurs, NOMADS will scan the event CTL table. If a match is found, then the logic for that event is executed.

Working with Events that Supply Parameters

Most of the time, it is sufficient to trap events through the external control interface. However, NOMADS does not normally receive the parameters that may be passed back (if the events are capable).

To receive event parameters from an external control, a PxPlus class must first be designed. A class function must be written for each event to be handled.

Example:

If you were writing an event class for the external object Shell.Explorer.2, you could receive parameters from the exposed event BEFORENAVIGATE2 (URL, [Flags], [TargetFrameName], [PostData], [Headers]) by defining a class as follows:

> def class "menuevent"
> property TXID$
> function BEFORENAVIGATE2(*)BEFORE for event "BeforeNavigate2"
> end def
> BEFORE:
> enter *,U$,*,*,*,*,C
> if mid(lcs(U$),1,3)="tx:" \
> then C=1;
> TXID$=U$(4) \
> else TXID$=""
> return 1

The function and label name are not required to match the name of the event. It is the string after the FOR EVENT portion of the statement that determines the event name that will be handled. The event name is not case sensitive, and argument names are not required to match the external control's event declaration. When the OOP method name matches the external control event name, then SAME can be used to describe the name of the event.

Once the class is complete, an instance of the class must be instantiated to bind the external object to the event handler. In NOMADS, this code should be invoked by the external object Post Create logic:

> create_object:
> EVNTOBJ=new("menuevent",EXPLORER.CTL,100)
> return

Once bound, the PxPlus event class function will be called when the corresponding event occurs.

## See Also

.NET Interface
DEF OBJECT Define Windows Object
How to Create a .NET Button (NOMADS)
How to Create a .NET Calendar Control (NOMADS)
How to Display a Date in a PxPlus Multi-Line from a NOMADS .NET Calendar

TinyMCE® is a registered trademark of Tiny Technologies Inc.