HISE Logo Forum
    • Categories
    • Register
    • Login

    Panel popupMenu with first click callback?

    Scheduled Pinned Locked Moved Scripting
    5 Posts 2 Posters 108 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.
    • whoopsydoodleW
      whoopsydoodle
      last edited by

      I'm trying to have my panel popup menu spawn with left click and also get a callback from that first click before anything has been selected from the popupMenuItems.

      It seems like I can only get callbacks from the action the doesn't spawn the popupMenu with .clicked

      Or the second click that selects an item from the popupMenu with .result

      Is there an additional one I'm missing that will give me that first click for the action I've chosen to use for the popupMenu?

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @whoopsydoodle
        last edited by

        @whoopsydoodle Try a mouse callback

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • whoopsydoodleW
          whoopsydoodle
          last edited by

          Yep already am.

          The issue seems to be that .rightClick only triggers on right click. And .click only triggers on whatever doesn't spawn the popupMenu.

          So if you have the properties option popupOnRightClick turned off, there is nothing that triggers on left click.

          Maybe it can be done with some dirty mess of things like !even.mouseUp && !event.hover && something else?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @whoopsydoodle
            last edited by

            @whoopsydoodle said in Panel popupMenu with first click callback?:

            Maybe it can be done with some dirty mess of things like !even.mouseUp && !event.hover && something else?

            Try it and see, I have no idea.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            1 Reply Last reply Reply Quote 0
            • whoopsydoodleW
              whoopsydoodle
              last edited by whoopsydoodle

              Haha dirty indeed. But it works!

              I don't know why but the mouseDownX and mouseDownY values I get when clicking on the panel are always huge. So I'm using an X that's higher than my object width to trigger that? Idk man... haha

              if (event.mouseDownX > 26) {
              	//click on panel
              	//first click shows menu, second hides menu
              }
              
              if (!event.hover && !event.mouseDownX) {
              	//click off of panel that also hides menu
              }
              
              1 Reply Last reply Reply Quote 1
              • First post
                Last post

              14

              Online

              1.7k

              Users

              11.9k

              Topics

              103.3k

              Posts