floatinglist.lzx
<library>
<include href="lz/basefloatinglist.lzx"/>
<resource name="shadowTR">
<frame src="resources/floatinglist/pop_shadow_flush_top_rt.swf"/>
<frame src="resources/floatinglist/pop_shadow_corner_top_rt.swf"/>
<frame src="resources/floatinglist/pop_shadow_oval_top_rt.swf"/>
</resource>
<resource name="shadowMR" src="resources/floatinglist/pop_shadow_mid_rt.swf"/>
<resource name="shadowBL" src="resources/floatinglist/pop_shadow_bot_lft.swf"/>
<resource name="shadowBM" src="resources/floatinglist/pop_shadow_bot_mid.swf"/>
<resource name="shadowBR" src="resources/floatinglist/pop_shadow_bot_rt.swf"/>
<resource name="menucap_lft">
<frame src="resources/floatinglist/topmenu_lft.swf"/>
<frame src="resources/floatinglist/botmenu_lft.swf"/>
</resource>
<resource name="menucap_mid">
<frame src="resources/floatinglist/topmenu_mid.swf"/>
<frame src="resources/floatinglist/botmenu_mid.swf"/>
</resource>
<resource name="menucap_rt">
<frame src="resources/floatinglist/topmenu_rt.swf"/>
<frame src="resources/floatinglist/botmenu_rt.swf"/>
</resource>
<class name="_floatshadow" oninit="this.setCornerResourceNumber(cornerresourcenumber)">
<attribute name="inset" value="10
"/>
<attribute name="offsety" value="10
"/>
<attribute name="shadowsize" value="5
"/>
<attribute name="bottomvisible" value="true
" setter="this.setBottomVisible( bottomvisible )"/>
<event name="onbottomvisible"/>
<attribute name="cornerresourcenumber" value="0
" setter="this.setCornerResourceNumber(cornerresourcenumber)"/>
<event name="oncornerresourcenumber"/>
<view name="right" y="${classroot.offsety}" x="${parent.width - classroot.inset}" height="${parent.height - classroot.offsety}">
<view name="top" resource="shadowTR"/>
<view resource="shadowMR" stretches="height"/>
<view height="0"/>
<stableborderlayout axis="y"/>
</view>
<view name="bottom" visible="${parent.bottomvisible}" y="${parent.height}" width="${parent.width + parent.right.width - classroot.inset }">
<view resource="shadowBL"/>
<view resource="shadowBM" stretches="width"/>
<view resource="shadowBR"/>
<stableborderlayout axis="x"/>
</view>
<method name="setBottomVisible" args="bv">
this.bottomvisible = bv;
if ( onbottomvisible ) this.onbottomvisible.sendEvent( bv );
this.setCornerResourceNumber(this.cornerresourcenumber);
</method>
<method name="setCornerResourceNumber" args="crn">
if ( !this.bottomvisible ) {
this.cornerresourcenumber = 3;
} else {
// this.cornerresourcenumber = crn;
this.cornerresourcenumber = 2;
}
if ( !isinited ) return;
this.right.top.setAttribute('frame', this.cornerresourcenumber );
if ( oncornerresourcenumber ) this.oncornerresourcenumber.sendEvent();
</method>
</class>
<class name="floatinglist" extends="basefloatinglist">
<attribute name="border_bottom" value="${this._currentattachy == 'bottom' ? 0 : this.bordersize}"/>
<attribute name="border_top" value="${this._currentattachy == 'top' ? 0 : this.bordersize}"/>
<attribute name="shadowcrn" value="0
"/>
<attribute name="shadowoffsety" value="${this._currentattachy == 'bottom' ? 3:-9}"/>
<view name="bkgnd" ignoreplacement="true" width="100%" height="100%">
<_floatshadow name="shdw" bottomvisible="${classroot._currentattachy != 'top'}" offsety="${classroot.shadowoffsety}" cornerresourcenumber="${classroot.shadowcrn}" width="100%" height="100%" opacity=".6"/>
<view name="borderview" width="100%" height="100%" bgcolor="0x808080"/>
</view>
<view name="menucap" y="${parent._currentattachy == 'top'? -height + 1:parent.height }" width="${classroot.width}" ignoreplacement="true" oninit="this.setAttribute('frame', 1)">
<view resource="menucap_lft"/>
<view resource="menucap_mid" stretches="width"/>
<view resource="menucap_rt"/>
<stableborderlayout axis="x"/>
<setter name="frame" args="r">
var L = this.subviews.length;
for ( var i = 0; i < L; i++ ) {
this.subviews[i].setAttribute('frame', r);
}
</setter>
<setter name="y" args="y">
super.setAttribute('y', y);
if ( y < 0 ) {
this.setAttribute('frame', 1);
} else {
this.setAttribute('frame', 2);
}
</setter>
</view>
<method name="_applystyle" args="s">
if (this.style != null) {
setTint(this.menucap, s.basecolor);
}
</method>
<method name="init">
super.init();
this.bkgnd.sendToBack();
this.bringToFront();
</method>
<setter name="bgcolor" args="c">
if ( !isinited ) return;
this.bkgnd.borderview.setAttribute('bgcolor', c);
</setter>
<method name="getMenuCapHeight">
return menucap.height;
</method>
<doc>
<tag name="shortdesc"><text>
a floatinglist appears above other components
</text></tag>
<text>
<p>The <tagname>floatinglist</tagname> tag provides a list that floats
on top of the canvas. It includes an attachment API for popping-up
relative to a target. This attachment API guarantees visibility on the
canvas, such that if the floatinglist intersects the canvas bounds,
the attach location will change to a more visible location.</p>
<example>
<canvas height="100">
<button x="10" y="10" text="owner">
<floatinglist width="80" attach="right">
<textlistitem text="one"/>
<textlistitem text="two"/>
</floatinglist>
</button>
</canvas>
</example>
<seealso>
<component-design id="floatinglist" title="Floating List"/>
</seealso>
</text>
</doc>
</class>
</library>
Cross References
Includes
Resources
Classes
Named Instances