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 89 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.

        https://docs.hise.dev/scripting/scripting-in-hise/scriptpanel.html#the-mouseevent-callback

        ...

        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.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - 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.

          https://docs.hise.dev/scripting/scripting-in-hise/scriptpanel.html#the-mouseevent-callback

          ...

          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

          26

          Online

          2.0k

          Users

          12.7k

          Topics

          110.4k

          Posts