APPEND MENU ITEM

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


APPEND MENU ITEM (menu; itemText{; process})

ParameterTypeDescription
menuNumberMenu number
itemTextStringText for the new menu items
processNumberProcess reference number

Description

The APPEND MENU ITEM command appends new menu items to the menu whose number is passed in menu.

If you omit the process parameter, APPEND MENU ITEM applies to the menu bar for the current process. Otherwise, APPEND MENU ITEM applies to the menu bar for the process whose reference number is passed in process.

APPEND MENU ITEM allows you to append one or several menu items in one call.

You define the items to be appended with the parameter itemText as follows:

Separate each item from the next one with a semi-colon (;). For example,

"ItemText1;ItemText2;ItemText3".

To disable an item: Place an opening parenthesis (() in the item text.

To specify a separation line: Pass "(-" as item text.

To specify a font style for a line: In the item text, place a less than sign (<) followed by one of these characters:

<BBold
<IItalic
<UUnderline
<OOutline (Macintosh only)
<SShadow (Macintosh only)

To add a check mark to an item: In the item text, place an exclamation mark (!) followed by the character you want as a check mark. On Macintosh, the character is displayed; on Windows, a check mark is displayed no matter what character you passed.

To add an icon to an item: In the item text, place a circumflex accent (^) followed by a character whose ASCII code plus 208 is the resource ID of a Mac OS-based icon resource.

To add a shortcut to an item: In the item text, place a slash (/) followed by the shortcut character for the item.

Note: Use menus that have a reasonable number of items. If you want to display more than 50 items, think about a using scrollable area in a form instead of a menu.

Note: APPEND MENU ITEM accepts up to 32,000 characters, while INSERT MENU ITEM accepts up to 255 characters.

Important: The new items do not have any associated method. Therefore, they must be managed from within a form method using the Menu selected command.

Example

This example appends the names of the available fonts to the Font menu, which in this example is the sixth menu of the current menu bar:

      ` In the On Startup database method
      ` The font list is loaded and menu item text is built
   FONT LIST(<>asAvailableFont)
   <>atFontMenuItems:=""
   For ($vlFont;1;Size of array(<>asAvailableFont))
      <>atFontMenuItems:=<>atFontMenuItems+";"+<>asAvailableFont{$vlFont}
   End for

Then, in any form or project method, you can write:

   APPEND MENU ITEM(6;<>atFontMenuItems)

See Also

DELETE MENU ITEM, INSERT MENU ITEM.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next