I have a window in my script that displays all comps in the project with a checkbox next to them. If there are lots of comps in the project the window gets so big you cant see the 'ok' button.
I have been trying for several hours to get a simple scrollbar added to the panel. If I play around with the values (which I have to play around because the documentation is so poor). I can sometimes get a horizontal scrollbar to appear (which does absolutely nothing as I need a vertical scrollbar).
heres some basic code of what I'm trying to do.
Code: Select all
c = new Array('comp0','comp','comp','comp','comp','comp','comp','comp','comp','comp','comp','comp','comp','comp5010');
var initWin = new Window('dialog', 'Select Comp Template');
initWin.compList = initWin.add('panel', [100,100,400,400], 'Comps');
initWin.compList.orientation = 'column';
initWin.compList.sBar = initWin.compList.add('scrollbar', undefined);
for(x=0; x<=c.length; ++x){ // get all comps in project
initWin.compList.x = initWin.compList.add('checkbox',[10,p*x,200,p*x+p], c[x]);
initWin.compList.x.alignment = 'left';
}
//buttons
initWin.buttons = initWin.add('panel', undefined, '');
initWin.buttons.orientation = 'row';
initWin.buttons.ok = initWin.buttons.add('button', undefined, 'OK');
initWin.buttons.ok.alignment = 'center';
initWin.buttons.ok.onClick = function () {
run = 1;
this.parent.parent.close(1);
}
initWin.buttons.cancel = initWin.buttons.add('button', undefined, 'CANCEL');
initWin.buttons.cancel.alignment = 'center';
initWin.show();