|
From: Alan M. <amu...@ra...> - 2001-01-22 18:13:47
|
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
------------------------------------------------------------------ |