Listbox and Grid System Popup Menu
From PxPlus
As of Version 10 you can add a system popup menu to any grid or listbox, with the exception of treeviews.
The system popup menu consists of extraction, search and print options, such as:
- Copy Column
- Copy Selected Record
- Copy All Records
- Export All Records to File
- Find...
- Find Next
- Find Previous
Copy options place data on the Windows clipboard. Available copy options are dependent on listbox type and, in iNomads, on browser type (IE only).
Export file formats include comma-separated (.csv), symbolic link (.slk), Microsoft 2003 XML (.xml) and tab delimited (.txt, *.*)
Find options allow you to search the contents of the listbox for occurences of a specified string.
Print outputs a formatted version of the listbox contents to the viewer in Nomads, or a PDF file in iNomads.
System popup menus can be added to all listboxes and grids by setting the global variable %LIST_POPUP to non-zero. You can also add or remove the system popup from individual listboxes and grids by setting the System Popup option in the listbox or grid Popup Menu definition to on or off. This setting overrides the %LIST_POPUP setting, unless the Default setting is selected. If a listbox 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 to access the additional options. To change the text of the menu group, load the desired menu text into the %LIST_POPUP$ variable.
Note: The popup menu associated with the grid in general is affected, not cell-level popup menus.
If you wish to suppress options displayed in the popup menu, you can set the %LIST_POPUP_SUPPRESS_OPTIONS$ global variable to indicate which options are to be suppressed. Any combination of "C", "E", "F", and/or "P" will cause the Copy, Export, Find and/or Print items, respectively, to be suppressed. For 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 listbox and grid system popup menus for the session.
If you wish to use the Export All Records to File feature without using the system popup menu, you can invoke the feature as follows:
CALL "*plus/winutl/listpopup;Export_to_File",ctl_no,exportfile$ Where: ctl_no - CTL value of the listbox or grid exportfile$ - path of the resulting file. The file extension will indicate the type of export (.txt or none = tab-separated file, .csv = comma separated, .slk = Symbolic link, .xml = Microsoft 2003 XML)
