Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I make horizontal space between objects in ScriptUI?

Contributor ,
Feb 07, 2020 Feb 07, 2020

How I can make horizontal space between objects in ScriptUI?

 

I've  design this UI

UI.png

 

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);
TOPICS
How to , Preview , Scripting , User interface or workspaces
427
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 08, 2020 Feb 08, 2020
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines