Forum
    • Categories
    • Register
    • Login

    LAF Preset Browser glitches when expansion is changed.

    Scheduled Pinned Locked Moved General Questions
    10 Posts 2 Posters 1.1k 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.
    • M
      mehmethand
      last edited by mehmethand

      Hi, I'm trying to make a custom preset browser with LAF, But there are some kind of visual problems when I change the expansion. What can cause this? Is there a way to prevent this? Because it is useless like this.

      Untitled.gif

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @mehmethand
        last edited by

        @mehmethand Difficult to say without knowing what you're doing.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        M 1 Reply Last reply Reply Quote 0
        • M
          mehmethand @David Healey
          last edited by

          @d-healey I'm just using Preset Browser LAF which I copied from HISE documentation. I just changed colors. Default Preset Browser is working just fine. But the custom one has visual problems.

          laf.registerFunction("drawPresetBrowserBackground", function(g, obj)
          {
              g.fillAll(noColour);
          });
          
          laf.registerFunction("drawPresetBrowserSearchBar", function(g, obj)
          {
          
          });
          
          laf.registerFunction("drawPresetBrowserColumnBackground", function(g, obj)
          {
              g.setColour(presetOnColour);
              g.drawRoundedRectangle(obj.area, 4,1);
          });
          
          laf.registerFunction("drawPresetBrowserListItem", function(g, obj)
          {
          	
          	g.setFont("Font1",18);
          
          	g.setColour(presetOffColour);
          	g.drawAlignedText("  "+ obj.text, obj.area, "left");
          	
              if(obj.selected)
              {	
             	 g.setFont("Font1 Bold",18);
                  g.setColour(presetOffColour);
                  g.fillRoundedRectangle(obj.area,4);
                  g.setColour(presetOnColour);
                  g.drawAlignedText("  " + obj.text, obj.area, "left");
              } 
          
          });
          
          inline function removeFromTop(area, amountToRemove)
          {
              local a = [area[0], area[1], area[2], amountToRemove];
              
              area[1] += amountToRemove;
              area[2] -= amountToRemove;
              return a;
          }
          
          laf.registerFunction("drawPresetBrowserDialog", function(g, obj)
          {
             g.fillAll(noColour);
             g.setColour(preP21);
             g.fillRoundedRectangle(obj.area, 4.0);
             g.setColour(presetOnColour);
             g.fillRoundedRectangle(obj.labelArea, 4.0);
             g.setColour(presetOffColour);
             g.setFont("Font1 Bold",22);
             g.drawAlignedText(obj.text, removeFromTop(obj.area, 50), "centred");
          
          });
          
          
          laf.registerFunction("drawDialogButton", function(g, obj)
          {
          	if (obj.value)
          	{
          		g.setColour(myWhite);
          		g.fillRoundedRectangle(obj.area,4);	
          		g.setColour(myBlack);
          		g.drawAlignedText(obj.text,obj.area,"centred");
          	}
          	if (obj.value==0)
          	{
          	
          		g.setColour(presetOffColour);
          		g.fillRoundedRectangle(obj.area,4);	
          		g.setColour(presetOnColour);
          		g.drawAlignedText(obj.text,obj.area,"centred");
          	}	
          	if (obj.value==0 && obj.over)
          	{
          		g.setColour(presetOnColour);
          		g.drawRoundedRectangle(obj.area,4,2);	
          	}
          });
          
          
          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @mehmethand
            last edited by

            @mehmethand Can you include the colours you're using in your code? Then I can make a test project.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            M 1 Reply Last reply Reply Quote 0
            • M
              mehmethand @David Healey
              last edited by

              @d-healey
              ```
              global presetOffColour=0xFFc6c6c6;
              global presetOnColour=0xFF202020;
              global noColour=0xFF000000;
              global myWhite=0xFFc6c6c6;
              global myBlack=0xFF202020;

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @mehmethand
                last edited by

                @mehmethand Are you using global or local laf?

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                1 Reply Last reply Reply Quote 0
                • David HealeyD
                  David Healey
                  last edited by

                  I can't recreate the issue here. Let me know if you see it with this example.

                  HiseSnippet 1500.3ocsX0saaaCEVxMpnxcCcEXO.D9hBGTWCY2zthU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jjSknMAqKjVrIP1eQLidxSL0.fEUYNQ3kNsq.7Upaf+s5LfI0MD7iEJx64ksUwusHZdVc6lKOcmGRAiQj4xV2wmbUJVlOL9BhrBJMIJUPnknY6y59qWeVg1FglRPA+PNU89Ajzwsf8R59mzuuXWYNocRAu8yGtOVg0MpkRCja.QpnZ33tO4JnSWaaa9d6SRtTIFXjMdffqsf6CUo8YZ6qpESfUTduSo.ro.Bdj2zjp4byzMROJavO7lT.XmsG4MSUQmK5MtEZ+6CR+uZUfccwYT+qO+GedVp0SE17XbyB+dAOcYzR5PWG7Ujzc9eORIGRpLlyA2L.ySfUvjFI1FU.I5hYIYhXBvx7UWmIkrfMgEZq3yvJiLj6A9KvqVvDkZDEk+TbBgCWeHed6CcHnVBuV3qDRHBouSxz7RQ1gfWGQZJjfuMiKe7vXafPC9maHYG+KzHU+Sf0WAv3LyodAUe9bOUtizAxmalCceX5yUlDaRmgJ48yDsrH6Dw0swQQPh25p2j9aapqqn8zyrLNRHSimyyIKGZdNiizKvs3sNWqCZNtdtGWvwoOg1quRO5Oc02ibg6KA2TSDMjgUyd8M88TSY.YpybmI88hfUR0nouG6c3NcAq7NcqKDerWapJre9XrPNXDpB8+AFSuI7W6cP2tvIEY.bKuV+5lds2uvzCmLoK4cDVIoPEOOX+SGnhTHAlcNmvRzq2EzUhsiCzi0QfNDdjYvmgmTl0zicSYVaLSmXbnT7wP6IL56Z+.CE.Sbyesfu2Q5wnZNlSc.87BpF3DCW6+iggZ2+YvgC4qS8MPmmuA5ryFnyK1.cd4Fny2sA57pUpi9ebowPkH1tc.Hz9.y4RttGvwPlkIKz4+fbF8Wj
                  

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    mehmethand @David Healey
                    last edited by

                    @d-healey I tried both global and local laf. This snippet is working fine on my system. I don't know what I messed up in my project.

                    David HealeyD 1 Reply Last reply Reply Quote 0
                    • David HealeyD
                      David Healey @mehmethand
                      last edited by

                      @mehmethand It must be something that is set to saveInPreset that is causing the issue since it only triggers when the preset is changed.

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        mehmethand @David Healey
                        last edited by

                        @d-healey ok I found the solution. I deleted HISE and rebuild it again now everything is working fine. So I learned something more. When things go weird, rebuild HISE again.

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

                        39

                        Online

                        2.1k

                        Users

                        13.0k

                        Topics

                        113.0k

                        Posts