MENU BAR

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 2003 (Modified)


MENU BAR (menuBar{; process{; *}})

ParameterTypeDescription
menuBarNumberNumber or name of the menu bar
processNumberProcess reference number
*Save menu bar state

Description

MENU BAR replaces the current menu bar with the one specified by menuBar for the current process only. In the menuBar parameter, you can pass either the number or name of the new menu bar.

Note: The name of a menu bar may contain up to 31 characters and must be unique.

The optional process parameter changes the menu bar of the specified process to menuBar.

The optional * parameter allows you to save the state of the menu bar. If this parameter is omitted, MENU BAR reinitializes the menu bar when the command is executed.

For example, suppose that MENU BAR(1) is executed. Next, several menu commands are disabled using the DISABLE MENU ITEM command.

If MENU BAR(1) is executed a second time, either from the same process or from a different process, all menu commands will revert to their initial enabled state.

If MENU BAR(1;*) is executed, the menu bar will retain the same state as before, and the menu commands that were disabled will remain disabled.

Note: If you do not use the optional process parameter, * can be the second parameter. In other words, MENU BAR(1;2;*) and MENU BAR(1;*) are both valid statements.

When a user enters the Custom Menus environment, the first menu bar is displayed (Menu Bar #1). You can change this menu bar when opening a database by specifying the desired menu bar in the On Startup database method or in the startup method for an individual user.

Examples

1. The following example changes the current menu bar to menu bar #3 and resets the states of the menu commands to their original states:

   MENU BAR (3)

2. The following example changes the current menu bar to the menu bar named "FormMenuBar1" and saves the states of the menu commands. Menu commands that were previously disabled will appear disabled.

   MENU BAR ("FormMenuBar1";*)

3. The following example sets the current menu bar to menu bar #3 while records are being modified. After the records have been modified, the menu bar is reset to menu bar #2, with the menu state saved:

   MENU BAR(3)
   ALL RECORDS([Customers])
   MODIFY SELECTION([Customers])
   MENU BAR(2;*)

See Also

Managing Menus.


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