Prerequisites
A program with a synth zone and a macro page
A group with a switch, a text and an image control
A Menu Root template for the first level of the menu
A RootMenuEntry template for creating the entries of the first level menu
A SubMenu_1, 2, 3, 4 template for each second level menu
A MenuEntry template for creating the entries of the second level menu
How the Elements Interact
The Multi-Level Menu group contains the elements Menu Switch, Menu Value and Menu Back.
Menu Switch is a switch control that is configured to open the popup menu. It uses the Popup style with the Menu Root template which contains a Popup List variable and entries for each submenu. The entries for the submenus use the RootMenuEntry template to determine the entries in the root menu. All entries must be connected to the same Popup List variable which selects the SubMenu_1,2,3,4 template for the respective entry. The RootMenuEntry template uses the hover exclusive mode to open the respective submenu template when you hover over an entry. The SubMenu_1,2,3,4 and MenuEntry templates determine the entries of the submenus. All aforementioned templates will be explained in more detail below. Menu Value is a text control for displaying the current value and Menu Back is an image control for the background picture.
Multi-Level Menu Selector
This group contains the elements that are needed to open the pop-up menu and to display the selected value.
Menu Switch
This switch control is used to open the Menu Root template as a pop-up. Since it is combined with a background image and a text, the switch itself does not require any graphics. To open the pop-up menu, the properties of the switch must be set to the following values:
Property | Values |
Mode | push |
Style | Popup |
Template | Menu Root |
Close on Click | Outside |
Placement | Place Left, Place Right, Place Below |
Menu Value
This text control is connected to the oscillator type parameter and displays the selected type.
Menu Back
This image control displays a backgroud picture, which is simply a black panel.
Menu Root
This template contains four instances of the RootMenutEntry template, one for each oscillator subgroup. The entries are determined by their Template Parameters: The names of the entries is set with the MenuText (Standard, Sync, Cross, or XOR). All four entries must be connected to the same Popup List variable (@submenus) and the OnValues must be set accordingly (1-4). When hovering the mouse over a menu entry, it will open the submenu template that refers to the OnValues 1-4.
Variables submenus
The Popup List variable "submenus" selects the SubMenu_1,2,3,4 templates for the respective entry. The order of the list refers to the OnValues 1-4.
RootMenuEntry
This template represents one entry of the root menu. It consists of four elements:
Triangle
This image control displays a open menu triangle.
Switch
This switch control uses the hover exclusive mode to open the respective submenu template when you hover over an entry. Since it is combined with a background image and a text, the switch itself does not require any graphics. To open the submenu template, the properties of the switch must be set to the following values:
Property | Values |
Value | Exported to the template level |
Mode | hover exclusive |
Style | Popup, Scalable |
Close on Click | Inside, Outside |
Placement: | Place Right, Place Below |
Bmp On | MenuHover |
Onvalue | Exported to the template level |
Text
This text control displays the name of the entry. The Style of the control is set to Read-Only so that the text cannot be edited. The Value of the text is exported and the name is set to MenuText on the template level.
Image
This image control displays a background picture for the entry.
SubMenu_1, 2, 3, 4
Each of these templates contains four instances of the MenuEntry template, one for each oscillator type. The entries are determined by their Template Parameters: The names of the entries is set with the MenuText (e.g., Sine, Triangle, Saw, or Squ PWM). All four entries must be connected to the type parameter of the desired oscillator and the OnValues must be set accordingly (0-15).
For example:
MenuText = Sine
OnValue = 0
Value = @0:Zone 1/@id:b0001
for the Sine oscillator or
MenuText = Sine
OnValue = 4
Value = @0:Zone 1/@id:b0001
for the Sine Sync oscillator.
MenuEntry
This template represents one menu entry of the SubMenu_1,2,3,4 templates and must be instantiated for each oscillator type. It consists of three elements:
Text
This text control displays the name of the entry. The Style of the control is set to Read-Only so that the text cannot be edited. The Value of the text is exported and the name is set to MenuText on the template level.
Switch
This switch control uses the exclusive mode to set the respective oscillator type when you select an entry. Since it is combined with a background image and a text, the switch itself does not require any graphics. The properties of the switch must be set to the following values:
Property | Values |
Value | Exported to the template level |
Mode | exclusive |
Style | Hover, Scalable |
Bmp Hov | MenuHover |
Onvalue | Exported to template level |
Image
This image control displays a background picture for the entry.
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 remedy this, you can either change the direction in which the popup menu opens, for example, 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.
2 Comments
Michael Ruf
Sabine Pfeifer New How-To for 6.3 release, please proof-read. Thx
Sabine Pfeifer
proofread done