4D v13.4

Create menu

Home

 
4D v13.4
Create menu

Create menu 


 

Create menu {( menu )} -> Function result 
Parameter Type   Description
menu  MenuRef, Longint, String in Menu reference or Number or Name of menu bar
Function result  MenuRef in Menu reference

The Create menu command creates a new menu in memory. This menu will only exist in memory and will not be added in the Menu editor in Design mode. Any changes made to this menu during the session will be immediately carried over to all the instances of this menu and in all the processes of the database.

The command returns an ID of the MenuRef type for the new menu.

  • If you do not pass the optional menu parameter, the menu is created blank. You must build and manage it using the RELEASE MENU, SET MENU ITEM, etc. commands.
  • If you pass the menu parameter, the menu created will be an exact copy of the source menu designated by this parameter. All the properties of the souce menu, including any associated submenus, will be applied to the new menu. Note that a new MenuRef reference is created for the source menu and for any existing submenus that are associated with it.

In the menu parameter, you can pass either a valid menu reference, or the number or name of a menu bar defined in Design mode. In this last case, the new menu will be made up of the menus and submenus of the source menu bar.

A menu created by this command can be used as the menu bar using the SET MENU BAR command.

When you no longer need the menu created by Create menu, remember to call the RELEASE MENU command in order to free up the memory being used.

Example  

Refer to the example of the SET MENU BAR command.

 
PROPERTIES 

Product: 4D
Theme: Menus
Number: 408

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v11 SQL

 
SEE ALSO 

Dynamic pop up menu
RELEASE MENU
SET MENU BAR