Menu Editor

Applies to HTML Viewer, IE Browser publications.

The menu editor allows you to add new menu items to the menu bar, the app menu button, the context menu, the menu bar of pop-up windows or the tray icon, and associate commands with them.

  • The menu bar displays the standard GUI menus at the top side of the main window (while the App Menu button displays the menu when clicked). By default, a publication contains four pre-defined menu items: File, Edition, Navigate and Help with various menu commands that let your end users navigate through your web pages, select and copy text parts, print pages… The properties of these four menu items can be modified thanks to the Menu Bar component. To edit custom items, go to the Application Settings => Visual Controls page, select “Menu Bar” and click the “Edit” button.

  • Pop-up windows in IE publications can get their own menu bar. The menu items can be customized by clicking “Edit Menu Bar Items” in the “Pop-ups” page.

  • The context menu pops up when clicking with the right-hand mouse button. It contains common navigation and edition commands like Back, Next, Copy to clipboard… and it can be customized according to your needs with the Context Menu component.

  • Finally, a pop-up menu can be displayed when the end user right-clicks the tray icon if the latter is enabled. You can change the items by clicking “Edit popup menu” in the Tray Icon tab.

Description of the editor

On the left side, you see the menu tree that lists all of the menu items. In case of the main menu bar, the four predefined menus (File, Edition, Navigate and Help) are already in the list: you can select them in order to add new menu children but you are not allowed to remove them (if you want to remove a predefined menu item, you can set its Visible property to False in the Menu Bar component) nor to edit their properties.

To add a new menu item, click Add. A sub-menu will appear with two commands: “New Item” or “New Child Item” (not available for the context menu). Select “New Item” to add a top menu item; otherwise if you choose “New Child Item”, the new menu item will become a child of the selected item (in the menu tree). You will then be prompted to enter the caption for this menu item.

To edit a menu item, select it in the menu tree and you can then modify its properties (which are shown on the right side).

Each menu item has the following properties:

  • Name: this is a unique internal identifier used by HTML Executable and script commands. Only alphanumeric characters are allowed without spaces.

  • Caption: the title of the menu item (what end users see in the menu bar). You can use resource strings by enclosing the resource string’s identifier into two percent symbols (%SPubTitle% for instance).

  • Image: defines an optional icon to be displayed in the menu item. Click the small button to select an icon visually from the default icon list. If the index is -1, no image is associated.

  • Action: defines the action executed when the end user clicks on the menu item. See below.

  • Absolute Index (only for advanced users): this special property is only available if your custom menu item belongs to a built-in menu (all publications have built-in menus like File, Edition, Help…). It lets you set the value indicating the position of the menu item in its parent menu, thus you can reposition a menu item to a different location within its menu. For instance, a value of “0” will place the item at the top.

Be sure to click Apply after you have modified the properties of a menu item, otherwise they won’t be saved!

To remove a menu item, select it in the menu tree and click Remove.

You can reorder the menu items using drag/drop operations. Note that the order of the four predefined menus cannot be modified (but you can insert other menu items between them).

Actions of the menu items

Each menu item can execute an action when it is clicked. You can select between three actions:

  • Do nothing: no action is executed. Highly recommended if the corresponding menu item contains children.

  • Show this page/URL: this menu item will open the specified HTML page or a URL. You can select a page of your publication by clicking the small button near the field. HEScript commands are also accepted (hescript://[scriptname].[functionprocedurename]), see this topic for more information. For example, if you enter hescript://Macros.MacroShowAbout, then the menu item will show the about box when it is clicked.

  • Target (optional): indicates the frame target (IE only). Accepts special HTML Executable targets. For instance, to open the URL in the default web browser, enter: _heexternal

  • Execute this script function: an HEScript script procedure or Boolean function is executed. Syntax: [scriptname].[functionname]. Parameters are not allowed, and only procedure or Boolean functions are accepted. If you want to pass parameters, then you should use an hescript:// call as explained above.

Specify a hyphen character (-) as the value of Caption for the menu item to indicate that the menu item is a separator.

Separators should have their action set to “Do nothing”.

Copyright G.D.G. Software 2019. All rights reserved