From: Alan M. <amu...@ra...> - 2001-01-22 18:13:47
Attachments:
list.zip
|
Last week, I volunteered (on the help list) to further improve the list widget (which I am using as a menu navigator). I made a few changes and am hoping Robert (or another core developer) can check this into CVS. All my changes are noted with my initials "AM:" 1. I added the method List.setFont(face, size) to allow a web-developer to set a font for the all the list items. 2. I added a property to List "canDeselectAll" which (when false, the default) prevents the user from deselecting the selected item in the list. This property/feature is ignored when in multiMode. Apart from adding and initializing the property, I altered the following list item event handler to implement it: ListItem.listevents.onmousedown = function (e) { var o = e.getSource(); // AM: Prevent the user from deselecting if canDeselectAll is not true. // Of course multi-mode negates this option: if ((o.list.canDeselectAll) || o.list.multiMode || !o.selected) { o.setSelected(!o.selected); } }; 3. I added setFontColor() call in ListItem.setColors(). This is essentially a "bug fix". Apologies for attaching the file (zipped), but I figure that is the easiest way to get it to the core developers who can check it into CVS . To see an example of this list in action (with a very preliminary web site), go to: http://pweb.netcom.com/~amukamal/BWG/BWGFrames.html Please let me know when my changes are incorporated into the current snapshot. Thanks! -Alan ------------------------------------------------------------------ |
From: Robert R. <rra...@ya...> - 2001-01-22 20:31:29
|
We should really create a style object (there use to be one). This object would define all the different methods needed to change font styles. It would also allow for the writing of font strings. Then, this object could be used by many of the widgets. Most of the widgets now do not allow the changing of font styles very easily because that is really the last thing you do once the widgets are stable. -- // Robert Rainwater On 1/22/2001, 1:12:56 PM EST, Alan wrote about "[Dynapi-Widgetdev] "Menu" list.js widget fixes": > Last week, I volunteered (on the help list) to further improve the list > widget (which I am using as a menu navigator). > I made a few changes and am hoping Robert (or another core developer) can > check this into CVS. > All my changes are noted with my initials "AM:" > 1. I added the method List.setFont(face, size) to allow a web-developer to > set a font for the all the list items. > 2. I added a property to List "canDeselectAll" which (when false, the > default) prevents the user from deselecting the selected item in the > list. This property/feature is ignored when in multiMode. Apart from > adding and initializing the property, I altered the following list item > event handler to implement it: > ListItem.listevents.onmousedown = function (e) { > var o = e.getSource(); > // AM: Prevent the user from deselecting if canDeselectAll is not > true. > // Of course multi-mode negates this option: > if ((o.list.canDeselectAll) || o.list.multiMode || !o.selected) { > o.setSelected(!o.selected); > } > }; > 3. I added setFontColor() call in ListItem.setColors(). This is > essentially a "bug fix". > Apologies for attaching the file (zipped), but I figure that is the easiest > way to get it to the core developers who can check it into CVS . > To see an example of this list in action (with a very preliminary web > site), go to: > http://pweb.netcom.com/~amukamal/BWG/BWGFrames.html > Please let me know when my changes are incorporated into the current snapshot. > Thanks! > -Alan > ------------------------------------------------------------------ |
From: Alan M. <amu...@ra...> - 2001-01-22 20:50:12
|
A style object is a good idea, but I am not advanced enough in DynAPI to undertake something so generic. In the meantime, does it make sense to add my changes to the snapshot to make the widget more useful? At 03:30 PM 1/22/01 -0500, you wrote: >We should really create a style object (there use to be one). This >object would define all the different methods needed to change font >styles. It would also allow for the writing of font strings. Then, >this object could be used by many of the widgets. Most of the widgets >now do not allow the changing of font styles very easily because that >is really the last thing you do once the widgets are stable. >-- >// Robert Rainwater Nicola pointed out that my menu list fails in NS6. (Thanks Nicola!) I caught your message... On the dev list, At 03:26 PM 1/22/01 -0500, Robert Rainwater wrote: >That is not really a fix that we should use though. The reason the >resize doesn't work is that getContentHeight and getContentWidth in NS >6 doesnt work. If we fix these two methods in the DynLayer, then that >should solve a lot of problems. > >-- >// Robert Rainwater Who? When? I was just looking at this problem because Nicola suggested it is why the "menu" list is not working correctly in NS 6. With some debugging, I can say that Nicola is correct. The setContentHeight() method does not work in label.js Is someone working on this problem? Also, Robert, I sent a new version of list.js to the widgetdev list. Did you see it? Thanks, Alan ------------------------------------------------------------- |