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 > ------------------------------------------------------------------ |