From: Richard B. <ma...@ri...> - 2001-04-18 22:35:07
|
>Is there an argument to DynLayer that adds > borders automatically? No there's not, although there are a few border widgets about. But if a list cell is based on a label you can use labels formatting features, there's an example of them here: http://www.richardinfo.f2s.com/dynapi/Richard_Examples/Label_Properties_Exam ple.html (url wraps) And you can also use the .css property to set css borders yourself, which won't show in NS4 though, like this: myDragLayer.css.padding="4px" //ie enhancements myDragLayer.css.borderWidth="2px" myDragLayer.css.borderColor="lightsalmon" myDragLayer.css.borderStyle="solid" this code is from the same example. Cheers, Richard Bennett ma...@ri... www.richardinfo.com (Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2) visit the DynAPI homepage (and FAQ) :: http://dynapi.sourceforge.net/dynapi/index.php?menu=1 Browse (and search) the mailinglist here: http://www.mail-archive.com/index.php3?hunt=dynapi ----- Original Message ----- From: "Ben Empson" <ben...@ea...> To: <dyn...@li...> Sent: Wednesday, April 18, 2001 9:00 PM Subject: Re: [Dynapi-Widgetdev] Select list widget > OK, I answered my own question (do o.addChild(o.label) before > o.addChild(o.list)). Next question - I can't work out how the borders are > put around the list items. Is there an argument to DynLayer that adds > borders automatically? I can't find anything. > > Cheers, Ben > > -------------code start-------------- > > 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(250) > o.label.setHeight(25) > o.label.setHTML('<b>Click to expand list</b>') > > 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",1) > o.list.add("Item Two",2) > o.list.add("Item Three",3) > o.list.add("Item Four",4) > > o.addChild(o.list) > o.addChild(o.label) > > o.label.events = new EventListener(o.label) > o.label.events.onmousedown=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.label.addEventListener(o.label.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 > |