# Defining Custom Information

> Source: https://manual.pvxplus.com/nomads-graphical-application/customizer/defining-custom-information

Customized information can be set up and invoked by the developer (see **[Design-Stage Definition](https://manual.pvxplus.com/nomads-graphical-application/customizer/defining-custom-information#designstagedef)**) or by the end user at run time (see **[Run-Time Definition](https://manual.pvxplus.com/nomads-graphical-application/customizer/defining-custom-information#runtimedef)**).

## Design-Stage Definition

**[Customizer General Maintenance](https://manual.pvxplus.com/nomads-graphical-application/customizer/working-with-custom-information#custom_gen_maint)** can be launched directly from within the PxPlus development environment, allowing the developer to select a *library* and *panel* to modify using the Customizer.

If **[NOMADS Security Classifications](https://manual.pvxplus.com/nomads-graphical-application/system-maintenance-tools/security-manager/defining-classifications)** are set up on the system, then **Customizer General Maintenance** is restricted to users with ADMIN or CUSTOMIZER classifications. See **[Security Considerations](https://manual.pvxplus.com/nomads-graphical-application/customizer/security-considerations)**.

In NOMADS **[Library Object Selection](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/library-object-selection/overview)**, select *Utilities* > *Customize Panel* from the menu bar or right-click on a selected panel object. The *Utilities* menu also has a *Create/Remove Customizer Library* option that will create the Customizer Definition file for the current library. While the file can also be created at run time when required, pre-creating the definition file will automatically make the Customizer feature available to any panel in the library at run time through the panel popup menu.

*(The Create/Remove Customizer Library option was added in PxPlus 2017.)*

To launch this window from the PxPlus Command line, use the following syntax:

**customize** \[*libpath*| c*hannel*\[,*panel*\]\]

***Where:***

|  |  |  |
| --- | --- | --- |
|  | *libpath* | Path of panel library |
|  | *channel* | Open channel to the panel library |
|  | *panel* | Name of panel to customize (separated by a *comma* or *semi-colon*) |

***Example:***

|  |  |  |
| --- | --- | --- |
|  | customize | *(Does not include preset library and panel)* |
|  | customize c:/sample/sample.en | *(Includes library)* |
|  | customize c:/sample/sample.en;TestPanel | *(Includes library and panel)* |
|  | customize ? | *(Invokes Help)* |

## Run-Time Definition

The Customizer can also be set up and invoked by the end user at run time, enabling your panels to be customizable based on user preferences.

Two methods are provided to make the Customizer available:

|  |  |  |
| --- | --- | --- |
|  | **[Invoking the Customizer Using CTLs](https://manual.pvxplus.com/nomads-graphical-application/customizer/defining-custom-information#usingctls)** | This method involves setting up special CTL values to enable this functionality in your application. |
|  | **[Invoking the Customizer Using Panel Popup Menu](https://manual.pvxplus.com/nomads-graphical-application/customizer/defining-custom-information#usingpopup)** | This method involves enabling the *Customize Panel* option on panel popup menus. |

Note:  
The Run-Time Definition in iNomads is restricted to users who have logged into the [NOMADS Security](https://manual.pvxplus.com/nomads-graphical-application/system-maintenance-tools/security-manager/overview) system.

***Invoking the Customizer Using CTL**s***

For access to the definition specific to the ***currently open*** panel, generate a CTL value of **9999**. A CTL of **9996** can also be used to invoke **Customizer General Maintenance**, which will allow users to modify the definition for *any* panel to which they have access. The NOMADS and iNomads engines (**\*winproc** and **in_proc**) intercept both of these values to invoke the appropriate definition interface.

A CTL value may be generated by assigning a value to a function key.

***Example:***

The following code, added to the START_UP program, would invoke a definition for the current panel when the **F12** key is pressed:

```
defctl (0) $00007B$=9999
```

Look up the actual value for **F12** in the *Keyboard Configuration Utility* (\*UCK).

Another way to generate CTL values is to add entries to the system menu that will appear when clicking the icon in the upper left corner of the window. This menu is updated by adding items under the **\[Config\]** section of the INI file, using the name **SysMenu***n* for each menu entry (where *n* is a number from 1 to 10). See **[INI Contents](https://manual.pvxplus.com/pxplus-installation-and-configuration/customizing-pxplus/ini-contents#Mark5)** for information on **SysMenu**.

***Example:***

```
[Config]
SysMenu1=&Customizer=9999
SysMenu2=Customizer&General Maintenance=9996
```

You can also add items to the system menu programmatically using the **['OPTION( )](https://manual.pvxplus.com/mnemonics/option)** mnemonic.

```
print 'OPTION'("SysMenu1","&Customizer=9999")
```

Using methods such as these, you can control which users are able to generate 9999 and 9996 CTL values and thereby who has access to the definitions for customizing information on their panels.

If your application happens to use these CTL values for other purposes, you can change the CTL values by setting the **[%NOMADS'Custom_Define](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#customdef)** property *(Customize Panel)* and **[%NOMADS'Custom_Genmtc](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#customgenmtc)** property *(Customizer General Maintenance CTL)* to alternate values.

***Invoking the Customizer Using Panel Popup Menu***

Alternately, this functionality is available via the panel popup menu. If set up, this allows the user to customize a panel by right clicking on a spot where there are no controls, which invokes the panel popup menu where a *Customize Panel* option is available.

To set up this feature, two methods are available:

***Method 1:***

The **[%NOMADS'Enable_Customizer_Popup](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#enablecustpopup)** property can be set to non-zero to enable the *Customize Panel* option on the panel popup ***system wide***. For example, this can be done in the START_UP program.

***Method 2:***

Panels in individual panel libraries can also access the *Customize Panel* option in the panel popup menu. You can use the *Create/Remove Customizer Library* option on the *Utilities* menu of the **Library Object Selection** window at design time to create a Customizer Definition file for a particular panel library. At run time, all panels in a panel library that has an associated Customizer Definition file will have access to the Customizer.

*(Support for using the panel popup menu was added in PxPlus 2017.)*

## Restricting Access to the Run-Time Definition

If you want to create customized panels for your users but deny them access to the Customizer Definition feature, you can set the **[%NOMADS'No_Customize](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#nocustomize)** property to non-zero. This suppresses the *Customize Panel* option on the panel popup menu that would normally be available when a Customizer Definition file is detected. It also suppresses access to customize the panel when the special Customizer CTL value is generated. However, if the **[%NOMADS'Enable_Customizer_Popup](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#enablecustpopup)** property is set, this will ***override*** the **%NOMADS'No_Customize** setting and it will have no effect.

In an iNomads environment, the run-time Customizer definition is restricted to those signed into the **[NOMADS Security](https://manual.pvxplus.com/nomads-graphical-application/system-maintenance-tools/security-manager/overview)** system, regardless of any other settings.

If you want to deny access to the Customizer Definition feature for certain users and/or specific panels at run time, you can supply your own callable program to determine whether the current panel should be available to or excluded from customization. The program will be called when a panel is invoked to determine whether to suppress access to customize the current panel through the popup menu or by generating the customizer CTL value.

The called program must accept three arguments:

- Path of the current library ***(Read Only)***
- Panel name (uppercase, padded to 12 characters) ***(Read Only)***
- Exclude flag (numeric, 0 = Allow customization, 1 = Exclude panel from customization) ***(Write Only)***

Load the name of the program into the **[%NOMADS'Custom_Exclude_Program$](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#customexclude)** property to activate it. When the third argument returns with a non-zero value, the panel is excluded from customization.

***Sample Program:***

```
! exclude_cst.pgm - Exclude Tom, John and Harry from customizing THISPANEL and THATPANEL
     enter library$,panel$,exclude
     ExcludeUsers$=",Tom,John,Harry,"
     ExcludePanels$="THISPANEL   THATPANEL   "
     exclude=0
     if dec(mid(mse,22,1))>0 \
          then call "[wdx]*windx.utl;get_val","WHO",CurrentUser$ \
          else CurrentUser$=who
     if pos(","+CurrentUser$+","=ExcludeUsers$) and pos(panel$=ExcludePanels$,12) \
          then exclude=1
     exit
```

To activate the program, set **%NOMADS'Custom_Exclude_Program$**="exclude_cst.pgm".

Note:  
The above methods restrict access to the addition/modification of *custom definitions only*. It does *not* affect displaying data for existing custom definitions.

*(The ability to exclude panels from customization was added in PxPlus 2018.)*
