You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2021/08/05 18:52:07 UTC

[royale-asjs] branch divided updated: Get BoxDivider created

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/divided by this push:
     new f89836c  Get BoxDivider created
f89836c is described below

commit f89836c28028938a06f70d96bbc9b7dad1381759
Author: Yishay Weiss <yi...@hotmail.com>
AuthorDate: Thu Aug 5 21:51:56 2021 +0300

    Get BoxDivider created
---
 .../src/main/royale/mx/containers/DividedBox.as    | 60 +++++++++++++++++++---
 .../src/main/royale/mx/containers/HDividedBox.as   |  2 +
 .../src/main/royale/mx/containers/VDividedBox.as   |  4 ++
 3 files changed, 58 insertions(+), 8 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/DividedBox.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/DividedBox.as
index dd18b62..2a410c7 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/DividedBox.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/DividedBox.as
@@ -34,6 +34,7 @@ import mx.core.UIComponent;
 import mx.core.EdgeMetrics;
 import org.apache.royale.geom.Point;
 import org.apache.royale.core.ValuesManager;
+import org.apache.royale.core.IChild;
 import org.apache.royale.core.IUIBase;
 import mx.containers.beads.BoxLayout;
 import mx.containers.beads.DividedBoxLayout;
@@ -225,9 +226,9 @@ public class DividedBox extends Box
 	{
 		super();
 
-        addEventListener(ChildExistenceChangedEvent.CHILD_ADD, childAddHandler);
-		addEventListener(ChildExistenceChangedEvent.CHILD_REMOVE, 
-						 childRemoveHandler);
+        //addEventListener(ChildExistenceChangedEvent.CHILD_ADD, childAddHandler);
+		//addEventListener(ChildExistenceChangedEvent.CHILD_REMOVE, 
+						 //childRemoveHandler);
 	}
     
 	override protected function createLayout():void
@@ -1445,10 +1446,8 @@ public class DividedBox extends Box
 	/**
 	 *  @private
 	 */
-	private function childAddHandler(event:ChildExistenceChangedEvent):void
+	private function childAddHandler(child:UIComponent):void
 	{
-		var child:UIComponent = event.relatedObject;
-
 		child.addEventListener("includeInLayoutChanged",
                                child_includeInLayoutChangedHandler);
 
@@ -1468,12 +1467,57 @@ public class DividedBox extends Box
 		dbPreferredHeight = NaN;
 	}
 
+        /**
+         *  @copy org.apache.royale.core.IParent#addElementAt()
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.8
+		 *  @royaleignorecoercion org.apache.royale.core.IUIBase
+         */
+        override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+	{
+		super.addElementAt(c, index, dispatchEvent);
+		childAddHandler(c as UIComponent);
+	}
+
+	/**
+	 *  @copy org.apache.royale.core.IParent#addElement()
+	 * 
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.8
+	 *  @royaleignorecoercion org.apache.royale.core.IUIBase
+	 */
+	override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+	{
+		super.addElement(c, dispatchEvent);
+		childAddHandler(c as UIComponent);
+	}
+
+
+	/**
+	 *  @copy org.apache.royale.core.IParent#removeElement()
+	 * 
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.8
+	 *  @royaleignorecoercion org.apache.royale.core.IUIBase
+	 */
+	override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+	{
+		super.removeElement(c, dispatchEvent);
+		childRemoveHandler(c as UIComponent);
+	}
+
 	/**
 	 *  @private
 	 */
-	private function childRemoveHandler(event:ChildExistenceChangedEvent):void
+	private function childRemoveHandler(child:UIComponent):void
 	{
-		var child:UIComponent = event.relatedObject;
 		
         child.removeEventListener("includeInLayoutChanged",
                                   child_includeInLayoutChangedHandler);
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/HDividedBox.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/HDividedBox.as
index 42279ef..ce2b3f3 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/HDividedBox.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/HDividedBox.as
@@ -19,6 +19,7 @@
 
 package mx.containers
 {
+import mx.containers.dividedBoxClasses.BoxDivider;
 /*
 import mx.core.mx_internal;
 use namespace mx_internal;
@@ -93,6 +94,7 @@ public class HDividedBox extends DividedBox
 		typeNames = "HDividedBox";
 		
 		super.direction = BoxDirection.HORIZONTAL;				
+		dividerClass = BoxDivider;
 	}
 
 	//--------------------------------------------------------------------------
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/VDividedBox.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/VDividedBox.as
index 5515253..6028608 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/VDividedBox.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/VDividedBox.as
@@ -20,6 +20,8 @@
 package mx.containers
 {
 
+import mx.containers.dividedBoxClasses.BoxDivider;
+
 /**
  *  The VDividedBox container lays out its children vertically
  *  in the same way as the VBox container, but it inserts
@@ -90,6 +92,7 @@ public class VDividedBox extends DividedBox
 		typeNames = "VDividedBox";
 
 		super.direction = BoxDirection.VERTICAL;				
+		dividerClass = BoxDivider;
 	}
 
 	//--------------------------------------------------------------------------
@@ -111,6 +114,7 @@ public class VDividedBox extends DividedBox
 	override public function set direction(value:String):void
 	{
 	}
+
 }
 
 }