[royale-asjs] 02/03: untested dragrdrop implementation for spark list

2020-10-19 Thread yishayw
This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 0c56557953f0b84853083ac83f1c6c61d240e5a8
Author: Yishay Weiss 
AuthorDate: Mon Oct 19 10:43:01 2020 +0100

untested dragrdrop implementation for spark list
---
 .../src/main/royale/spark/components/List.as   | 39 ++
 1 file changed, 39 insertions(+)

diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
index 9aca1e8..b24ef0a 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
@@ -55,10 +55,15 @@ import spark.events.RendererExistenceEvent;
 import spark.layouts.supportClasses.DropLocation;
 
  */  //ListBase and List share selection properties that are mx_internal
+import org.apache.royale.html.beads.SingleSelectionDragSourceBead;
+import org.apache.royale.html.beads.SingleSelectionDragImageBead;
+import org.apache.royale.html.beads.SingleSelectionDropTargetBead;
+import org.apache.royale.html.beads.SingleSelectionDropIndicatorBead;
 import mx.managers.IFocusManagerComponent;
 import spark.components.supportClasses.ListBase;
 import mx.core.mx_internal;
 use namespace mx_internal;
+[Event(name="dragCompleteHandler", type="org.apache.royale.events.DragEvent")]
 //--
 //  Styles
 //--
@@ -562,6 +567,40 @@ public class List extends ListBase implements 
IFocusManagerComponent
// not implemented
}
 
+   private var _dragEnabled:Boolean = false;
+   public function get dragEnabled():Boolean
+   {
+   return _dragEnabled;
+   }
+   public function set dragEnabled(value:Boolean):void
+   {
+   _dragEnabled = value;
+   }
+
+   private var _dropEnabled:Boolean = false;
+   public function get dropEnabled():Boolean
+   {
+   return _dropEnabled;
+   }
+   public function set dropEnabled(value:Boolean):void
+   {
+   _dropEnabled = value;
+   }
+
+   override public function addedToParent():void
+   {
+   super.addedToParent();
+
+   if (dragEnabled) {
+   addBead(new SingleSelectionDragSourceBead());
+   addBead(new SingleSelectionDragImageBead());
+   }
+   if (dropEnabled) {
+   addBead(new SingleSelectionDropTargetBead());
+   addBead(new SingleSelectionDropIndicatorBead());
+   }
+   }
+
 public function set itemRendererFunction(value:Function):void
 {
// not implemented



[royale-asjs] 02/03: untested dragrdrop implementation for spark list

2020-10-19 Thread yishayw
This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 0c56557953f0b84853083ac83f1c6c61d240e5a8
Author: Yishay Weiss 
AuthorDate: Mon Oct 19 10:43:01 2020 +0100

untested dragrdrop implementation for spark list
---
 .../src/main/royale/spark/components/List.as   | 39 ++
 1 file changed, 39 insertions(+)

diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
index 9aca1e8..b24ef0a 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
@@ -55,10 +55,15 @@ import spark.events.RendererExistenceEvent;
 import spark.layouts.supportClasses.DropLocation;
 
  */  //ListBase and List share selection properties that are mx_internal
+import org.apache.royale.html.beads.SingleSelectionDragSourceBead;
+import org.apache.royale.html.beads.SingleSelectionDragImageBead;
+import org.apache.royale.html.beads.SingleSelectionDropTargetBead;
+import org.apache.royale.html.beads.SingleSelectionDropIndicatorBead;
 import mx.managers.IFocusManagerComponent;
 import spark.components.supportClasses.ListBase;
 import mx.core.mx_internal;
 use namespace mx_internal;
+[Event(name="dragCompleteHandler", type="org.apache.royale.events.DragEvent")]
 //--
 //  Styles
 //--
@@ -562,6 +567,40 @@ public class List extends ListBase implements 
IFocusManagerComponent
// not implemented
}
 
+   private var _dragEnabled:Boolean = false;
+   public function get dragEnabled():Boolean
+   {
+   return _dragEnabled;
+   }
+   public function set dragEnabled(value:Boolean):void
+   {
+   _dragEnabled = value;
+   }
+
+   private var _dropEnabled:Boolean = false;
+   public function get dropEnabled():Boolean
+   {
+   return _dropEnabled;
+   }
+   public function set dropEnabled(value:Boolean):void
+   {
+   _dropEnabled = value;
+   }
+
+   override public function addedToParent():void
+   {
+   super.addedToParent();
+
+   if (dragEnabled) {
+   addBead(new SingleSelectionDragSourceBead());
+   addBead(new SingleSelectionDragImageBead());
+   }
+   if (dropEnabled) {
+   addBead(new SingleSelectionDropTargetBead());
+   addBead(new SingleSelectionDropIndicatorBead());
+   }
+   }
+
 public function set itemRendererFunction(value:Function):void
 {
// not implemented