List Box and Grid System Popup Menu |
|
A system popup menu consisting of the following extraction, search and print options can be added to any Grid or List Box (except Tree Views):
Copy Column
Copy Selected Record(s)
Copy All Records
Export All Records to File
Export All Records to Spreadsheet (MS Excel 2003 or later)
Find...
Find Next
Find Previous
Goto …
Define a chart
Display chart
Advanced Print
(The List Box and Grid system popup menu was added in PxPlus v10.)
(The AutoChart functionality was added to the system popup menu in PxPlus v11.00.)
(The Export to Spreadsheet option was added to the system popup menu in PxPlus 2014.)
(The Advanced Print option was added to the system popup menu in PxPlus 2021 Update 1.)
The functionality associated with these options is summarized below:
Copy |
These options place data on the Windows Clipboard. Available Copy options are dependent on the List Box type and, in iNomads, on browser type (IE only). | ||||||||||||
Export to File |
These formats include comma-separated (.csv), symbolic link (.slk), Microsoft 2003 XML (.xml) and tab delimited (.txt, *.*). | ||||||||||||
Export to Spreadsheet |
This option creates an .xml file and opens it with the default spreadsheet application. | ||||||||||||
Find |
These options are used to search the contents of the List Box for occurrences of a specified string. | ||||||||||||
Goto |
This option is used to go to a specific item. | ||||||||||||
Define a chart |
This option invokes the Chart Wizard that is used to define a NOMADS AutoChart for the list. | ||||||||||||
Display chart |
This option shows the AutoCharts that have been defined. | ||||||||||||
This option outputs a formatted version of the List Box contents to the viewer in NOMADS or a PDF file in iNomads. | |||||||||||||
Advanced Print |
This option invokes the Advanced Print Options window used for customizing the report by changing the main title or adding a sub-heading containing selected information from the current panel.
This window consists of the following:
|
Adding/Removing the System Popup Menu
System popup menus can be added to all List Boxes and Grids by setting the global variable %LIST_POPUP to non-zero.
The system popup can also be added or removed from individual List Boxes and Grids. This is done by first selecting the Popup Menu button in the List Box or Grid definition and then setting the System Popup option to On or Off. This setting overrides the %LIST_POPUP setting unless the Default setting is selected.
If a List Box or Grid already has a popup menu assigned to it, a new menu group, List Options..., is added to the bottom of the existing popup menu for accessing the additional options.
Modifying the System Popup Menu
To change the text of the menu group, load the desired menu text into the %LIST_POPUP$ variable. Since the text will become a popup menu item, an & (ampersand) character may be used to indicate the hot key associated with the item.
Example:
S&ystem Items ...
If no & (ampersand) is included in the text, it will be assumed to be at the beginning of the text entered; therefore, the first character will be used as the hot key.
To suppress options displayed in the popup menu, set the %LIST_POPUP_SUPPRESS_OPTIONS$ global variable to indicate which options are to be suppressed. Any combination of "C", "E", "F", "G", "L", and/or "P" will cause the Copy, Export, Find, Chart, Goto and/or Print items respectively to be suppressed.
Example:
%LIST_POPUP_SUPPRESS_OPTIONS$="CE" will cause the Copy and Export items to be suppressed, while the Find and Print items remain available. This setting will apply to all List Box and Grid system popup menus for the session.
To attach the popup menu to an event other than the right-click popup event of the List/Grid control (such as a button click), invoke the menu as follows:
! Set the Popup_Ctlval variable to the CTL value of the associated List/Grid control
Popup_Ctlval =ctl_val
Popup_Select =0
! Then perform the following program:
PERFORM "*plus/winutl/listpopup;Popup_Menu"
The items displayed in the popup will be dependent on the value in %LIST_POPUP_SUPPRESS_OPTIONS$.
To use any of the individual popup features without using the system popup menu, invoke the feature as follows:
Popup_Ctlval=ctl_val
Popup_Select=option
PERFORM "*plus/winutl/listpopup;Popup_Menu
Where:
Options for Popup_Select are:
|
1 |
Copy row to Clipboard |
|
2 |
Copy all to Clipboard |
|
3 |
Export all to file (Prompts for file name) |
|
4 |
|
|
5,6,7 |
Find, Find Next, Find Previous |
|
8 |
Define Chart |
|
9 |
Display Chart |
|
11 |
Export All to Spreadsheet |
To invoke the Export All Records to File feature with a file name:
CALL "*plus/winutl/listpopup;Export_to_File",ctl_no,exportfile$
Where:
|
ctl_no |
CTL value of the List Box or Grid | ||||||||
|
exportfile$ |
Path of the resulting file. The file extension will indicate the type of export:
|