HISE Logo Forum
    • Categories
    • Register
    • Login

    itemColour1 undefined

    Scheduled Pinned Locked Moved General Questions
    9 Posts 3 Posters 415 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.
    • gorangroovesG
      gorangrooves
      last edited by

      I have LAF like this:

      const var ComboDropLAF = Content.createLocalLookAndFeel();
      
      ComboDropLAF.registerFunction("drawPopupMenuBackground", function(g, obj)
      {
      	var a = obj.area;
      	var r = 3; //radius size
      	
      	g.setColour(Colours.white);
          g.fillRoundedRectangle([a[0], a[1], a[2], a[3]], r);
          
          g.setColour(obj.itemColour1); // border color
          var border = 1; //border thickness
          g.drawRoundedRectangle([a[0] + border, a[1] + border, a[2] - border*2, a[3] - border*2], r, border);
          
      });	
      
      const var AllComboBoxes = Content.getAllComponents("ComboBox");
      
      for (m in AllComboBoxes)
      	m.setLocalLookAndFeel(ComboDropLAF);	
      

      It was working fine, but since the latest HISE update, I am getting the following warning:

      Interface:! Warning: undefined parameter 0
      :			LookAndFeel.js (234)
      

      The line is:
      g.setColour(obj.itemColour1); // border color

      It seems that it is not able to pull color from an object using "itemColour1". Trying "itemColour" yields the same warning.

      What's happening here?

      Goran Rista
      https://gorangrooves.com

      Handy Drums and Handy Grooves
      https://library.gorangrooves.com

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

        Are you sure it was working fine previously? I only ever see width and height available for the popup menu background.

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

        gorangroovesG 1 Reply Last reply Reply Quote 0
        • gorangroovesG
          gorangrooves @d.healey
          last edited by

          @d-healey It was working fine. The colors were fine, and I was not getting any warnings. Now, I have to specify the colors in the script for both the itemColour and bgColour.

          Goran Rista
          https://gorangrooves.com

          Handy Drums and Handy Grooves
          https://library.gorangrooves.com

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

            @gorangrooves Which commit was it working in?

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

            gorangroovesG 1 Reply Last reply Reply Quote 0
            • gorangroovesG
              gorangrooves @d.healey
              last edited by

              @d-healey Uh, that was from Sep 27, 2023, which I last used. After that, I started getting warnings, so I didn't update HISE until yesterday.

              Goran Rista
              https://gorangrooves.com

              Handy Drums and Handy Grooves
              https://library.gorangrooves.com

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

                @gorangrooves I just tried this commit from September 12th - 5515b685b321dee644837fb70660709ca283dccb

                Still only see width and height.

                Also just tried a build from 1st of October, same thing.

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

                Christoph HartC 1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart @d.healey
                  last edited by

                  After that, I started getting warnings, so I didn't update HISE until yesterday.

                  Before it was the same problem, you just didn't realized it because there was no warning.

                  gorangroovesG 1 Reply Last reply Reply Quote 0
                  • gorangroovesG
                    gorangrooves @Christoph Hart
                    last edited by

                    @Christoph-Hart OK. So, if I understand correctly, the colors for combo boxes were set in the actual combo boxes without the LAF, but there was no way to know since the results would have been identical. Correct?

                    Goran Rista
                    https://gorangrooves.com

                    Handy Drums and Handy Grooves
                    https://library.gorangrooves.com

                    Christoph HartC 1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart @gorangrooves
                      last edited by

                      So, if I understand correctly, the colors for combo boxes were set in the actual combo boxes without the LAF

                      I just reread your exampe and noticed you were using the popup menu LAF functions. The popup menu is not part of the combobox component, so there are no colours in the obj parameter.

                      A good practice for anything regarding LAF customization is to always use Console.print(trace(obj)) as first line of the function, then you'll see everything you can work with.

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

                      10

                      Online

                      1.7k

                      Users

                      11.8k

                      Topics

                      102.4k

                      Posts