Release 10.1A: OpenEdge Reporting:
Query/Results Administration and Development

> ## Menu Editor

> Results provides a dynamic menu editor that you can use to customize user access to Results and programmer-defined features. Once you define a feature, you can add it to an existing menu.

> Note: You cannot add a menu to the Results menu system; you can only add a menu option to an existing menu. You cannot delete a main menu (for example, Query or Help).

> | To access the Menu Editor, choose Query Customize Menu Layout. The Menu Layout dialog box appears:

> The Menu Layout dialog box contains the following user-interface elements:

> Features

> Lists all the features in Results. When you select a feature, the menu and menu option lists scroll to display an associated menu option and/or menu. If the feature is not in the menu system, you can specify a new label for the feature and add it to the selected menu in the menu list. The first entry in the features list is a horizontal rule that you can add to a menu as a separator.

> Menus

> Lists the menus available in the Results menu system. When you select a menu, the menu options of the selected menu appear in the menu option list. You can then select and add a feature to the menu or select and remove a menu option from the selected menu.

> Menu items

> Lists the menu options available on the selected menu in the menu list. Once you select a menu option, you can use the Remove button to remove it from the selected menu. You can also modify the menu item label.

> Menu edit buttons

> Allow you to do the following:

> - Add — Adds a new menu option to the selected menu in the menu list using the feature selected in the features list.
> - Remove — Deletes the selected menu option from the selected menu in the menu list.

> The following section describes how to define menus and implement menu management strategies in Results.

> ##### Menu management

> Results automatically manages the display state of default menu options and menus in the menu system. In general, there are some default menus and menu options that are sensitive, or available, only when there is an active query in Results. These menus and menu options become insensitive, or unavailable, when the user closes the active query. For example, the Table menu is sensitive only when there is an active query. And while the Query menu is always active by default, there are some menu options on this menu (for example, Save) that are sensitive only when there is an active query.

> An understanding of this default menu management behavior in Results is crucial when adding menu options. Before adding menu options to Results, assess the menu management behavior and plan any additions based upon when you want users to access the new menu elements. For example, to add a menu option that is always available to a user, add the menu option to the Query menu.

> By default, all menu elements that you add to the menu system are sensitive. You can override the default menu management behavior and also manage the sensitivity of additions to the Results menu system using the Menu Item Override integration point. A Progress 4GL procedure attached to this integration point executes once after the execution of any feature in Results. The `u-mcheck.p` procedure located in the `aderes` product directory is the example code template for this integration point:

> Example 3–1 shows this example code template.

> Example 3–1: u-mcheck.p example code template
>     /* Instructional Comments */

>       DEFINE INPUT         PARAMETER featureList       AS CHARACTER NO-UNDO.
>       DEFINE INPUT-OUTPUT  PARAMETER sensitivityList   AS CHARACTER NO-UNDO.
>       DEFINE INPUT-OUTPUT  PARAMETER checkList         AS CHARACTER NO-UNDO.

>     /* Your Code Here */

>       RETURN. /* Required last line */

> ##### Menu Item Override integration point parameters

> The following list describes the parameters required by a procedure associated with the Menu Item Override integration point. These parameters provide information about all menu options and menus in the Results menu system and buttons on the Results toolbar:

> `featureList`

> This input parameter is a comma-separated list of feature names associated with menu options in the Results menu system and buttons on the Results toolbar.

> `sensitivityList`

> This input-output parameter is a comma-separated list of `TRUE` or `FALSE` values. Each entry in this list represents the current `SENSITIVE` attribute setting for a menu option or button associated with a feature listed in the featureList parameter. The order of the sensitivity settings in sensitivityList parameter corresponds to the order of features listed in the featureList parameter. You can set the state of the `SENSITIVE` attribute for a menu option or button in the integration procedure.

> checkList

> This input-output parameter is a comma-separated list of `TRUE` or `FALSE` values. Each entry in this list represents the current `CHECKED` attribute setting for a menu option associated with a feature listed in the featureList parameter. The order of the `CHECKED` settings in checkList parameter corresponds to the order of features listed in the featureList parameter. If the current menu option widget is a toggle menu option, you can set the `CHECKED` attribute of the widget in the integration procedure.

> Consider the following code example that appears in Example 3–2.

> Example 3–2: u-mcheck.p code example
>     /* Example u-mcheck.p */

>       {aderes/u-pvars.i}

>       DEFINE INPUT         PARAMETER featureList       AS CHARACTER NO-UNDO.
>       DEFINE INPUT-OUTPUT  PARAMETER sensitivityList   AS LOGICAL   NO-UNDO.
>       DEFINE INPUT-OUTPUT  PARAMETER checkList         AS LOGICAL   NO-UNDO.

>       DEFINE VARIABLE i AS INTEGER NO-UNDO.

>       DO i = 1 TO NUM-ENTRIES(featureList):
>         IF ENTRY(i, featureList) = "myItem" AND qbf-module = "r" THEN
>           ENTRY(i, sensitivityList) = FALSE.
>       END.

>       RETURN. /* Required last line */

> This example procedure checks the featureList for a feature name. If the feature name exists in the featureList and the current view in Results is the report view, the sensitivityList setting for the feature is `FALSE`. The "Results application programming interface (API)" section provides more information about the `qbf–module` variable and the `u-pvars.i` include file. For more information about the `ENTRY` statement, `RETURN` statement, `CHECKED` attribute, and `SENSITIVE` attribute, see the OpenEdge Development: Progress 4GL Reference .

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095