HISE Logo Forum
    • Categories
    • Register
    • Login

    Assigning Properties with a loop to a Panel array

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 283 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.
    • ?
      A Former User
      last edited by

      I can create multiple panels with a loop but can't figure out how to assign the properties to all of them at the same time. Content.setPropertiesFromJSON(ary_EqBndPnl[i] doesn't work.

      const numOfPanels = 4;
      
      const ary_EqBndPnl = [];
      
      for (i = 0; i < numOfPanels; i++)
      {
          ary_EqBndPnl.push(Content.addPanel("EqBndPnl" + i));
          
          Content.setPropertiesFromJSON(ary_EqBndPnl[i], { "width": 150.0, "height": 330.0, "bgColour": "11534336", "textColour": "4279308561", "borderRadius": 0.0, "itemColour2": "4279966491", "itemColour": "4279966491", "borderSize": 0.0 });
      }
      
      HiseSnippet 1075.3ocuV0zaiSDFdbZ7JRfUZWo87JqbJUsz0Ne0VVPTRZBJraai1TVgzpUko1SZFU6YRsG2cCU8m.23NbjSvu.Dm3m.24Lm.ItCuiG6Zm3P2tYWvGh777799lmY76Gy.etMIHf6izJc3zIDj16oObJSLtyXLkg5uKRSWeuG+HT6oSvAADGjl1JepjRqTQTzye7wswtXlMIEBgdJmZSdL0iJRQGryintt8vNjCodYrtwN8s4rNbWdHHiUzMQSv1mhOgrOVZVAcj1s55PEb+gBrfD.1zl6Lc3X9KXJ6eJMfdrKQtvBMDBjBF0YL00YPxVL.gzJNHcCuhZCeO88nNzqvS232IhvH0irmAZEtNIY8ZHIsLRpnRR2UensOchHkQpm2UuOSP7Gggi5rRQYKpP2B5c3fELwFd3SI87gEW4Q0Vllqa.+r5CKWtLbdGHLXgdGLZ.lQbCL9HiFoDX+oG08r1LmALWf4YOGnFw8MpRgUlOzfZ7gYcF.VasUKeQYC3IquaLILXb0DQgcbhruZkD9JFqYPWETjzwDyBHx88DhufRBfMg2mM7f8qlMrOi970MtvnxKnNhwU9.Cqlla.atJiIzSFK.f50U.GehJqBfpXY0rdi50aUAvEjWJRYZTaysqatUyVVRti49ND+mfcngA.qJPTAwS4PsDO1tUqFaG4QJYdNUzFR+JhJVFWB61KgC5QgLaAkyL3r84BxArpxCvR.mw7TiFsPN44kO20k3uPZYMl+04XU3K3wD+0MNG6FRtxPHIb1L6acyxrsUe9xXHm0mQEGLgDutG20QlwJeOec.J96O71m2eWr.KKMhwRyG.rcImC8VTEJkz2kDbpfOATcGt2DNSFAshhH1amTFIy5PTGYITRNjI5kPqMMY+moIufd8Bg0adHp8lGh5KJD4ao.My3NgtXwrc3jsxiIfjiYZqHacvBnhoYa0Oeauh+6IGlYRNdEe5ugx8t5CnB6wKVuEVfdgTn+q0a7Pjaq2czHhsHUrE068EW6Dih2r5pTo7Jmdb+jhhNg9mS5dV736tmYNiP1OzqG0ElKDHyWzg8SaLywL9X6K+1G7K+rDvJFXmy+yt6HApM6LelS84AZjBbmHWZFC7a+3C90nf1JA3m9gCirXy4iwVyCr87A0JuTuRqG70NJaxIVqbp0JmbsRzK5at32UQNQvnuevDkM4TrUNIakSy0Lm+jnVhl+tp+0kJaxo4Z4zbsYzbudG1kggjFUB1JuktRB5I7PAkcxdXgOU1cAxXFBi2rIP5MSNwWl3TP1pRs1LowyPRThjt1eCOwjVx0ZwjVIj+u7e3gs84GYql2IqVdmHDXeyhtZYI88jqMrPQy.kEKvLZjGbsuirsk0vuOT+uXepsD9TeI7owR3SykvmVKgOatD9r005i7F2eRnf6o5uC.C5FcY.MsLY5n+AVYdPfC
      
      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @A Former User
        last edited by

        @Steve-Mohican have you tried two loops one to build one to populate?

        HISE Development for hire.
        www.channelrobot.com

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @Lindon
          last edited by

          @Lindon said in Assigning Properties with a loop to a Panel array:

          @Steve-Mohican have you tried two loops one to build one to populate?

          Yes, separate loops also doesn't work :/

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @A Former User
            last edited by Lindon

            @Steve-Mohican said in Assigning Properties with a loop to a Panel array:

            @Lindon said in Assigning Properties with a loop to a Panel array:

            @Steve-Mohican have you tried two loops one to build one to populate?

            Yes, separate loops also doesn't work :/

            so - slowly debugging here, does this work?

            Content.setPropertiesFromJSON(ary_EqBndPnl[0], { "width": 150.0, "height": 330.0, "bgColour": "11534336", "textColour": "4279308561", "borderRadius": 0.0, "itemColour2": "4279966491", "itemColour": "4279966491", "borderSize": 0.0 });
            }
            

            I would also try:

            reg tempPanel;
            for (i = 0; i < numOfPanels; i++)
            {
                tempPanel = Content.addPanel("EqBndPnl" + i);
                ary_EqBndPnl.push(tempPanel));
            

            ..but maybe already you see the array is populated...

            HISE Development for hire.
            www.channelrobot.com

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

              @Steve-Mohican

              See the issue?

              023991c5-defd-4591-9faf-1d6010a1271e-image.png

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

              1 Reply Last reply Reply Quote 0
              • ?
                A Former User
                last edited by

                Where is that T-Shirt? :D

                Yeah that must be string and "EqBndPnl" + i worked. Thank you guys!

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

                51

                Online

                1.7k

                Users

                11.7k

                Topics

                101.8k

                Posts