Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

build dialog user interface

$
0
0

Hi all,

 

I'm building my first UI with javascript and Indesign.

 

Unfortunatly, I don't understand how to align the static text label with the editext label…

My goal is to align the labelBitmap, limitBitmap. The result have to look like this: "limite image bitmap 1200 dpi" on 1 ligne.

 

Can someone help me?

 

Thanks you for your answer.

 

I use the following code:

 

function createDialog() {

          var myArray = [];

     var myListBoxBounds = [0, 0, 564, 160];

 

 

          if (app.extractLabel("KasIgnoredFolders") != "") {

                    myArray = app.extractLabel("KasIgnoredFolders").split(",");

          }

          var dlg = new Window("dialog", "réduction d'images");

 

 

          dlg.orientation = 'column';

          dlg.alignChildren = 'top';

          dlg.btnPnl = dlg.add('panel', undefined, "images ignorées");

          dlg.btnPnl.orientation = 'column';

          dlg.btnPnl.helpTip = "ajouté une image si vous ne souhaitez pas qu'elle soit prise en compte par ce script";

 

 

          dlg.btnPnl.listBox = dlg.btnPnl.add('listbox', undefined, myArray, {multiselect:true});

          dlg.btnPnl.listBox.bounds = myListBoxBounds;

 

 

          dlg.btnPnl.grp = dlg.btnPnl.add('group');

          dlg.btnPnl.grp.orientation = 'row';

          dlg.btnPnl.grp.addBtn = dlg.btnPnl.grp.add('button', undefined, "ajouter image");

          dlg.btnPnl.grp.addBtn.helpTip = "ajouter une image à la liste";

          dlg.btnPnl.grp.removeBtn = dlg.btnPnl.grp.add('button', undefined, "supprimer image");

          dlg.btnPnl.grp.removeBtn.helpTip = "supprimer l'image sélectionnée de la liste";

          dlg.btnPnl.grp.remAllBtn = dlg.btnPnl.grp.add('button', undefined, "supprimer toutes");

          dlg.btnPnl.grp.remAllBtn.helpTip = "supprimer toutes les images de la liste";

   

 

 

          dlg.grp = dlg.add('panel', undefined, "réglages");

    dlg.grp.orientation = 'row';

   

 

 

          dlg.grp.subGrp = dlg.grp.add('group');

          dlg.grp.subGrp.radioPanel_left = dlg.grp.subGrp.add('panel', undefined, "sous-échantillonnage");

          dlg.grp.subGrp.radioPanel_left.alignment = 'left';

          dlg.grp.subGrp.radioPanel_left.alignChildren = 'left';

 

 

    dlg.grp.subGrp.radioPanel_left.rad1 = dlg.grp.subGrp.radioPanel_left.add('radiobutton', undefined, "activé");

          dlg.grp.subGrp.radioPanel_left.rad2 = dlg.grp.subGrp.radioPanel_left.add('radiobutton', undefined, "désactivé");

   

    

          dlg.grp.subGrp2 = dlg.grp.add('group');

          dlg.grp.subGrp2.radioPanel = dlg.grp.subGrp2.add('panel', undefined, "sur-échantillonnage");

          dlg.grp.subGrp2.radioPanel.alignment = 'right';

          dlg.grp.subGrp2.radioPanel.alignChildren = 'left';

 

    dlg.grp.subGrp2.radioPanel.rad3 = dlg.grp.subGrp2.radioPanel.add('radiobutton', undefined, "activé");

          dlg.grp.subGrp2.radioPanel.rad4 = dlg.grp.subGrp2.radioPanel.add('radiobutton', undefined, "désactivé");

   

    //-----------------------limit text box------------------------------ here is the problem ---------------------------

    dlg.grp.subGrp2.radioPanel.labelBitmap = dlg.grp.subGrp2.radioPanel.add('statictext', undefined, 'limite image bitmap');

    dlg.grp.subGrp2.radioPanel.limitBitmap = dlg.grp.subGrp2.radioPanel.add('edittext', undefined, '1200');

          dlg.grp.subGrp2.radioPanel.limitUnitBitmap = dlg.grp.subGrp2.radioPanel.add('statictext', undefined, 'dpi');

   

    dlg.grp.subGrp2.radioPanel.labelRaster = dlg.grp.subGrp2.radioPanel.add('statictext', undefined, 'limite image pixelisée');

    dlg.grp.subGrp2.radioPanel.limitRaster = dlg.grp.subGrp2.radioPanel.add('edittext', undefined, '300');

          dlg.grp.subGrp2.radioPanel.limitUnitRaster = dlg.grp.subGrp2.radioPanel.add('statictext', undefined, 'dpi');

   

          // ----------------------- navigation ------------------------------

    dlg.okBtn = dlg.add('button', undefined, "lancer le script", {name:'ok'});

    dlg.cancelBtn = dlg.add('button', undefined, "annuler", {name:'cancel'});

   

    var myDialogResult = dlg.show();

    var myResult = {};

    return myResult;

    }


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>