HISE Logo Forum
    • Categories
    • Register
    • Login

    Combobox dropdown hover/selected colours

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 168 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.
    • P
      paper_lung
      last edited by

      Hi guys, I'm attempting to create my own combobox with LAF, however I'm unsure how to change the colour of the dropdown items when one is selected and/or hovered over with the mouse. Any ideas how to achieve that?

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @paper_lung
        last edited by

        @paper_lung

        ComboBoxLAF.registerFunction("drawPopupMenuItem", function(g, obj)
        {   
        	var a = obj.area;
        
               if(obj.isHighlighted)
        	{
        		g.setColour(myHighLightColour);
            	        g.fillRect(a);
        	};
        
        	if(obj.isHighlighted)
        	{
        		g.setColour(myHighlightTextColour);
        	}else{
        		g.setColour(myTextColour);
        	};
        	g.drawAlignedText(obj.text, a, "left");
        	
        });
        

        HISE Development for hire.
        www.channelrobot.com

        P 1 Reply Last reply Reply Quote 3
        • P
          paper_lung @Lindon
          last edited by

          @Lindon That's perfect, thanks for the info!

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

          46

          Online

          1.7k

          Users

          11.7k

          Topics

          101.8k

          Posts