Using sliders in a popup menu?

Hello there,

First time on the forum. Have been using JUCE about a year now, and I’m loving it so far. Trying to get into some more complex ways to approach development.

I am working on developing a plugin, and I was wondering if there was any kind of way to add sliders to a popup menu. I want to have a limited set of sliders for “basic settings” in my main window, but I also want to have some kind of window that a user can open for “advanced settings” where more sliders will show up. So far, the demos have led me in the direction of using a PopupMenu, and I noticed that I have to insert CustomComponents specifically into the PopupMenu. Is there any way for me to use the CustomComponents to insert custom sliders, or should I look at another way to do this?

I have experience creating custom sliders already by inheriting from juce’s sliders.

Thanks in advance for any advice.

I encountered a similar issue not to long ago. The easiest thing for me was to create my own custom component class (inheriting from JUCE’s Component class) and add this as a “CustomItem” directly to the popupmenu (as I think you’re already hinting at). For the handler of the popupmenu, I chose to use a ComboBox as this functionality is already nicely implemented in JUCE. Make sure to add your custom component to the combobox to correctly show.

    yourComboBox.addAndMakeVisible (yourCustomComponent);
    yourComboBox.getRootMenu()->addCustomItem (-1, yourCustomComponent, 
                                               width, height, false);

As usual, you can add your sliders as members of the class and override the resized function to place them in your component as you wish. Not sure if this is the best way, but it worked for me :slight_smile:

Hope this helps!