Cascade

A cascade is a number of pop-up menus arranged in a hierarchical structure for selecting menu options. Menu options that trigger specific actions are grouped into submenu options that in turn are grouped into higher-level menu options. Clicking on a higher-level menu option or a submenu option opens the cascade below it.

Figure 1. Cascade with three levels of options

creating a cascade

  1. Click on the cascade tool .

  2. Click in the panel.

  3. You can define the size with a second click, or drag the element to size later with the mouse.

  4. The cascade editor opens. The options are added here. Add further list elements as follows:

Figure 2. Cascade Editor
  1. Click on the Add element and specify a name, for example, "Controller".

  2. The element IDs will be assigned automatically. The Elements are used in scripts by their IDs.

  3. Click on the HotKey column. The Hotkey dialog for keyboard control opens.

Figure 3. Hotkey pop-up

Press the desired keys and the selected key combination, for example, Ctrl+R will be displayed. The scripts for the elements are triggered with hotkeys (when the focus has been set, a script can be triggered with Ctrl+R).

  1. Add submenu adds a sub menu to the cascade. Define a name for the sub menu.

  2. The different elements can be moved within a tree with the corresponding arrow button.

  3. You can change the name of an element with the rename button.

  4. Delete removes a selected option

A double-click on the cascade in the panel during engineering opens the Cascade Editor.

Configuration

Example

Figure 4. Cascade including hotkeys

Since only the ID of the options is important for the cascade, the ID parameter only will be passed in the main function. The script in this example outputs the content of the options. You can either trigger an option directly by clicking on it or by using the specified hotkey (with the focus set).

main(string id)
{
  if (id == "21")
  DebugN("decrease");
  if (id == "22")
  DebugN("increase");
  if (id == "23")
  DebugN("default");
}                            

For cascade functions see Control Graphics/ Cascade functions.