flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [09/50] git commit: [flex-asjs] [refs/heads/feature/strand-work] - DragMouseController now dispatches events with itself as target; useful in MXML files.
Date Tue, 08 Aug 2017 21:15:45 GMT
DragMouseController now dispatches events with itself as target; useful in MXML files.


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

Branch: refs/heads/feature/strand-work
Commit: 01bc1dd0220b6244940efa05d632546370bf8f4d
Parents: 28bf352
Author: Peter Ent <pent@apache.org>
Authored: Wed Jul 26 13:59:13 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Wed Jul 26 13:59:13 2017 -0400

----------------------------------------------------------------------
 .../projects/DragDrop/src/main/config/compile-swf-config.xml  | 1 +
 .../src/main/flex/org/apache/flex/events/DragEvent.as         | 7 ++++++-
 .../apache/flex/html/beads/controllers/DragMouseController.as | 5 +++++
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01bc1dd0/frameworks/projects/DragDrop/src/main/config/compile-swf-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/config/compile-swf-config.xml b/frameworks/projects/DragDrop/src/main/config/compile-swf-config.xml
index 9fd8bab..a5adbcf 100644
--- a/frameworks/projects/DragDrop/src/main/config/compile-swf-config.xml
+++ b/frameworks/projects/DragDrop/src/main/config/compile-swf-config.xml
@@ -33,6 +33,7 @@
             <path-element>../../../../../libs/Core.swc</path-element>
             <path-element>../../../../../libs/Basic.swc</path-element>
             <path-element>../../../../../libs/Collections.swc</path-element>
+            <path-element>../../../../../libs/Graphics.swc</path-element>
         </external-library-path>
         
 		<mxml>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01bc1dd0/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/events/DragEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/events/DragEvent.as
b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/events/DragEvent.as
index 0731c75..066ce74 100644
--- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/events/DragEvent.as
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/events/DragEvent.as
@@ -29,6 +29,10 @@ package org.apache.flex.events
         import window.MouseEvent;
         import org.apache.flex.events.utils.EventUtils;
     }
+	COMPILE::SWF
+	{
+		import flash.display.InteractiveObject;
+	}
     
 	/**
 	 *  Drag and Drop Events.
@@ -360,7 +364,7 @@ package org.apache.flex.events
                 de.shiftKey = event.shiftKey;
                 de.buttonDown = event.buttonDown;
                 de.delta = event.delta;
-                de.relatedObject = event.relatedObject;
+                de.relatedObject = event.target as InteractiveObject;
 				
 				var localPoint:Point = new Point(event.screenX, event.screenY);
 				var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
@@ -376,6 +380,7 @@ package org.apache.flex.events
 				de.altKey = event.altKey;
 				de.ctrlKey = event.ctrlKey;
 				de.shiftKey = event.shiftKey;
+				de.relatedObject = event.target;
 				
 				var localPoint:Point = new Point(event.screenX, event.screenY);
 				var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01bc1dd0/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/controllers/DragMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/controllers/DragMouseController.as
b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/controllers/DragMouseController.as
index 38b1b1f..c7ac3ba 100644
--- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/controllers/DragMouseController.as
+++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/controllers/DragMouseController.as
@@ -218,6 +218,7 @@ package org.apache.flex.html.beads.controllers
 					dragEvent.clientY = mouseDownY;
 					trace("DRAG-MOUSE: sending dragStart via "+event.target.toString());
 					DragEvent.dispatchDragEvent(dragEvent, event.target);
+					dispatchEvent(dragEvent);
 					
                     if (DragEvent.dragSource != null)
                     {
@@ -234,6 +235,8 @@ package org.apache.flex.html.beads.controllers
 						}
 						COMPILE::JS {
 							dragImage.element.style['pointer-events'] = 'none';
+							dragImage.element.style['position'] = 'absolute';
+							dragImage.element.style['cursor'] = 'pointer';
 						}
                     }
                 }
@@ -246,6 +249,7 @@ package org.apache.flex.html.beads.controllers
                 dragImage.x = pt.x + dragImageOffsetX;
                 dragImage.y = pt.y + dragImageOffsetY;
                 DragEvent.dispatchDragEvent(dragEvent, event.target);
+				dispatchEvent(dragEvent);
             }
         }
         
@@ -265,6 +269,7 @@ package org.apache.flex.html.beads.controllers
 				dragEvent.clientY = newPoint.y;
 				
                 DragEvent.dispatchDragEvent(dragEvent, event.target);
+				dispatchEvent(dragEvent);
                 event.preventDefault();
             }
 			


Mime
View raw message