Custom Menu for IPlug2

I want to address the community of plug-in developers on the Iplug2 framework with a question that has been trembling for me for a long time.
Its essence is the implementation of a custom menu, which should be fully customizable, similar in capabilities to PopupMenu from the JUCE library. Existing menu implementations that use both the native and the IPopupMenuControl class have their advantages and disadvantages.
The IPopupMenuControl class is good for many, but in my opinion it is not capable of organizing a menu with several columns, and its main drawback is that the menu does not leave the plugin window borders. Native menu implementations can leave the plugin window borders, but customizing them is very difficult.

Now I’m porting my old PolyGAS plugin to the Iplug2 framework, and I ran into a problem with the implementation of the menu. I would like to have a translucent menu, with a frame and a shadow, which would not be limited by the size of the plugin window, as in the old version of PolyGAS:

I would be glad to consider constructive advice on the implementation of such a menu. From myself, I’ll just add that I’m coming up with the idea of implementing an additional window using the API, which will contain menu items, but I would also like it to work on macOS, with whose API I’m unfortunately not so familiar with.

nice gui!

AFAIK NSMenu on macOS doesn’t support multiple columns, like the win32 menu does. I think your best option would be with IPopupMenuControl (which used to be able to do multiple columns… something seems to have broken with that). It’s quite a lot of work to make a “custom” NSWindow based menu that could extend beyond the bounds of the plug-in UI. If you want to port stuff to AUv3 or iPad you can’t create windows that go outside of the plug-in window IIRC, so IPopupMenuControl may be the best choice

This GUI was created in Delphi. But as practice has shown, Delphi was not suitable for developing complex plugins, and besides, plugins could only be builded for Windows.

It makes sense to look at the source code of the JUCE library, files juce_PopupMenu.cpp, juce_win32_Windowing.cpp, juce_mac_Windowing.mm and so. However, this library is quite difficult…

1 Like

I think that a lot can be taken from these libraries and rewritten. In such a way as not to violate the rights of the license. In fact, there are key interceptions, copying from the clipboard, and much more. I don’t understand why it’s not implemented in this framework.

It’s really a lot of work and requires a fundamental change to the framework to work with multiple windows… in iPlug we have one IGraphics context, which is somewhat coupled to the plugin, and tied to one window. In JUCE a LowLevelGraphicsContext is a more lightweight object optionally used to draw into a window and the framework is designed for multiple windows.

1 Like

If you are hungry for help/contribute , then you can create a open task-board for tasks so that everyone can help finish or improve the framework in the shortest possible time… :smiling_face_with_tear:

I’m not going to copy the JUCE code, but a detailed analysis of its work in the debugger is not copyright infringement. Therefore, you can safely make an additional component for IPlug2 that implements the menu, which will be integrated with the graphical tool IGraphics and other necessary classes of IPlug2. In particular, such a menu will be useful as a preset selector, especially when the number of presets is large enough.

1 Like

You could also check GLFW, which has cross platform window creation code

1 Like

By the way, for current projects, I had to finalize the IPopupMenuControl in order to display keyboard shortcuts with right text alignment.

popup_menu

It is also possible to explore the inkscape source code, it also uses the original cross-platform popup menu.