JS CS3 ScriptUI layout options
John.Kordas Apr 15, 2009 7:34 AMI've been working through the examples and docs and found there are a few ways you can lay out components in the dialog.
Here is the first example of a simple dialog with 2 drop menus and static text for each. I've aligned them to the right but it just does not look correct.
var myDialog = new Window('dialog', ' Details');
myDialog.fDetails = myDialog.add('panel',undefined,'File details');
myDialog.fDetails.alignChildren = 'right';
myDialog.fDetails.fPath = myDialog.fDetails.add('group');
myDialog.fDetails.fTitle = myDialog.fDetails.add('group');
myDialog.fDetails.fPages = myDialog.fDetails.add('group');
with (myDialog.fDetails){
fPath.st = fPath.add('statictext',undefined,'Path:');
fPath.dd = fPath.add('dropdownlist', undefined, undefined, {items:["C:", "D:","E:", "F:", "G", "H", "I"]})
fTitle.st = fTitle.add('statictext',undefined,'Current Doc Title:');
fTitle.dd = fTitle.add('dropdownlist', undefined, undefined, {items:["Product1", "Product2","Product3"]})
}
myDialog.show();
In the second example I've used the coordinates to lay out the dialog and achieve the look I want but it took some playing around to get there. The static text and drop menus line up nicely.
var myDialog = new Window('dialog', ' Details');
myDialog.fDetails = myDialog.add('panel',[0,100,200,190],'File details');
myDialog.fDetails.pathName = myDialog.fDetails.add('statictext',[70,15,100,35],'Path:');
myDialog.fDetails.pathNameDrop = myDialog.fDetails.add('dropdownlist', [105,12,145,32], undefined, {items:["C:", "D:","E:", "F:", "G", "H", "I"]});
myDialog.fDetails.docName = myDialog.fDetails.add('statictext',[10,45,100,60], 'Current Doc Title:');
myDialog.fDetails.docNameDrop = myDialog.fDetails.add('dropdownlist',[105,42,180,62], undefined, {items:["Product1", "Product2","Product3"]});
myDialog.show();
To achieve the look of the second option using the first method (not coordinates) is it possible to set the static test in one column and align it to the right and set the dropmenus in a second column and align them to the left? This would be easier but is it possible?
Cheers, John.



