window-tutorial-$8.lzx
<canvas width="100%" height="300">
<view name="mediaWindow" x="10" y="10" width="200" height="150" clickable="true">
<dragstate name="dragger"/>
<view name="topRow" width="${parent.width}">
<view name="topLeft" resource="resources/media_win_top_left.swf" x="0" y="0" onmousedown="parent.parent.dragger.apply();" onmouseup="parent.parent.dragger.remove();"/>
<view name="topCenter" resource="resources/media_win_top.swf" x="${parent.topLeft.width}" y="10" width="${parent.width - parent.topLeft.width - parent.topRight.width}" stretches="width" onmousedown="parent.parent.dragger.apply();" onmouseup="parent.parent.dragger.remove();"/>
<view name="topRight" resource="resources/media_win_top_right.swf" x="${parent.width - this.width}" y="10"/>
</view>
<view name="body" width="${parent.width}">
<stableborderlayout axis="x"/>
<view name="leftSide" resource="resources/media_win_side.swf" height="${parent.height}" stretches="height"/>
<view name="content" height="${parent.height}" bgcolor="#BB95C0">
<text>Hello, World!</text>
</view>
<view name="rightSide" resource="resources/media_win_side.swf" height="${parent.height}" stretches="height"/>
</view>
<view name="bottomRow" width="${parent.width}">
<view name="bottomLeft" resource="resources/media_win_bottom_left.swf"/>
<view name="bottomCenter" resource="resources/media_win_bottom.swf" stretches="width"/>
<view name="bottomRight" resource="resources/media_win_bottom_right.swf" onmousedown="parent.parent.startResize();" onmouseup="parent.parent.stopResize();"/>
<stableborderlayout axis="x"/>
</view>
<stableborderlayout axis="y"/>
<method name="startResize">
// set distances from right and bottom edges
this.resizeOffsetX = this.width
- this.getMouse('x');
this.resizeOffsetY = this.height
- this.getMouse('y');
if (!this['sizerDel']) {
this.sizerDel = new LzDelegate(this, 'adjustSize',
lz.Idle, 'onidle');
}
</method>
<method name="adjustSize" args="v">
var newWidth = this.getMouse('x') + this.resizeOffsetX;
var newHeight = this.getMouse('y') + this.resizeOffsetY;
this.setAttribute('width', newWidth);
this.setAttribute('height', newHeight);
</method>
<method name="stopResize">
this.sizerDel.unregisterAll();
this.sizerDel = null;
</method>
</view>
</canvas>
Cross References
Named Instances