Script Panel Properties Related with Popup Menu
-
My HISE version is 0.99 and build version of it is 647.
I think you can easily add the feature of separator, something like using "-" as the separator string in the string list.
-
Are you using the most recent version on GitHub? I just added this feature a few days ago.
And I'll add separators and deactivated items.
I propose using___
(three underscores) as separator string and~~deactivated Item~~
for deactivated items (that's strikethrough in Markdown).I don't know if you need it but you can already make nested popup menus with the syntax
SubMenu::Item
-
Didn't read your last post. Let me know if you need a current build (also which OS you are working on).
-
Yes, I knew how to add SubMenu as well. I found such codes in GitHub sources. And I am just using most recent version on GitHub and also HISE standalone as well.
I prefer to know how to build HISE standalone with sources of GitHub repository.
Otherwise, I will be appreciate if you provide me recent Win8.1 x64 and macOS Sierra builds.
Thanks a lot. -
There are build instructions in the GitHub Readme
-
Alright, I pushed these changes to GitHub. You can now do this:
const var Panel = Content.addPanel("Panel", 55, 0); // [JSON Panel] Content.setPropertiesFromJSON("Panel", { "width": 153, "height": 30, "allowCallbacks": "Context Menu", "popupMenuItems": "**This is a header**\n___\nA\nB\n~~Not active~~\nC", "popupOnRightClick": 0, "popupMenuAlign": 1 }); // [/JSON Panel]
I also added the section headers - just use the Markdown Syntax for
**bold**
. Be aware that Section Headers and Separators don't have an index (deactivated items still do). -
This is a small helper function that deactivates items in a ScriptPanel:
/** Deactivates an item in a custom popup. */ inline function deactivatePopupItem(widget, index, isDeactivated) { local list = widget.get("popupMenuItems").split("\n"); if(isDeactivated) { if(list[index].indexOf("~~") != -1) return; list[index] = "~~" + list[index] + "~~"; } else { list[index] = list[index].replace("~~", ""); } widget.set("popupMenuItems", list.join("\n")); } deactivatePopupItem(Panel, 1, true);
-
Those are really nice and easy to implement. Now I made a nice popup menu by using above stuffs.
Many appreciate, Christoph! -
I also added the section headers - just use the Markdown Syntax for **bold**. Be aware that Section Headers and Separators don't have an index (deactivated items still do).
I have added Section Header with bold but it is having an index. Would you check and fix it?
-
Yeah I'll take a look.