Copy link to clipboard
Copied
How I can make horizontal space between objects in ScriptUI?
I've design this UI
In this case, I just want to make the 0 exactly placed inline with the 1 2 3 row (topRow in script) and keep the spacing between 3 and 0. and also keep the 1 place exactly same place as before.
here's the Script.
(function(thisObj) {
scriptBuildUI(thisObj)
function scriptBuildUI(thisObj) {
var win = (thisObj instanceof Panel) ? thisObj : new Window("palette", "AM", undefined,{resizeable: true});
win.spacing = 0;
var mainpanel = win.add("panel", undefined, "Main Panel");
mainpanel.spacing = 0;
mainpanel.orientation = 'column';
mainpanel.alignment = ['left','left'];
var groupZero = mainpanel.add ('group', undefined, 'groupZero');
var zero = groupZero.add("statictext", [0,0,25,25], "0");
groupZero.alignment = ['right', 'right'];
var topRow = mainpanel.add("group", undefined, "topRow");
var one = topRow.add("statictext", [0,0,25,25], "1");
var two = topRow.add("statictext", [0,0,25,25], "2");
var three = topRow.add("statictext", [0,0,25,25], "3");
var middleRow = mainpanel.add("group", undefined, "middleRow");
var four = middleRow.add("statictext", [0,0,25,25], "4");
var five = middleRow.add("statictext", [0,0,25,25], "5");
var six = middleRow.add("statictext", [0,0,25,25], "6");
var bottomRow = mainpanel.add("group", undefined, "bottomRow");
var seven = bottomRow.add("statictext", [0,0,25,25], "7");
var eight = bottomRow.add("statictext", [0,0,25,25], "8");
var nine = bottomRow.add("statictext", [0,0,25,25], "9");
var apim = mainpanel.add("statictext", undefined, "The Numbers from zero to nine zero is on top");
win.onResizing = win.onResize = function() {
this.layout.resize();
};
win instanceof Window
? (win.center(), win.show()) : (win.layout.layout(true), win.layout.resize());
}
})(this);
Copy link to clipboard
Copied
You will have to do your own calculations and use absolute placement. The auto-layout engine isn't in any way aware of tabular number alignment nor does it have an actual grid/ table layout method.
Mylenium
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more