[Laszlo-checkins] r16574 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/swf9 WEB-INF/lps/server/src/org/openlaszlo/compiler lps/components/lz/resources
hqm@openlaszlo.org
hqm at openlaszlo.org
Wed Jun 2 08:22:11 PDT 2010
Author: hqm
Date: 2010-06-02 08:22:08 -0700 (Wed, 02 Jun 2010)
New Revision: 16574
Added:
openlaszlo/trunk/lps/components/lz/resources/handcursor.png
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
Log:
Change 20100601-hqm-6 by hqm at badtzmaru.home on 2010-06-01 17:23:21 EDT
in /Users/hqm/openlaszlo/trunk2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix for clickable text handcursor in swf9
New Features:
Bugs Fixed: LPP-8710
Technical Reviewer: max
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Add an explicit hand cursor resource for swf9, to allow cursor to be changed
to handcursor when mouse over clickable text
Details:
Tests:
Test case below, run with lzr=swf9, mouse cursor should change to button hand when mouseover
text view.
<canvas>
<text onclick="Debug.warn('click')">Clickable text should show a hand cursor</text>
</canvas>
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as 2010-06-02 14:59:28 UTC (rev 16573)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as 2010-06-02 15:22:08 UTC (rev 16574)
@@ -154,7 +154,12 @@
LzMouseKernel.showhandcursor : lzsprite.showhandcursor;
// need to respect global cursor setting
if (usehand && ! LzMouseKernel.hasGlobalCursor) {
- if ($swf10) { cursor = MouseCursor.BUTTON; }
+ if ($swf9) {
+ // This is a workaround for LPP_8710, to make a button cursor in swf9
+ cursor = "__LFCSWF9handcursor";
+ } else {
+ cursor = MouseCursor.BUTTON;
+ }
}
}
if (lzsprite.cursorResource != null) {
Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java 2010-06-02 14:59:28 UTC (rev 16573)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java 2010-06-02 15:22:08 UTC (rev 16574)
@@ -221,7 +221,7 @@
// Utility class to specify an offset, used to set a cursor resource's hotspot
- class Offset2D {
+ static class Offset2D {
String offsetx = null;
String offsety = null;
Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java 2010-06-02 14:59:28 UTC (rev 16573)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java 2010-06-02 15:22:08 UTC (rev 16574)
@@ -19,6 +19,7 @@
import org.openlaszlo.compiler.CompilationEnvironment;
import org.openlaszlo.compiler.ObjectWriter.ImportResourceError;
import org.openlaszlo.compiler.ObjectWriter.Resource;
+import org.openlaszlo.compiler.ResourceCompiler.Offset2D;
import org.openlaszlo.iv.flash.api.text.*;
import org.openlaszlo.iv.flash.api.FlashDef;
import org.openlaszlo.sc.SWF9ParseTreePrinter;
@@ -482,6 +483,17 @@
// Put the canvas sprite on the 'stage'.
addScript("addChild(canvas.sprite)");
+ // TODO [hqm 2010-06] This is a workaround for LPP-8710,
+ // can be removed when swf9 support is dropped.
+ if ("swf9".equals(mEnv.getRuntime())) {
+ // <resource name="__LFCSWF9handcursor" src="resources/handcursor.png"/>
+ Offset2D offset = new Offset2D("-4", "0");
+ importResource(LPS.getComponentsDirectory()+File.separator+
+ "lz"+File.separator+"resources"+File.separator+"handcursor.png", "__LFCSWF9handcursor",
+ offset);
+ }
+
+
// TODO [hqm 2010-05] I'm putting the calls to the lzo
// startup methods here, but they should really go in
// right when they are added in the addLZOFile method
Added: openlaszlo/trunk/lps/components/lz/resources/handcursor.png
Property changes on: openlaszlo/trunk/lps/components/lz/resources/handcursor.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the Laszlo-checkins
mailing list