getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: Mugwump on October 14, 2020, 08:30:25 PM

Title: Add context menu items?
Post by: Mugwump on October 14, 2020, 08:30:25 PM
Hi,

Is it possible to add more items to the right click context menu?
For instance I can add items under the tools menu like this

mbApiInterface.MB_AddMenuItem("mnuTools/Custom", "Custom thing", MenuClicked);

Guessing there is some way of using this to do what I want?
Title: Re: Add context menu items?
Post by: Mugwump on October 16, 2020, 06:57:42 PM
This is the menu I would like to extend with my plugin. Is this possible?

(https://i.ibb.co/GTV6Sx9/image.png) (https://imgbb.com/)
Title: Re: Add context menu items?
Post by: psychoadept on October 16, 2020, 07:23:58 PM
I know the Additional Tagging & Reporting Tools plugin has a sub-menu in that menu, so maybe look at the source code for it?
Title: Re: Add context menu items?
Post by: Mugwump on October 25, 2020, 11:17:39 AM
Figured it out from "Additional Tagging & Reporting Tools Plugin" source.

So I'll post it in case it is useful for anyone else trying to do the same in future.

Code
ToolStripMenuItem mainMenuItem = (ToolStripMenuItem)_mbApiInterface.MB_AddMenuItem($"context.Main/{PluginName}", null, null);
mainMenuItem.DropDown.Items.Add("Zip", null, MenuClicked);