/ HALion Developer Resource / HALion Tutorials & Guidelines / How-tos /

Custom Multi-Level Menus II

(Since HALion 7.0)


On this page:


This how-to describes another way to build custom popup menus. The solution shown can be used to build single-level or multi-level popup menus. An example of a single-level popup menu can be found in Working with Exported Variables.

The example below demonstrates how to build a custom multi-level menu for the oscillator type of the synth oscillator. The example is presented as illustrative guide to kickstart your own solution-building process. You can adapt the look and feel, the number of menu entries, etc. by editing the corresponding templates.

Example VST Preset

Prerequisites

  1. Load a program with a synth zone.
  2. Open the Macro Page Designer and click Create New Macro Page/Library.

Overview of Templates

In the subsequent example you will add the following templates from the Basic Controls library to the Template List:

Custom Multi-Level Menus II Templates

Importing the Templates

  1. In the Resource/Library Browser, open the Basic Controls library and navigate to ./Menus/Custom.
  2. Drag the Selector template to your macro page.
  3. Set the Template Parameters of the Selector template as follows:
    • Set Popup to 'RootMenu'.
    • Connect Value to the Osc1 Type parameter, e.g., @0:Zone 1/@id:b0001.
    • Set Label to 'WAVEFORM'.
  4. Go to the Template List. Drag the following templates from the Resource/Library Browser to the Template List:
    • Basic Controls/Menus/Custom/Nested Menu/RootMenu
    • Basic Controls/Menus/Custom/Nested Menu/Sub Menus/Menu_Standard
    • Basic Controls/Menus/Custom/Nested Menu/Sub Menus/Menu_Sync
    • Basic Controls/Menus/Custom/Nested Menu/Sub Menus/Menu_Crossmod
    • Basic Controls/Menus/Custom/Nested Menu/Sub Menus/Menu_XOR

The following templates will be added automatically:

If you have followed the described steps exactly, the menu should already work.

How the Elements Interact

Selector

The Selector template contains the elements which are required to open the RootMenu template and display the selected value.

Custom Multi-Level Menus II Selector

UI Variables

VariableDescriptionType
selThis variable is used by all menu entries of the popup menu. sel is exported as 'Value' and combined with the Value property of the Text control. Through this the display string of the connected engine parameter will be displayed instead of the integer value.Integer

❕ For further information about exported variables, see Working with Exported Variables.

Controls and Subtemplates

ElementDescription
SwitchA Switch control that opens the popup menu. Its Popup Template property is exported as 'Popup'. This allows you to select which popup menu to open for each instance of the Selector template.
TextA Text control for displaying the display string of the connected engine parameter. This is achieved by exporting the Value property as 'Value'. Since the sel UI variable is also exported as 'Value', both are combined into one template parameter, creating the interface for connecting the engine parameter.
TriangleAn Image control to indicate that a popup menu can be opened.
DecorA Decor control used as background.
LabelA Label control for displaying the name of the connected parameter. Its Text property is exported as 'Label'. This allows you to name the Selector template differently for each instance.

RootMenu

The RootMenu template displays when clicking the selector on the macro page. It defines the menu entries and opens the assigned Submenu templates when navigating through the menu.

Custom Multi-Level Menus II RootMenu

UI Variables

VariableDescriptionTypeRange
submenusThis Popup List variable is required to assign the Submenu templates to the entries of the RootMenu template. The entries in the Popup List correspond to the names of the Submenu templates to be opened when navigating through the menu. The Popup List variable opens the assigned Submenu template, when it receives the OnValue of the corresponding RootMenuEntry template.StringMenu_Standard, Menu_Sync, Menu_Crossmod, Menu_XOR

Custom Multi-Level Menus II PopupListVariable

Controls and Subtemplates

ElementDescription
Standard, Sync, Crossmod, XORThese represent the four entries of the menu. They use the RootMenuEntry template which defines the look and functionality of an entry. The Value parameter of all RootMenuEntry templates must be set to @submenus. The OnValue parameters of the specific RootMenuEntry templates must be set to the index of the corresponding entry in the Popup List variable. The OnValue will be sent to the Value parameter which is sent to the submenu Popup List variable which opens the corresponding RootMenuEntry template. The Label parameter defines the name of the entry to be displayed in the menu.

RootMenuEntry

This template represents one entry in the RootMenu template. It consists of two elements:

Custom Multi-Level Menus II RootMenuEntry

Controls and Subtemplates

ElementDescription
LabelA Label control to display the name of the menu entry. Its Text property is exported as 'Label'. This allows you to name the template differently for each instance.
SwitchA Switch control with hover exclusive mode which sends its OnValue when the mouse is above the menu entry. The OnValue and Value properties are exported to be set by each instance of the template. See RootMenu for details.

There are four submenu templates in the Template List: Menu_Standard, Menu_Sync, Menu_Crossmod, and Menu_XOR. Each Submenu template contains four MenuEntry templates that define the entries of the submenu.

Custom Multi-Level Menus II Menu_Standard

ElementDescription
Sine, Triangle,Saw, SquareThese represent the four entries of the submenu. They use the MenuEntry template which defines the look and functionality of an entry. The OnValue parameter of each MenuEntry template must be set to the corresponding value of the engine parameter it selects. This value will be sent to the sel variable. See MenuEntry and Selector/UI Variables for details. The Label parameter defines the name of the entry to be displayed in the menu.

This template represents one entry in the Submenu template. It consists of two elements:

Custom Multi-Level Menus II MenuEntry

Controls and Subtemplates

ElementDescription
LabelA Label control to display the name of the menu entry. Its Text property is exported as 'Label'. This allows you to name the template differently for each instance.
SwitchA Switch control with exclusive mode. The OnValue property is exported to be set by each instance of the template. See Submenu for details. The Value property must be set to @sel, the UI variable of the Selector template. The OnValue will be sent to the Value parameter which is sent to the sel variable. Through this the currently selected value will be sent to the Selector template which is connected to the engine parameter and the Text control within the Selector template shows the display string of the engine parameter.

❕ Popup menus can only be displayed within the dimensions of the macro page. If a popup menu is too large, it will be clipped. To prevent this, you can either change the direction in which the popup menu opens, e.g., open it to the top instead of to the bottom, or you can change the size of the template, so that it fits, and then activate the scrollbar to be able to scroll to the available entries.