I would like to know if there is already out of the box menu param widget.
A sort of label, where user can do right click, show a list of selectable value, and select one by clicking left button (which show the new value on the label, and set the param’s value as well).
Somethings like this:
Even better if multiple sublevels are available, but not strictly necessary right now.
Is there already? Or I should make my own from scratch?
I see there is MenuItem and stuff, but not sure if I create one separate and linked to a param.
I do not think there is any way to set a context menu to a parameter as right clicking on a parameter already opens up a menu for params where you enter values from the keyboard. Not sure if you could append options here. Best way to currently do so is with the panel context menu.
You have do this on your own. The context menu of a parameter is implemented in ParamWidget::createContextMenu, but you can’t influence anything there. You need to override ParamWidget::onButton and do your own stuff. Changing an existing parameter from there is no problem.
Because you’re not calling the superclass’s onButton, any feature that relies on ParamWidget’s button responding in the normal way will break. This is true when overriding any non-empty method.
Two menu? Uhm I don’t see the second, only the mine
Notice I’m opening it with left click, and right click over a widget should be disabled (thanks to super class method), preventing the main (Rack) menu to be opened…