listitem.lzx
<library>
<include href="base/baselistitem.lzx"/>
<class name="listitem" width="100%" extends="baselistitem">
<attribute name="height" value="20
"/>
<attribute name="_selectonevent" value="onmousetrackup
"/>
<attribute name="_ipclassroot" value="$once{immediateparent.classroot}"/>
<attribute name="hilited" value="false
"/>
<handler name="onmousetrackover">
_ipclassroot.setHilite( this );
</handler>
<handler name="onmouseover">
if ( !immediateparent.tracking ) {
_ipclassroot.setHilite( this );
}
</handler>
<handler name="onmouseout">
if ( !immediateparent.tracking ) {
_ipclassroot.setHilite( null );
}
</handler>
<method name="setSelected" args="isSelected">
super.setSelected(isSelected);
if (this._initcomplete) _applystyle(this.style);
</method>
<method name="setHilite" args="ishilited">
if (ishilited != this.hilited) {
this.hilited = ishilited;
if (this._initcomplete) _applystyle(this.style);
}
</method>
<handler name="ontrackgroup" reference="immediateparent.classroot" args="tg">
// TODO: check to see if this is working?
lz.Track.register(this,tg);
</handler>
<method name="_applystyle" args="s">
if (this.style != null) {
if (_enabled) {
if (selected)
this.setAttribute('bgcolor', style.selectedcolor)
else if ( hilited )
this.setAttribute('bgcolor', style.hilitecolor);
else
this.setAttribute('bgcolor', style.textfieldcolor);
} else {
this.setAttribute('bgcolor', style.textfieldcolor);
}
}
</method>
<method name="_showEnabled">
setAttribute('clickable', _enabled);
if (_initcomplete) {
_applystyle(this.style);
}
</method>
<doc>
<tag name="shortdesc"><text>
a listitem is an element of a list
</text></tag>
<text>
<p>A <classname>listitem</classname> is an element with a value that
is contained within a list. As with
<classname>baselistitem</classname>, the selected attribute will be
true when selected.</p>
<example>
<canvas height="80">
<list>
<listitem value="1" selected="true"/>
<listitem value="2" />
</list>
</canvas>
</example>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes
- <class name="listitem" extends="baselistitem">