HISE Logo Forum
    • Categories
    • Register
    • Login

    Can I use this.over or this.down for paint routine on panel?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 71 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.
    • VirtualVirginV
      VirtualVirgin
      last edited by

      When doing an LAF, you can use "obj.over", "obj.down" etc. to get the mouse state and change the appearance.

      Can I use "this.over", "this.down" etc. to do the same for a panel?
      I'm not getting any result from this Console.print():

      		    if(this.over)
      		    	Console.print("hover!");
      		    	g.setColour(this.itemColour2);  
      		        g.fillRoundedRectangle(ka, keyRound);
      		    
      		    
      		    if(this.down)
      		    	g.setColour(this.bgColour);
      		        g.fillRoundedRectangle(ka, keyRound);
      

      Just hoping I can do it this way without having to go use the mouseCallback explicitly for the panel.

      You can listen to my orchestral mockups here:
      https://www.virtualvirgin.net/

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

        @VirtualVirgin In the a panel's mouse callback you get a parameter, usually called event. This holds that information.

        Link Preview Image
        HISE | Scripting | Script Panel

        The reference guide for the ScriptPanel

        favicon

        (docs.hise.dev)

        ...

        And I just re-read your question - you need to use a mouse callback, the panel is only repainted when you call the repaint function, so you can't dynamically get mouse information within it.

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

        VirtualVirginV 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @d.healey
          last edited by

          @d-healey said in Can I use this.over or this.down for paint routine on panel?:

          @VirtualVirgin In the a panel's mouse callback you get a parameter, usually called event. This holds that information.

          Link Preview Image
          HISE | Scripting | Script Panel

          The reference guide for the ScriptPanel

          favicon

          (docs.hise.dev)

          ...

          And I just re-read your question - you need to use a mouse callback, the panel is only repainted when you call the repaint function, so you can't dynamically get mouse information within it.

          Thanks,
          that is generally the way I do it, but I was trying to transfer an LAF to a paint routine and was wondering if there was any trick to lower the workload of it that I didn't know of.

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          12

          Online

          1.8k

          Users

          12.1k

          Topics

          104.9k

          Posts