Resize a layer
How to resize a layer proportionally based on the width size inserted in the text box? Thank you!
var dialog = new Window("dialog","Resize Layers");
dialog.preferredSize.width = 200;
dialog.preferredSize.height = 80;
dialog.orientation = "column";
dialog.alignChildren = ["center","top"];
dialog.spacing = 10;
dialog.margins = 16;
var group1 = dialog.add("group");
group1.orientation = "row";
group1.alignChildren = ["left","center"];
group1.spacing = 10;
group1.margins = 0;
var statictext1 = group1.add("statictext");
statictext1.text = "New width";
var edittext1 = group1.add("edittext");
edittext1.preferredSize.width = 40;
edittext1.preferredSize.height = 25;
var statictext2 = group1.add("statictext");
statictext2.text = "centimeters";
var button1 = group1.add("button");
button1.text = "OK";
button1.preferredSize.width = 80;
button1.preferredSize.height = 25;
button1.justify = "center";
dialog.show();
