Hi everyone!
I'm trying to write my first script. I don't know how to disable my EditText when select one item in DropDownList.
Anyone can help me out with it?
sorry about my english. thanks a lot!
here is the script UI
function createUserInterface (thisObj,userInterfaceString,scriptName){
var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName,
undefined,{resizeable: true});
if (pal == null) return pal;
var UI=pal.add(userInterfaceString);
UI.myTabbedPanel.tabPoint.myGroup1.PointDropDownList.selection = 1;
pal.layout.layout(true);
pal.layout.resize();
pal.onResizing = pal.onResize = function () {
this.layout.resize();
}
if ((pal != null) && (pal instanceof Window)) {
pal.show();
}
return UI;
};
var resourceString =
"group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['left', 'top'],\
myIconButton: IconButton{text:'My website', image:'~/Desktop/logo/icon2.jpg'},\
myTabbedPanel: Panel{type:'tabbedpanel', orientation:'left', alignChildren:['left', 'fill'],\
tabPoint: Panel{type:'tab', text:'Point', orientation:'column',alignment:['left','top'],\
myGroup1: Group{orientation:'row', alignment:['left','top'],\
myStaticText: StaticText{text:'Select Point Number'},\
PointDropDownList: DropDownList{properties:{items:['1 Point', '2 Points','3 Points', '4 Points', '5 Points', '6 Points']}},\
},\
myGroup2: Group{orientation:'row', alignment:['left','top'],\
myGroupPointRow1: Group{orientation:'column', alignment:['left','top'],\
myEditTextPoint1: EditText{text:'Cut 1 Point ', alignment:['left','top'], characters:11},\
myEditTextPoint3: EditText{text:'Cut 3 Point ', alignment:['left','top'], characters:11},\
myEditTextPoint5: EditText{text:'Cut 5 Point ', alignment:['left','top'], characters:11},\
},\
myGroupPointRow2: Group{orientation:'column', alignment:['left','top'],\
myEditTextPoint2: EditText{text:'Cut 2 Point ', alignment:['left','top'], characters:11},\
myEditTextPoint4: EditText{text:'Cut 4 Point ', alignment:['left','top'], characters:11},\
myEditTextPoint6: EditText{text:'Cut 6 Point ', alignment:['left','top'], characters:11},\
},\
},\
myGroup3: Group{orientation:'row', alignment:['left','top'],\
myCheckbox: Checkbox{text:'Keep your layer selection'},\
},\
},\
tabMarker: Panel{type:'tab', text:'Marker', orientation:'column',\
},\
},\
myButton2: Button{text:'Apply', alignment:['right','buttom']},\
}"
var UI = createUserInterface(this,resourceString,"Trim Layers");
// I have tried this, but error
UI.myGroup.myTabbedPanel.tabPoint.myGroup1.PointDropDownList.selection[2].onClick = function () {
UI.myGroup.myTabbedPanel.tabPoint.myGroup2.myGroupPointRow1.myEditTextPoint1.enabled = !this.value;
}