HISE Logo Forum
    • Categories
    • Register
    • Login

    preset text is hidden

    Scheduled Pinned Locked Moved General Questions
    12 Posts 2 Posters 367 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.
    • X
      xsaad @d.healey
      last edited by

      @d-healey I don't know how to do this. I would be grateful if you could help me.

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

        @xsaad Add an else to your if statement and use g.drawText() to draw the text for the other items. You'll probably also want to add background and mouse hover/click actions too so time to dig deep into LAF stuff. I have a LAF playlist on my YouTube channel that explores a lot of this stuff.

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

        X 2 Replies Last reply Reply Quote 0
        • X
          xsaad @d.healey
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • X
            xsaad @d.healey
            last edited by

            @d-healey can you show me where to add the edit because i'm still a biginner? I tried to do that but i didn't succed. thank you for your time

            Content.makeFrontInterface(600, 400);
            
            const laf = Content.createLocalLookAndFeel();
            loadExpansionImagesIntoLaf(laf);
            
            //fltPresetBrowser
            const var fltPresetBrowser = Content.getComponent("fltPresetBrowser");
            fltPresetBrowser.setLocalLookAndFeel(laf);
            
            laf.registerFunction("drawPresetBrowserListItem", function(g, obj)
            {
            	var a = obj.area;
            	if (obj.columnIndex == -1)
            	{
            		g.setColour(Colours.withAlpha(Colours.white, obj.hover ? 1.0 : 0.8));
            		g.drawImage(obj.text, a, 0, 0);
            	}
            });
            
            inline function loadExpansionImagesIntoLaf(obj)
            {
            	local expHandler = Engine.createExpansionHandler();
            	
            	for (e in expHandler.getExpansionList())
            	{
            		local img = e.getWildcardReference("Icon.png");
            		
            		if (isDefined(img))
            		{
            			obj.loadImage(img, e.getProperties().Name);
            		}
            	}
            }
            
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @xsaad
              last edited by

              @xsaad said in preset text is hidden:

               laf.registerFunction("drawPresetBrowserListItem", function(g, obj)
              {
               	var a = obj.area;
               	if (obj.columnIndex == -1)
               	{
               		g.setColour(Colours.withAlpha(Colours.white, obj.hover ? 1.0 : 0.8));
               		g.drawImage(obj.text, a, 0, 0);
               	}
               });
              

              This is the code you are using to draw the preset browser list items. Your if statement is checking if the column index is -1 (for expansions). Add an else clause to the if statement and that is the code which will run for all the other columns. Within the else clause you can add your code for drawing the list items.

              If none of this makes sense you need to go back to basics with LAF and paint routines.

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

              X 1 Reply Last reply Reply Quote 0
              • X
                xsaad @d.healey
                last edited by

                @d-healey I tried, but I think I didn't succeed. Thank you for your time.

                laf.registerFunction("drawPresetBrowserListItem", function(g, obj)
                {
                    var a = obj.area;
                    if (obj.columnIndex == -1)
                    {
                        g.setColour(Colours.withAlpha(Colours.white, obj.hover ? 1.0 : 0.8));
                        g.drawImage(obj.text, a, 0, 0);
                    }
                    else if (obj.columnIndex == 1 || obj.columnIndex == 2)
                    {
                        g.drawText(obj.text, a, Justification.left, true);
                    }
                });
                
                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @xsaad
                  last edited by

                  @xsaad You don't need an else if, just an else.

                  Justification.left Where did you get this from?

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

                  X 1 Reply Last reply Reply Quote 0
                  • X
                    xsaad @d.healey
                    last edited by

                    @d-healey My friend suggested this
                    Can you correct it for me please

                    laf.registerFunction("drawPresetBrowserListItem", function(g, obj)
                    {
                        var a = obj.area;
                        if (obj.columnIndex == -1)
                        {
                            g.setColour(Colours.withAlpha(Colours.white, obj.hover ? 1.0 : 0.8));
                            g.drawImage(obj.text, a, 0, 0);
                        }
                        else (obj.columnIndex == 1 || obj.columnIndex == 2)
                        {
                            g.drawText(obj.text, a, Justification.left, true);
                        }
                    });
                    
                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @xsaad
                      last edited by

                      @xsaad said in preset text is hidden:

                      My friend suggested this

                      Is your friend called chat GPT? :face_savoring_food:

                      @xsaad said in preset text is hidden:

                      Can you correct it for me please

                      You need to learn how to do it. This is basic stuff. If I correct it then you'll just come back with another problem that you can't solve. I have lots of videos that covers this kind of thing. Here's a good one to start with:

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

                      X 1 Reply Last reply Reply Quote 0
                      • X
                        xsaad @d.healey
                        last edited by

                        @d-healey It seems that GBT T knows nothing :grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes: I appreciate your advice. I will start learning from your YouTube channel. Thank you

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

                        47

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        101.8k

                        Posts