HISE Logo Forum
    • Categories
    • Register
    • Login

    Change text input position in drawPresetBrowserDialog

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 118 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.
    • Gabor.KG
      Gabor.K
      last edited by

      Hi everyone,

      I would like to ask for a little help.

      I am currently working on a preset browser, and I changed the look of the dialog with drawPresetBrowserDialog.

      But I can not change the position of the text input. My goal is to follow the changes of obj.labelArea, and somehow make it centered, but it doesn't work.

      582deef8-605b-4029-ba6a-5549e6034634-image.png

      My code:

      laf.registerFunction("drawPresetBrowserDialog", function(g, obj)
      {	
                      obj.area = [obj.area[0] + 75.0, obj.area[1], obj.area[2] -150.0, obj.area[3]];
      		obj.labelArea = [obj.labelArea[0] + 40.0, obj.labelArea[1], obj.labelArea[2] -80.0, obj.labelArea[3]];
      	
      		g.fillAll(0x00000000);
      		g.setColour(0xF0CECECE);
      		g.fillRoundedRectangle(obj.area, 5.0);
      		g.setColour(0x76000000);
      		g.fillRoundedRectangle(obj.labelArea, 2.5);
      		g.setColour(0xFF222222);
      		g.drawAlignedText(obj.text, [-32, 160, 350, 4], "centred");
      });
      

      Is there any workaround for this?

      Thanks!
      Gábor

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

        I don't think it's possible to change the position of the input box. You'd need to create an entirely custom dialog instead.

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

        Gabor.KG 1 Reply Last reply Reply Quote 0
        • Gabor.KG
          Gabor.K @d.healey
          last edited by

          Thanks @d-healey !

          Oh damn. How can I do that?

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

            @Gabor-K Use a panel/label/buttons to create the dialog. Then the PresetHandler to add the functionality. This might end up being a lot of work, I've never done it so not sure.

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

            Gabor.KG 1 Reply Last reply Reply Quote 0
            • Gabor.KG
              Gabor.K @d.healey
              last edited by

              @d-healey I will have a look, but I guess this option will not work at this time due to time pressure. Thanks anyway, at least I know the limitations.

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

              56

              Online

              1.7k

              Users

              11.7k

              Topics

              101.8k

              Posts