Change 20100511-maxcarlson-v by [email protected] on 2010-05-11
19:23:25 MDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add wrapper for runtime printing APIs
Bugs Fixed: LPP-8971 - Drawview is incorrectly printed when clip of
wrapper-view is true
Technical Reviewer: hminsky
QA Reviewer: ptw
Release Notes: It's now possible to access the printer from all runtimes. See
the printer class for an example and more information.
Details: Looking over LPP-8971, I realizefd we should really be providing a
wrapper that exposes printing across runtimes.
lzx-autoincludes - Add printer.lzx
printer.lzx - Add printing support in a way that works across AS3, AS3 and
DHTML.
Tests: See example embedded in the documentation:
<canvas>
<view id="main" x="10" y="10">
<simplelayout axis="y" spacing="10"/>
<view>
<simplelayout axis="y" spacing="5"/>
<button text="draw line from (10,10) to (50, 50)">
<handler name="onclick">
main.drawLine(drawView, 10, 10, 50, 50);
</handler>
</button>
<button text="draw line from (100,100) to (150, -300)">
<handler name="onclick">
main.drawLine(drawView, 100, 100, 150, -300);
</handler>
</button>
<button text="draw line from (70,70) to (70, -20000)">
<handler name="onclick">
main.drawLine(drawView, 70, 70, 70, -20000);
</handler>
</button>
<button text="Print">
<handler name="onclick">
main.printView();
</handler>
</button>
</view>
<view id="wrapper" width="300" height="200" clip="true"
bgcolor="0xCCCCCC">
<drawview id="drawView" width="300" height="200">
</drawview>
</view>
<method name="drawLine" args="drawview, xFrom, yFrom, xTo, yTo">
drawview.beginPath();
drawview.moveTo(xFrom, yFrom);
drawview.lineTo(xTo, yTo);
drawview.strokeStyle = 0x000000;
drawview.lineWidth = 2;
drawview.stroke();
drawview.closePath()
</method>
<printer id="printer"/>
<method name="printView">
if(printer.start()){
printer.addPage(drawView, 0, 0, drawView.width,
drawView.height);
printer.send();
}
</method>
</view>
</canvas>
Files:
M WEB-INF/lps/misc/lzx-autoincludes.properties
A lps/components/extensions/printer.lzx
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100511-maxcarlson-v.tar