flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [4/5] git commit: [flex-asjs] [refs/heads/tlf] - lookup other cursors in ValuesManager
Date Thu, 22 Jun 2017 18:59:18 GMT
lookup other cursors in ValuesManager


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b9d5e8e1
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b9d5e8e1
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b9d5e8e1

Branch: refs/heads/tlf
Commit: b9d5e8e114e77270c30389d793024a89c43bc037
Parents: 8d5a8e6
Author: Alex Harui <aharui@apache.org>
Authored: Thu Jun 22 11:57:04 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Jun 22 11:57:29 2017 -0700

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/css2/Cursors.as   | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b9d5e8e1/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
index 8671ca0..96ef8f4 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
@@ -19,14 +19,18 @@
 package org.apache.flex.css2
 {
     import org.apache.flex.core.IUIBase;
+    import org.apache.flex.core.ValuesManager;
     import org.apache.flex.events.MouseEvent;
     
     COMPILE::SWF
     {
         import flash.display.DisplayObject;
+        import flash.display.BitmapData;
+        import flash.display.Sprite;
         import flash.geom.Point;
         import flash.ui.Mouse;
         import flash.ui.MouseCursor;
+        import flash.ui.MouseCursorData;
     }
     COMPILE::JS
     {
@@ -67,6 +71,12 @@ package org.apache.flex.css2
         COMPILE::JS
         public static const TEXT:String = "text";
         
+        COMPILE::SWF
+        private static const builtinCursors:Array = [MouseCursor.AUTO, 
+                                                MouseCursor.ARROW,
+                                                MouseCursor.BUTTON,
+                                                MouseCursor.IBEAM];
+        
         /**
          *  Constructor.
          *
@@ -118,6 +128,24 @@ package org.apache.flex.css2
                     obj.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
                     obj.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
                 }
+                if (builtinCursors.indexOf(cursor) == -1)
+                {
+                    var c:Class = ValuesManager.valuesImpl.getValue(obj, cursor) as Class;
+                    if (c)
+                    {
+                        var foo:Object = new c();
+                        var inst:Sprite = new c() as Sprite;
+                        if (inst)
+                        {
+                            var bd:BitmapData = new BitmapData(32, 32, true, 0);
+                            bd.draw(inst);
+                            var mcd:MouseCursorData = new MouseCursorData();
+                            mcd.data = Vector.<BitmapData>([bd]);
+                            Mouse.registerCursor(cursor, mcd);
+                            builtinCursors.push(cursor);
+                        }
+                    }
+                }
                 cursorData.cursor = cursor;
                 
                 var displayObject:DisplayObject = obj as DisplayObject;


Mime
View raw message