HISE Logo Forum
    • Categories
    • Register
    • Login

    Undefined parameter 0 ( Panel )

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 52 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.
    • tsempireT
      tsempire
      last edited by

      const var btns = [Content.getComponent("Button01"),
                        Content.getComponent("Button02"),
                        Content.getComponent("Button03"),
                        Content.getComponent("Button04")];
      
      const var pnls = [Content.getComponent("Panel1"),
                        Content.getComponent("Panel2"),
                        Content.getComponent("Panel3"),
                        Content.getComponent("Panel4")];
      
      
      for (b in btns)
      {
      	b.setLocalLookAndFeel(tabLAF);
      	b.setControlCallback(onbtnsControl);
      }
      
      
      
      inline function onbtnsControl(component, value)
      {
      	for (p in pnls)
      	{
      		if (pnls.indexOf(p) != btns.indexOf(component))
      			p.showControl(false);
      
      
      		if (pnls.indexOf(p) == btns.indexOf(component))
      			p.showControl(value);
      	}
      };
      

      Capture d’écran 26-07-2025 14.29.03.png

      I can't find the solution. Does anyone know where the error comes from ?

      ChazroxC 1 Reply Last reply Reply Quote 0
      • ChazroxC
        Chazrox @tsempire
        last edited by

        @tsempire it doesnt know what 'tabLAF' is.

        tsempireT 1 Reply Last reply Reply Quote 0
        • tsempireT
          tsempire @Chazrox
          last edited by tsempire

          @Chazrox Should I modify it with something else?

          The idea is to make 4 buttons with 4 different panels.

          d.healeyD tsempireT 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @tsempire
            last edited by

            @tsempire Where are you defining tabLAF?

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

            1 Reply Last reply Reply Quote 0
            • tsempireT
              tsempire @tsempire
              last edited by tsempire

              const var btns = [Content.getComponent("Button01"),
                                Content.getComponent("Button02"),
                                Content.getComponent("Button03"),
                                Content.getComponent("Button04")];
              
              const var pnls = [Content.getComponent("Panel1"),
                                Content.getComponent("Panel2"),
                                Content.getComponent("Panel3"),
                                Content.getComponent("Panel4")];
              
              // Masquer tous les panels sauf le premier au démarrage
              for (var i = 0; i < pnls.length; i++)
                  pnls[i].showControl(i == 0);
              
              // Ajouter les callbacks aux boutons
              for (var i = 0; i < btns.length; i++)
              {
                  btns[i].setControlCallback(onbtnsControl);
              }
              
              // Fonction quand un bouton est cliqué
              inline function onbtnsControl(component, value)
              {
                  local i;
                  for (i = 0; i < pnls.length; i++)
                      pnls[i].showControl(i == btns.indexOf(component));
              };
              

              I think it's settled

              ChazroxC 1 Reply Last reply Reply Quote 0
              • ChazroxC
                Chazrox @tsempire
                last edited by

                @tsempire

                @tsempire said in Undefined parameter 0 ( Panel ):

                I think it's settled

                Where?

                Do you have LAF functions anywhere named "tabLAF"?

                tsempireT 1 Reply Last reply Reply Quote 0
                • tsempireT
                  tsempire @Chazrox
                  last edited by

                  @Chazrox It's good, I did it. Thank you.

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

                  20

                  Online

                  1.8k

                  Users

                  12.2k

                  Topics

                  106.1k

                  Posts