How menu items are named

When you add a menu item, PowerBuilder gives it a default name, which displays in the Name box in the Properties view. This is the name by which you refer to a menu item in a script.

About the default menu item names

The default name is a concatenation of the default prefix for menus, m_, and the valid PowerBuilder characters and symbols in the text you typed for the menu item. If there are no valid characters or symbols in the text you typed for the menu item, PowerBuilder creates a unique name m_n, where n is the lowest number that can be combined with the prefix to create a unique name.

NotePrefix might be different The default prefix is different if it has been changed in the Design>Options dialog box.

The complete menu item name (prefix and suffix) can be up to 79 characters. If the prefix and suffix exceed this size, PowerBuilder uses only the first 79 characters without displaying a warning message.

Duplicate menu item names

Menu items in the Tree Menu view and WYSIWYG Menu view can have the same names, but they cannot have the same name in the Properties view. If you try to add a menu item using the same name as an existing menu item, PowerBuilder displays a dialog box that suggests a unique name for the menu item. For example, you might already have an Options item on the Edit menu with the default name m_options. If you add an Options item to another menu, PowerBuilder cannot give it the name m_options.

Menu item names are locked by default

After you add a menu item, the name that PowerBuilder assigns to the menu item is locked. Even if you later change the text that displays for the menu item, PowerBuilder does not rename the menu item. This allows you to change the text that displays in a menu without having to revise all your scripts that reference the menu item. (Remember, you reference a menu item through the name that PowerBuilder assigns to it.)

To rename a menu item after changing the text that displays for it, you can unlock the name.

StepsTo have PowerBuilder rename a menu item:

  1. On the General property page in the Properties view, clear the Lock Name check box.

  2. Change the text that displays for the menu item.