From: Ben E. <ben...@to...> - 2001-04-19 00:04:45
|
Ah, I see (re css). I think we might be talking at cross-purposes here a little. I'm trying to build a dynamic select list, such as <select name = "test"> <option value="1">One</option> <option value="2">Two</option> </select> in html, not a cascading menu system, such as Pascal's that you directed me to. The question about why it does not work in NS4 was not directed at Pascal's menus, it was directed at your first e-mail on the subject to do with changing the css properties. Sorry if I wasn't clear. I've put what I've done so far up at http://www.citylightsuk.com/data_ben_13-04-01/Test/selectlist.html - you'll be able to see what I'm driving at. Cheers, Ben ----- Original Message ----- From: "Richard Bennett" <ma...@ri...> To: <dyn...@li...> Sent: Thursday, April 19, 2001 12:32 AM Subject: Re: [Dynapi-Widgetdev] Select list widget > You can only alter the CSS properties once the layer has been written to the > document. > Maybe if you add them after this > > o.addChild(o.list) > o.addChild(o.label) > o.addChild(o.button) > o.list.css etc... > > it would work alright. - I assume o has been added to the doc at this point. > > Richard. > > ----- Original Message ----- > From: "Ben Empson" <ben...@ea...> > To: <dyn...@li...> > Sent: Thursday, April 19, 2001 1:26 AM > Subject: Re: [Dynapi-Widgetdev] Select list widget > > > > Hmm, I tried what you said, but got the error 'label.css is null or not an > > object'. I don't understand! The line that throws the error is > > 'o.label.css.padding="3px"'. > > > > function selectList(title) { > > this.superClass=DynLayer > > this.superClass() > > this.id="selectList"+(selectList.Count++) > > > > this.moveTo(100,100) > > this.setSize(500,350) > > //this.setBgColor('black') > > > > var l=new EventListener(this) > > l.oncreate=function(e) { > > var o=e.getTarget() > > > > o.label = new Label('') > > o.label.moveTo(0,0) > > o.label.setBgColor('#eeeeee') > > o.label.setWidth(233) > > o.label.setHeight(25) > > o.label.setHTML('<b>Click to expand list</b>') > > > > o.label.css.padding="3px" > > o.label.css.borderWidth="2px" > > o.label.css.borderColor="black" > > o.label.css.borderStyle="solid" > > > > o.list = new List() > > o.list.moveTo(0,-75) > > o.list.setWidth(250) > > o.list.setBgColor('#000000') > > o.list.boldOnSelect(true) > > o.list.add("Item One",10) > > o.list.add("Item Two",20) > > o.list.add("Item Three",30) > > o.list.add("Item Four",'test') > > > > o.button = new DynLayer(null,233,0,17,25) > > o.button.imgUp = new Image() > > o.button.imgUp.src = > > '../dynapi2_51/dynapi/src/lib/dynapi/images/scrollpane/arrowdn0.gif' > > o.button.imgDn = new Image() > > o.button.imgDn.src = > > '../dynapi2_51/dynapi/src/lib/dynapi/images/scrollpane/arrowdn1.gif' > > o.button.setBgImage(o.button.imgUp.src) > > > > o.addChild(o.list) > > o.addChild(o.label) > > o.addChild(o.button) > > > > o.button.events = new EventListener(o.button) > > o.button.events.onmousedown=function(e){ > > o.button.setBgImage(o.button.imgDn.src) > > } > > > > o.button.events.onmouseup=function(e){ > > if (!o.list.open) { > > o.list.slideTo(0,25,20,5) > > o.list.open=true > > } else { > > o.list.slideTo(0,-75,20,5) > > o.list.open=false > > } > > o.button.setBgImage(o.button.imgUp.src) > > } > > o.button.addEventListener(o.button.events) > > > > o.list.events = new EventListener(o.list) > > o.list.events.onselect=function(e){ > > o.label.setHTML(o.list.getSelectedItem().getHTML()) > > o.list.slideTo(0,-75,20,5) > > o.list.open=false > > } > > o.list.addEventListener(o.list.events) > > > > } > > this.addEventListener(l) > > > > return this > > } > > selectList.Count=0 > > selectList.prototype=new DynLayer() > > selectList.prototype.getSubClass=function() { return button } > > > > > > > > _______________________________________________ > > Dynapi-Widgetdev mailing list > > Dyn...@li... > > http://lists.sourceforge.net/lists/listinfo/dynapi-widgetdev > > > > > _______________________________________________ > Dynapi-Widgetdev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-widgetdev |