1 Reply Latest reply on Jul 15, 2008 10:52 AM by (Olav_Kvern)

    UI alignment...

    Emanuele Radaelli Level 1
      Hello everybody,
      I'm building a dialog box where ID CS3 user can set some vars but I'm experiencing some problems when trying to align elements within the box.
      Here's my code:

      var JPGqual = new Array("One","Two","Three");
      var JPGmet = new Array("Four","Five");
      var JPGres = new Array("Six","Seven","Eight","Nine","Ten");

      var prefsDialog = app.dialogs.add({name:"Preferences",canCancel:true});
      with(prefsDialog)
      {
      with(dialogColumns.add())
      {
      staticTexts.add({staticLabel:"Files:"});
      with(borderPanels.add())
      {
      with(dialogColumns.add())
      {
      staticTexts.add({staticLabel:"Method"});
      staticTexts.add({staticLabel:"Line"});
      staticTexts.add({staticLabel:"Other useless options"});
      }
      with(dialogColumns.add())
      {
      var projectSelectionMenu = dropdowns.add({stringList:JPGqual, selectedIndex:0, minWidth:150});
      var projectSelectionMenu = dropdowns.add({stringList:JPGmet, selectedIndex:0, minWidth:150});
      var projectSelectionMenu = dropdowns.add({stringList:JPGres, selectedIndex:0, minWidth:150});
      }
      }
      }
      }

      var prefsDialogResult = prefsDialog.show();
      if(prefsDialogResult == true)
      {
      alert("OK");
      }
      else
      {
      prefsDialog.destroy();
      }

      Now, my first problem is to align left the staticLabel "Files:" (to get it into the borderPanel would be nice too...), the second to align all the other text labels left (I'm talking about "Method:", "Line:" and "Other useless options:").
      I tried almost everything but any align option I set is useless...
      This method of building dialog Boxes is the best one but there is not reference about dialog objects...
      Thanks in advance
        • 1. Re: UI alignment...
          Level 1
          Hi cinematomico,

          re: "Now, my first problem is to align left the staticLabel "Files:" (to get it into the borderPanel would be nice too...), the second to align all the other text labels left (I'm talking about "Method:", "Line:" and "Other useless options:")."

          Sadly, you can't--they only align right. You can play some tricks by inserting dummy objects (staticText objects with no text in them) and working with the minWidth property, but it's probably more trouble than it's worth.

          Alignment is an area where the ScriptUI components work better.

          re: "This method of building dialog Boxes is the best one but there is not reference about dialog objects..."

          Almost all of the sample scripts that come with CS3 contain dialog boxes built using the dialog object. As far as reference material goes--that's what you get when you choose Adobe InDesign CS3 Object Model from the Help menu in the ESTK and choose dialog, dialog column, and other objects.

          Thanks,

          Ole