HISE Logo Forum
    • Categories
    • Register
    • Login

    How to Access the Top Level String in a Panel Hierarchical Menu?

    Scheduled Pinned Locked Moved Solved General Questions
    2 Posts 1 Posters 102 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • clevername27C
      clevername27
      last edited by

      Does anyone know how to access the top level string from a user's selection in a Panel?MenuExample.png

      1 Reply Last reply Reply Quote 0
      • clevername27C
        clevername27
        last edited by clevername27

        Figured out—here's the code if anyone wants it:

        1. When you call getPopupmenuItemText, set the last parameter to 0; this means don't truncate the menu text.

        2. In the getPopupmenuItemText, substitute this code for the similar section:

          for(element in array) {
          if(element.indexOf("**") != -1) continue;
          if(element.indexOf("___") != -1)continue;
          if(index == i) {
          // Remove the menu name
          if(removeSub && element.indexOf("::") != -1) {
          return element.split("::")[2];
          } else {
          local parsedString = element.split("::");
          return parsedString[0]+": "+parsedString[2];
          }
          }
          i++;
          }

        1 Reply Last reply Reply Quote 0
        • clevername27C clevername27 marked this topic as a question on
        • clevername27C clevername27 has marked this topic as solved on
        • First post
          Last post

        12

        Online

        1.7k

        Users

        11.8k

        Topics

        102.8k

        Posts