moduleAddSubMenu()

Adds a new submenu to the Script Editor or GEDI module.

Synopsis

int moduleAddSubMenu(string label, int parentMenu);

Parameters

Parameter Description
label The label of the submenu.
parentMenu The Id of the main menu. The ID is the return value of the moduleAddMenu() function.

Return value

The function returns the ID of the submenu.

Error

Missing or invalid arguments.

Description

Adds a new submenu to the Script Editor or GEDI module.

If the submenu shall be added to the GEDI, the script should be located in <project_directory>/scripts/gedi and must be called <name>_ext.ctl. When the GEDI is started, all scripts from this directory will be loaded.

If the submenu shall be added to the Script Editor, the script should be located in <project_directory>/scripts/scriptEditor and must be called <name>_ext.ctl. When the Script Editor is started, all scripts from this directory will be loaded.

The function moduleAddDockModule() isn't supported by the Script Editor menu.

Example

The following example adds the menu "Main" and the sub menu "Sub" to the GEDI module. The ID of the created menu "Main" will be used when creating the sub menu "Sub". The ID is the return value of the moduleAddMenu function.

main()
{
  string men = "Main";
  int i = moduleAddMenu(men,3); /* adds the menu "Main" to GEDI
  when located in
  /Scripts/Gedi and the menu to VISION when opened in VISION
  module */
  DebugN("ID of the new menu",i);
  string lab = "Sub";
  moduleAddSubMenu(lab, i);
}

Assignment

Miscellaneous functions

Availability

UI