moduleAddToolBar()

Adds a new toolbar to the Script Editor or GEDImodule.

Synopsis

int moduleAddToolBar(string label);

Parameters

Parameter Description
label The label of the toolbar.

Return value

The function returns the ID of the toolbar.

Error

Missing or invalid arguments.

Description

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

If the toolbar 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 toolbar 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 "MyTools" and the sub menu "MyTools2" to the GEDI module. The ID of the created menu "MyTools" will be used when creating the sub menu "MyTools2". The return value of the moduleAddToolBar() function will be used when adding an action using the moduleAddAction() function. Three different actions "Find in Files","action 2" and "action 3" will be added.

main()
{
  int id = moduleAddMenu("MyTools");
  int id2 = moduleAddSubMenu("MyTools2", id);
  int tb = moduleAddToolBar("toolbar1");
  DebugN(id, id2, tb);
  moduleAddAction("Find in Files", "", "Ctrl+I", id, -1,
  "find");
  moduleAddAction("action 2", "undo", "", id, tb, "action2");
  moduleAddAction("action 3", "redo", "", id2, tb, "action3");
  moduleAddDockModule("myDock", "projAdmin/console.pnl");
}
void find()
{
  ModuleOnWithPanel("Find", -2, -2, 100, 200, 1, 1, "",
  "gedi/grep.pnl", "",
  makeDynString());
}
void action2()
{
  DebugN("action2", myModuleName());
}
void action3()
{
  DebugN("action3", myModuleName());
}

Assignment

Miscellaneous functions

Availability

UI