icontab.lzx
<library>
<resource name="icontab_left_rsc">
<frame src="resources/tabs/tab_slct_lft.swf"/>
<frame src="resources/tabs/tab_dslct_lft.swf"/>
<frame src="resources/tabs/tab_mo_lft.swf"/>
</resource>
<resource name="icontab_middle_rsc">
<frame src="resources/tabs/tab_slct_mid.swf"/>
<frame src="resources/tabs/tab_dslct_mid.swf"/>
<frame src="resources/tabs/tab_mo_mid.swf"/>
</resource>
<resource name="icontab_right_rsc">
<frame src="resources/tabs/tab_slct_rt.swf"/>
<frame src="resources/tabs/tab_dslct_rt.swf"/>
<frame src="resources/tabs/tab_mo_rt.swf"/>
</resource>
<class name="icontab" extends="baselistitem" onmouseover="this.doMouseOver()" onmouseout="this.doMouseOut()">
<attribute name="text" type="html"/>
<attribute name="iconname" value="
" type="string"/>
<attribute name="icon_y" value="0
"/>
<attribute name="inset_x" value="10
"/>
<attribute name="label_y" value="-1
"/>
<view name="tabs" width="${parent.width}">
<stableborderlayout axis="x"/>
<view name="l" resource="icontab_left_rsc"/>
<view name="m" resource="icontab_middle_rsc" stretches="width"/>
<view name="r" resource="icontab_right_rsc"/>
</view>
<view name="content" x="${classroot.inset_x}" y="${classroot.selected ? 0 : 1}">
<simplelayout axis="x" spacing="3"/>
<view name="icon" resource="$once{classroot.iconname + '_icon_rsc'}" y="${classroot.icon_y}"/>
<text name="label" resize="true" x="${parent.icon.x + parent.icon.width + 4}" text="${classroot.text}" y="${classroot.label_y}"/>
</view>
<handler name="oninit">
if (!this.selected) {
this.setFrame(2);
}
</handler>
<method name="setHilite" args="h">
if(h) this.doMouseOver();
else this.doMouseOut();
</method>
<method name="doMouseOver">
if(!selected)
{
this.setFrame(3);
//this.content.label.setAttribute("fgcolor", 0xffffff);
}
</method>
<method name="doMouseOut">
if(!selected)
{
this.setFrame(2);
// this.content.label.setAttribute("fgcolor", 0x40408B);
}
</method>
<method name="_applystyle" args="s">
if (this.style != null) {
this.setTint(this.tabs, s.basecolor, 40);
this.content.label.setAttribute("fgcolor", s.textcolor);
if (s["font"]) this.content.label.setAttribute("font", s.font);
if (s["fontsize"]) this.content.label.setAttribute("fontsize", s.fontsize);
}
</method>
<method name="setSelected" args="sel">
super.setSelected(sel);
if (sel==true){
this.setFrame(1);
this.content.setAttribute("y", 6);
this.bringToFront();
} else{
this.content.setAttribute("y", 7);
this.doMouseOut();
}
</method>
<method name="setFrame" args="f">
this.tabs.l.setAttribute('frame', f);
this.tabs.m.setAttribute('frame', f);
this.tabs.r.setAttribute('frame', f);
</method>
</class>
</library>
Cross References
Resources
Classes
- <class name="icontab" extends="baselistitem">