newvscrollbar.lzx
<library>
<include href="base/basescrollbar.lzx"/>
<include href="newvscrollbar_resources.lzx"/>
<class name="newvscrollbar" extends="basescrollbar" styleable="true" bgcolor="0x595959" visible="${this.scrollable && (this.height > 21)}" axis="y">
<attribute name="width" value="17
"/>
<attribute name="_obgcolor" value="$once{this.bgcolor}"/>
<view height="13" name="toparrow">
<basescrollarrow x="1" y="1" resource="newvscrollbar_ybuttontop_rsc" direction="-1"/>
</view>
<view name="scrolltrack">
<basescrolltrack name="top" x="1" y="1" resource="newvscrollbar_ytrack_rsc" stretches="height" overResourceNumber="0" downResourceNumber="2" direction="-1">
<attribute name="height" value="${parent.thumb.y}"/>
<attribute name="width" value="${parent.width}"/>
</basescrolltrack>
<basescrollthumb name="thumb" x="1">
<view resource="newvscrollbar_ythumbtop_rsc"/>
<view resource="newvscrollbar_ythumbmiddle_rsc" stretches="both"/>
<view resource="newvscrollbar_ythumbbottom_rsc"/>
<stableborderlayout axis="y"/>
<view resource="newvscrollbar_ythumbgripper_rsc" x="2" height="${Math.min(200, parent.height-16)}" width="11" clip="true" valign="middle"/>
</basescrollthumb>
<basescrolltrack name="bottom" x="1" resource="newvscrollbar_ytrack_rsc" stretches="height" overResourceNumber="0" downResourceNumber="2">
<attribute name="y" value="${parent.thumb.y+parent.thumb.height}"/>
<attribute name="height" value="${parent.height - parent.thumb.y - parent.thumb.height}"/>
<attribute name="width" value="${parent.width}"/>
</basescrolltrack>
</view>
<view height="14" name="bottomarrow">
<basescrollarrow x="1" y="1" resource="newvscrollbar_ybuttonbottom_rsc"/>
</view>
<stableborderlayout axis="y"/>
<method name="_applystyle" args="s">
if (s != null) {
this.setTint(this, s.basecolor);
this.setTint(this.toparrow, s.basecolor);
this.setTint(this.scrolltrack, s.basecolor);
this.setTint(this.bottomarrow, s.basecolor);
}
</method>
<method name="_showEnabled">
super._showEnabled();
var enabled = this._enabled;
if ( ! enabled ) {
this._obgcolor = this.bgcolor;
}
this.setAttribute('opacity', enabled ? 1 : 0.6 );
this.setAttribute('bgcolor', enabled ? this._obgcolor : parent.bgcolor );
this.thumb.setAttribute('clickable', enabled );
this.thumb.setAttribute('visible', true);
</method>
</class>
</library>
Cross References
Includes
Classes