scrollbar not working...docs no help

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
cardeiro
Posts: 31
Joined: March 27th, 2006, 2:03 pm
Location: philadelphia, PA
Contact:

Hi,

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();
Mike Cardeiro
------------------------------
Animator - Designer
D4 Creative Group
Philadelphia, PA
------------------------------
nab
Posts: 203
Joined: November 29th, 2005, 3:00 am
Location: Royan
Contact:

You could use a ListBox. You may also want to set the multiselect property to true.
cardeiro
Posts: 31
Joined: March 27th, 2006, 2:03 pm
Location: philadelphia, PA
Contact:

so I gave up and went with Nabs suggesstion of a listbox.

is it really not possible to do something as simple as adding a scroll bar to a panel and having it scroll? seems like this is a huge limitation on how you build an interface.
Mike Cardeiro
------------------------------
Animator - Designer
D4 Creative Group
Philadelphia, PA
------------------------------
Post Reply