[Laszlo-checkins] r8710 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf

bargull@openlaszlo.org bargull at openlaszlo.org
Wed Apr 16 09:08:10 PDT 2008


Author: bargull
Date: 2008-04-16 09:08:07 -0700 (Wed, 16 Apr 2008)
New Revision: 8710

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
Log:
Change 20080206-bargull-8 by bargull at dell--p4--2-53 on 2008-02-06 22:35:31
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: improve swf cursor-handling

New Features: LPP-5411 - "SWF: make cursor work as in DHTML"

Bugs Fixed:

Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
make cursor more like in dhtml


Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as	2008-04-16 16:01:29 UTC (rev 8709)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as	2008-04-16 16:08:07 UTC (rev 8710)
@@ -1328,6 +1328,10 @@
   * it
   */
 LzSprite.prototype.setShowHandCursor = function ( s ){
+    if (!this.__LZbuttonRef) {
+        this.setClickable( true );
+    }
+    
     if (this.__LZbuttonRef.but){
         this.__LZbuttonRef.but.useHandCursor = s;
     }
@@ -1337,22 +1341,34 @@
 /**
   * Sets the cursor to the given resource when the mouse is over this view
   * @param String cursor: The name of the resource to use as a cursor when it is over
-  * this view.
+  * this view. Or '' for default cursor.
   */
 LzSprite.prototype.setCursor = function( cursor ){
     if (cursor == null) return;
 
-    this._cures = cursor;
-    if (! this._moDel) {
-        this._moDel = new LzDelegate( this , '_cursorGotMouseover',
-                                            this.owner , 'onmouseover');
-        this._muDel = new LzDelegate( LzMouseKernel , 'unlock',
-                                            this.owner , 'onmouseout');
+    if (cursor != '') {
+        this._cures = cursor;
+        if (! this._moDel) {
+            this._moDel = new LzDelegate( this , '_cursorGotMouseover',
+                                                this.owner , 'onmouseover');
+            this._muDel = new LzDelegate( LzMouseKernel , 'restoreCursor',
+                                                this.owner , 'onmouseout');
+        }
+        
+        if (!this.__LZbuttonRef) {
+            this.setClickable( true );
+        }
+    } else {
+        LzMouseKernel.restoreCursor();
+        
+        delete this._cures;
+        if (this._moDel) {
+            this._moDel.unregisterAll();
+            delete this._moDel;
+            this._muDel.unregisterAll();
+            delete this._muDel;
+        }
     }
-
-    if (!this.__LZbuttonRef) {
-        this.setClickable( true );
-    }
 }
 
 /** @access private */



More information about the Laszlo-checkins mailing list