2 Replies Latest reply on Jul 27, 2014 10:17 AM by myDavey

    Alignment in SUI window

    myDavey Level 1

      Hi

      I am trying to build a dialog with Script UI

      I am trying to 2 rows in a panel, and next to the panel, 2 push buttons

      I am not sure why, but I can't get the items inside the panel to be 2 rows - it is displaying as 1 row

      Same problem regarding the buttons

       

      If someone can help - code below - I'd appreciate it

      Thanks,

      David

       

      var myDialog = new Window("dialog", "Adjust Layout");
      var g1 = myDialog.add('group')
          var p1 = g1.add('panel');
              p1.alignement = "column";
              p1.alignChildren = "column";
              var p1g1 = p1.add('group');
                  var p1r1 = p1g1.add('group')
                      p1r1.add('statictext', undefined, "Start Page:");
                      p1r1.add('dropdownlist', undefined, ["",""]);
                  var p1r2 = p1g1.add('group');
                      p1r2.add('statictext', undefined, "End Page:");
                      p1r2.add('dropdownlist', undefined, ["",""]);
      var g2 = g1.add('group');
          g2.alignment = "column";
          g2.alignChildren = "column";
          g2.add('button', undefined, "OK");
          g2.add('button', undefined, "Cancel");
      myDialog.show()
      
      ow();
      
      
        • 1. Re: Alignment in SUI window
          Jump_Over Level 5

          Hi,

           

          Is it your goal?

           

          var
            myDialog = new Window("dialog", "Adjust Layout"),
            g1 = myDialog.add("group"),
                 p1 = g1.add("panel"),
                      p1_1 = p1.add("panel", undefined, "Start Page"),
                      downStart = p1_1.add( "dropdownlist", undefined, ["1stChoice","2stChoice"]),
                      p1_2 = p1.add("panel", undefined, "End Page"),
                      downEnd = p1_2.add( "dropdownlist", undefined, ["3rdChoice","4thChoice"]),
            p2 = g1.add("panel"); 
          
                 p2.alignment = "fill";
          
                 p2.add('button', undefined, "OK", {name:"ok"}); 
                 p2.add('button', undefined, "Cancel",{name:"cancel"}); 
          
          myDialog.show();
          
          

           

          group orientation is "row" by default

          panel orientation is "column" by default

           

          Jarek

          • 2. Re: Re: Alignment in SUI window
            myDavey Level 1

            Hi Jarek

            Thanks a lot!

             

            It wasnt exactly what I wanted, but it was very close and I was able to figure it out from your code

            Also, I was using "alignment" when I intended to use "orientation"

             

            Thanks a lot!

            David

             

             

            Here is the code now:

            var 
              myDialog = new Window("dialog", "Adjust Layout"),
              g1 = myDialog.add("group"),
                p1 = g1.add("panel"),
                    p1_1 = p1.add("group"),
                        t1 = p1_1.add('statictext', undefined, "Start Page:"),
                        downStart = p1_1.add( "dropdownlist", undefined, ["1stChoice","2stChoice"]),
                    p1_2 = p1.add("group"),
                        t2 = p1_2.add('statictext', undefined, "End Page:"),
                        downEnd = p1_2.add( "dropdownlist", undefined, ["3rdChoice","4thChoice"]),
                p2 = g1.add("group");  
                    p2.alignment = "fill";
                    p2.orientation = "column";
                    p2.add('button', undefined, "OK", {name:"ok"});  
                    p2.add('button', undefined, "Cancel",{name:"cancel"});  
            myDialog.show()
            
            m