You want to have this function:
---
private function setTextfieldCursor (lzsprite:LzSprite) :void {
var cursor:String = null;
if (lzsprite.clickable) {
var usehand:Boolean = (lzsprite.showhandcursor == null) ?
LzMouseKernel.showhandcursor : lzsprite.showhandcursor;
// need to respect global cursor setting
if (usehand && ! LzMouseKernel.hasGlobalCursor) {
if ($swf10) { cursor = MouseCursor.BUTTON; }
}
}
if (lzsprite.cursorResource != null) {
cursor = lzsprite.cursorResource;
}
if (cursor != null) {
this._usecursor = true;
LzMouseKernel.setCursorLocal(cursor);
}
}
---
Your change needs to be changed to:
---
if (type == MouseEvent.MOUSE_OVER) {
setTextfieldCursor(this);
}
---
And __forwardMouseEventToSprite() needs to be changed to:
---
// display hand-cursor or custom cursor
if (type == MouseEvent.MOUSE_OVER) {
if (obj is LzSprite) {
setTextfieldCursor(LzSprite(obj));
}
}
---
On 5/25/2010 6:24 PM, Henry Minsky wrote:
Change 20100525-hqm-t by [email protected] on 2010-05-25 12:17:38 EDT
in /Users/hqm/openlaszlo/trunk1
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: set cursor to hand-select resource when mouse over clickable text view
New Features:
Bugs Fixed: LPP-8710
Technical Reviewer: andre
QA Reviewer: max
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Details:
In handleTextfieldMouse() method, if the text sprite is set as clickable, force
the cursor to the system BUTTON cursor.
This code is a copy of the code from __forwardMouseEventToSprite which
operates on subclasses of Sprite rather than TextField, I wasn't sure
how to factor it out nicely.
Tests:
In swf10, when mouse is moved over this text field, it should change the cursor
to the button select
resource (hand with pointing finger)
<canvas layout="axis:y">
<text onclick="Debug.info('click')">Clickable text should show a hand
cursor</text>
</canvas>
Files:
M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100525-hqm-t.tar