-
Dynamic Text in UI Panel Extendscript
Hi everyone,
I’m tyring to create a UI Panel to get some currently expressions codes for my colleagues, but I really don’t know how to display infomartions in my text zone.
I already wrote this, it’s pretty dirty for now, but this is how it should work :My text zone is empty, then when I click on one of the radio button (or on the getCodeBtn), it will look for differents codes (I will enter them into a array) and display it in my text zone…
exprCode = "";{
function myScript(thisObj) {
function myScript_buildUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Menu Tests", undefined, {resizeable:true});res="group{ \
orientation:'column', align:'left',\
code : Group {orientation:'row', alignment:['fill','fill'], spacing:5, \
myRadioButton01: RadioButton{text:'Opacité', tooltipActive:'2 Lettres'},\
myRadioButton02: RadioButton{text:'Texte', tooltipActive:'2 Lettres'},\
myRadioButton03: RadioButton{text:'Code', tooltipActive:'2 Lettres'},\
myRadioButton04: RadioButton{text:'Flash', tooltipActive:'2 Lettres'},\
}\
textZone : Group { \
orientation:'column', alignment:['fill','fill'], spacing:5, \
heading: Group {alignment:['fill','top'], lbl: StaticText { text:'Code à copier', alignment:['left','bottom'] }, \
}, \
getCode: EditText { text:'', properties:{'multiline':true}, alignment:['fill','fill'], minimumSize:[500,120] }, \
}, \
cmd: Group { \
alignment:['fill','bottom'], \
getCodeBtn: Button { text:'Chopper un code', alignment:['right','top'], preferredSize:[-1,20] }, \
}, \
}";myPanel.grp = myPanel.add(res);
myPanel.grp.cmd.getPropPathBtn.onClick = afficheCode;
myPanel.grp.textZone.getCode.text = exprCode;function afficheCode()
{
exprCode = "Ta mémé !"
alert(exprCode);
myScript(this);
this.parent.parent.textZone.heading.getCode.enabled = true;
}myPanel.layout.layout(true);
return myPanel;
}var myScriptPal = myScript_buildUI(thisObj);
if(myScriptPal != null && myScriptPal instanceof Window){
myScriptPal.left();
myScriptPal.show();
}
}myScript(this);
}Hope it’s clear enough :/
Thanks for your help