HISE Logo Forum
    • Categories
    • Register
    • Login

    Local LAF Alert windows

    Scheduled Pinned Locked Moved General Questions
    12 Posts 4 Posters 485 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.
    • LindonL
      Lindon
      last edited by Lindon

      So Im getting around to customising the look of my dialog/alert windows, but I cant get it to do anything here's my code :

      // DIALOG POP UPS
      const var dialogLAF = Content.createLocalLookAndFeel();
      dialogLAF.registerFunction("drawAlertWindow", function(g, obj)
      {
          g.fillAll(0xFF333333);
          
          var a = [0, 0, obj.area[2], 30];
          g.setColour(0x44000000);
          g.fillRect(a);
          g.setColour(Colours.white);
          g.drawRect(obj.area, 0.3);
          g.setFont(skin.stdFont, 18);
          g.drawAlignedText(obj.title, a, "centred");
      });
      

      All I get back are the std look windows...
      what am I doing wrong?

      HISE Development for hire.
      www.channelrobot.com

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

        You need to use global laf.

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

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

          @d-healey I tried that here:

          const var dialogLAF = Engine.createGlobalScriptLookAndFeel();
          dialogLAF.registerFunction("drawAlertWindow", function(g, obj)
          {
              g.fillAll(0xFF333333);
              
              var a = [0, 0, obj.area[2], 30];
              g.setColour(0x44000000);
              g.fillRect(a);
              g.setColour(Colours.white);
              g.drawRect(obj.area, 0.3);
              g.setFont(skin.stdFont, 18);
              g.drawAlignedText(obj.title, a, "centred");
          });
          

          Still nothing...

          HISE Development for hire.
          www.channelrobot.com

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

            @Lindon This is what I see with your example (I don't have your font of course)

            45082191-7d48-49d5-bf6b-fc27d30f9c48-image.png

            This is the standard one

            ca83b47e-12af-4300-9909-05f04e058033-image.png

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

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

              @d-healey yeah very odd, working here now too, thanks..... ignore me everyone back on their heads...

              HISE Development for hire.
              www.channelrobot.com

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

                @Lindon nope dont ignore me.....its broken somehow, it wont accept what Im entering:, here it is now:

                const var laf = Engine.createGlobalScriptLookAndFeel();
                laf.registerFunction("drawAlertWindow", function(g, obj)
                {
                    g.fillAll(0xFF000000);
                    
                    var a = [0, 0, obj.area[2], 30];
                    g.setColour(0x44000000);
                    g.fillRect(a);
                    g.setColour(Colours.white);
                    g.drawRect(obj.area, 0.3);
                    g.setFont(skin.stdFont, 18);
                    g.drawAlignedText(obj.title, a, "centred");
                });
                

                so the background should be black, and this is what I now get:

                dc170e2e-65bd-4a98-b1e1-9dd1e944fcec-image.png

                HISE Development for hire.
                www.channelrobot.com

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

                  @Lindonaaaaand now its working again...mystified.......

                  HISE Development for hire.
                  www.channelrobot.com

                  LindonL orangeO 2 Replies Last reply Reply Quote 0
                  • LindonL
                    Lindon @Lindon
                    last edited by

                    @Lindon ....aaand now its failing again, its very broken I think.

                    HISE Development for hire.
                    www.channelrobot.com

                    1 Reply Last reply Reply Quote 0
                    • orangeO
                      orange @Lindon
                      last edited by

                      @Lindon Odd, It seems to be random

                      develop Branch / XCode 13.1
                      macOS Monterey / M1 Max

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

                        It's working here in isolation, could it be some other part of your project that is interfering with it?

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

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

                          Try resetting the global look and feel (View -> Reset custom look and feel) before compiling.

                          But yeah, the global LAF is glitchy inside HISE - it's global and will be applied to all components and you might end up with some left over LAF from an older compilation.

                          LindonL 1 Reply Last reply Reply Quote 0
                          • LindonL
                            Lindon @Christoph Hart
                            last edited by

                            @Christoph-Hart thanks I will try this...

                            HISE Development for hire.
                            www.channelrobot.com

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

                            30

                            Online

                            2.0k

                            Users

                            12.7k

                            Topics

                            110.1k

                            Posts