Code: Select all
function tmpScript(thisObj){
function tmpScript_mainUI(thisObj) {
var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", "tmp", undefined);
if(pal != null){
var res =
"Group { \
orientation: 'column', \
alignment: ['left', 'top'], \
one: Group { \
orientation: 'row', \
progressBar: Progressbar{text:'Progressbar Name', minvalue:0, maxvalue:100},\
button: Button {text: 'Button', size: ['120', '25']}, \
} \
}";
pal.grp = pal.add(res);
pal.layout.layout(true);
pal.layout.resize()
pal.resizing = pal.onResize = function () {this.layout.resize()};
pal.grp.one.button.onClick = function () {
example(pal);
}
return pal;
} // if (pal != null) {
} // function tmpScript_mainUI(thisObj) {
function example(pal){
var min = 0;
var max = 1000;
pal.grp.one.progressBar.minvalue = min;
pal.grp.one.progressBar.maxvalue = max;
for(var i = min; i<=max;i++){
pal.grp.one.progressBar.value = i;
pal.update();
}
alert("Done! I will now reset the progress bar.");
pal.grp.one.progressBar.value = 0
pal.update();
} // function example(pal){
// Run main UI.
var myPalette = tmpScript_mainUI(thisObj);
if (myPalette != null && myPalette instanceof Window) {
myPalette.show()
myPalette.show();
}
} // function tmpScript(thisObj){
// Run tmpScript.
tmpScript(this);