Code: Select all
res =
"dialog { \
whichInfo: DropDownList { alignment:'left' }, \
allGroups: Panel { orientation:'stack', \
info: Group { orientation: 'column', \
name: Group { orientation: 'row', \
s: StaticText { text:'Name:' }, \
e: EditText { preferredSize: [200, 20] } \
} \
}, \
workInfo: Group { orientation: 'column', \
name: Group { orientation: 'row', \
s: StaticText { text:'Company name:' }, \
e: EditText { preferredSize: [200, 20] } \
} \
}, \
}, \
buttons: Group { orientation: 'row', alignment: 'right', \
okBtn: Button { text:'OK', properties:{name:'ok'} }, \
cancelBtn: Button { text:'Cancel', properties:{name:'cancel'} } \
} \
}";
win = new Window (res);
win.whichInfo.onChange = function () {
if (this.selection != null) {
for (var g = 0; g < this.items.length; g++)
this.items[g].group.visible = false; //hide all other groups
this.selection.group.visible = true;//show this group
}
}
var item = win.whichInfo.add ('item', 'Personal Info');
item.group = win.allGroups.info;
item = win.whichInfo.add ('item', 'Work Info');
item.group = win.allGroups.workInfo;
win.whichInfo.selection = win.whichInfo.items[0];
win.center();
win.show();
How I need it to work is for instance in the first group: instead of
Code: Select all
e: EditText { preferredSize: [200, 20] } \
Code: Select all
b: Button { preferredSize: [150, 20], text:'Render FLV', properties:{name:'render'} } \
Code: Select all
function renderSelectedCompFLV()
{
//Based off of: http://www.nabscripts.com/Scripting/Partie5_1.htm
myProj = app.project;
myComp = myProj.activeItem;
myRenderQueue = myProj.renderQueue;
myQueueItem = myRenderQueue.items.add(myComp);
myQueueItem.applyTemplate("Best Settings");
myOM = myQueueItem.outputModule(1);
myOM.applyTemplate("320x240 FLV");
myQueueItem.logType = LogType.ERRORS_AND_SETTINGS;
myPath = folderGetDialog("Choose a destination...");
myOM.file = new File(myPath.toString() + "/[projectName].[fileExtension]");
myRenderQueue.render();
myQueueItem.remove();
}
I have been trying for a couple days now to get the button to run the specified function. I've tried in both the res group section and in the new Window section of the code. I might just be over looking something. Is there a better way to do dynamic groups and panels? Or am I on the right track? Thanks in advance!