You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/12/09 02:57:31 UTC

[royale-asjs] branch develop updated (e5497e3 -> 1108349)

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

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


    from e5497e3  make filterFunction bindable
     new d02891a  no spark form yet
     new 1108349  MX Form FormItem

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../mxroyale/tourdeflexmodules/src/explorer.xml    |   2 +
 .../MXRoyale/src/main/resources/defaults.css       |  13 +++
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   3 +
 .../MXRoyale/src/main/royale/mx/containers/Form.as |  31 ++++++-
 .../src/main/royale/mx/containers/FormHeading.as   |  14 +++
 .../src/main/royale/mx/containers/FormItem.as      | 103 ++++++++++++++++++++-
 .../FormItemContainer.as}                          |  23 +++--
 .../royale/mx/containers/beads/FormItemView.as}    |  44 +++++----
 .../MXRoyale/src/main/royale/mx/core/Container.as  |   5 +-
 9 files changed, 208 insertions(+), 30 deletions(-)
 copy frameworks/projects/MXRoyale/src/main/royale/mx/containers/{PanelTitleBar.as => beads/FormItemContainer.as} (76%)
 copy frameworks/projects/{SparkRoyale/src/main/royale/spark/components/beads/SkinnableContainerView.as => MXRoyale/src/main/royale/mx/containers/beads/FormItemView.as} (61%)


[royale-asjs] 02/02: MX Form FormItem

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1108349ae24911911eeaf2a3789af412c75a25dc
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sat Dec 8 18:57:16 2018 -0800

    MX Form FormItem
---
 .../MXRoyale/src/main/resources/defaults.css       |  13 +++
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   3 +
 .../MXRoyale/src/main/royale/mx/containers/Form.as |  31 ++++++-
 .../src/main/royale/mx/containers/FormHeading.as   |  14 +++
 .../src/main/royale/mx/containers/FormItem.as      | 103 ++++++++++++++++++++-
 .../mx/containers/beads/FormItemContainer.as       |  63 +++++++++++++
 .../royale/mx/containers/beads/FormItemView.as     |  83 +++++++++++++++++
 .../MXRoyale/src/main/royale/mx/core/Container.as  |   5 +-
 8 files changed, 309 insertions(+), 6 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index c19abb5..2854fa7 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -20,6 +20,7 @@
 @namespace "library://ns.apache.org/royale/mx";
 @namespace charts "mx.charts.chartClasses.*";
 @namespace core "mx.core.*";
+@namespace containerBeads "mx.containers.beads.*";
 
 .royale *, . royale *:before, . royale *:after {
 	-moz-box-sizing: border-box;
@@ -147,6 +148,18 @@ DateField {
 	IPopUp: ClassReference("mx.controls.dateFieldClasses.DateFieldDateChooser");
 }
 
+FormItem
+{
+	IBeadView: ClassReference("mx.containers.beads.FormItemView");
+	IContentView: ClassReference("mx.containers.beads.FormItemContainer");
+	indicatorGap: 0px;
+}
+
+containerBeads|FormItemContainer
+{
+	IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport");
+}
+
 Image
 {
 	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageModel");
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index db25050..ac06a05 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -225,6 +225,9 @@ internal class MXRoyaleClasses
     import mx.controls.beads.models.SingleSelectionICollectionViewModel; SingleSelectionICollectionViewModel;
     import mx.controls.beads.models.SingleSelectionIListModel; SingleSelectionIListModel;
     import mx.controls.buttonBarClasses.TextButtonDataGridColumnItemRenderer; TextButtonDataGridColumnItemRenderer;
+
+    import mx.containers.beads.FormItemView; FormItemView;
+    import mx.containers.beads.FormItemContainer; FormItemContainer;
     
 }
 
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Form.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Form.as
index 23a9ab0..56789d6 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Form.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Form.as
@@ -34,6 +34,7 @@ import mx.core.IUIComponent;
 import mx.core.mx_internal;
 import mx.styles.IStyleManager2;
 //import mx.styles.StyleManager;
+import org.apache.royale.core.IChild;
 
 use namespace mx_internal;
 
@@ -203,6 +204,7 @@ public class Form extends Container
         
         layoutObject.target = this;
         layoutObject.direction = BoxDirection.VERTICAL;
+        addBead(layoutObject);
     }
 
     //--------------------------------------------------------------------------
@@ -296,6 +298,15 @@ public class Form extends Container
         
         return super.addChild(child);
     }
+    
+    /**
+     * @private
+     */
+    override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+    {
+        invalidateLabelWidth();
+        super.addElement(c, dispatchEvent);
+    }
 
     /**
      *  @private
@@ -309,6 +320,15 @@ public class Form extends Container
     }
 
     /**
+     * @private
+     */
+    override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+    {
+        invalidateLabelWidth();
+        super.addElementAt(c, index, dispatchEvent);
+    }
+    
+    /**
      *  @private
      */
     override public function removeChild(child:IUIComponent):IUIComponent
@@ -319,6 +339,15 @@ public class Form extends Container
     }
 
     /**
+     * @private
+     */
+    override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+    {
+        invalidateLabelWidth();
+        super.removeElement(c, dispatchEvent);
+    }
+    
+    /**
      *  @private
      */
     override public function removeChildAt(index:int):IUIComponent
@@ -457,7 +486,7 @@ public class Form extends Container
     {
         // We only need to invalidate the label width
         // after we've been initialized.
-        if (!isNaN(measuredLabelWidth) && initialized)
+        if (!isNaN(measuredLabelWidth)/* && initialized*/)
         {
             measuredLabelWidth = NaN;
 
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormHeading.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormHeading.as
index f6412e4..05ffa8f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormHeading.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormHeading.as
@@ -334,6 +334,20 @@ public class FormHeading extends UIComponent
 
 		return labelWidth;
 	}
+    
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        commitProperties();
+        measure();
+    }
+        
+    override public function setActualSize(w:Number, h:Number):void
+    {
+        super.setActualSize(w, h);
+        updateDisplayList(w, h);
+    }
+
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormItem.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormItem.as
index 7ccbdb6..ea39c65 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormItem.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/FormItem.as
@@ -28,6 +28,7 @@ import org.apache.royale.core.IChild;
 import org.apache.royale.events.Event;
 
 import mx.containers.beads.BoxLayout;
+import mx.containers.beads.FormItemView;
 import mx.containers.utilityClasses.Flex;
 import mx.controls.FormItemLabel;
 import mx.controls.Label;
@@ -241,7 +242,8 @@ public class FormItem extends Container
     public function FormItem()
     {
         super();
-
+        typeNames += " FormItem";
+        
         /*
         _horizontalScrollPolicy = ScrollPolicy.OFF;
         _verticalScrollPolicy = ScrollPolicy.OFF;
@@ -249,6 +251,8 @@ public class FormItem extends Container
         
         verticalLayoutObject.target = this;
         verticalLayoutObject.direction = BoxDirection.VERTICAL;
+        
+        addBead(verticalLayoutObject);
     }
 
     //--------------------------------------------------------------------------
@@ -339,7 +343,7 @@ public class FormItem extends Container
         invalidateProperties();
         invalidateSize();
         invalidateDisplayList();
-
+        
         // Changing the label could affect the overall form label width
         // so we need to invalidate our parent's size here too
        if (parent is Form)
@@ -529,6 +533,7 @@ public class FormItem extends Container
             strandChildren.addElement(labelObj);
             dispatchEvent(new Event("itemLabelChanged"));
         }
+        commitProperties();
     }
     
     /**
@@ -1455,6 +1460,100 @@ public class FormItem extends Container
         return 0;
     }
     
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        commitProperties();
+        measure();
+    }
+    
+    override public function setActualSize(w:Number, h:Number):void
+    {
+        super.setActualSize(w, h);
+        updateDisplayList(w, h);
+    }
+
+    /**
+     * @private
+     * @royaleignorecoercion mx.containers.beads.FormItemView
+     */
+    override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+    {
+        var containerView:FormItemView = view as FormItemView;
+        if (c == containerView.contentArea)
+        {
+            super.addElement(c, dispatchEvent);
+            return;
+        }
+        containerView.contentArea.addElement(c, dispatchEvent);
+        containerView.contentArea.dispatchEvent(new Event("layoutNeeded"));
+    }
+    
+    /**
+     * @private
+     * @royaleignorecoercion mx.containers.beads.FormItemView
+     */
+    override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+    {
+        var containerView:FormItemView = view as FormItemView;
+        containerView.contentArea.addElementAt(c, index, dispatchEvent);
+        containerView.contentArea.dispatchEvent(new Event("layoutNeeded"));
+    }
+    
+    /**
+     * @private
+     * @royaleignorecoercion mx.containers.beads.FormItemView
+     */
+    override public function getElementIndex(c:IChild):int
+    {
+        var containerView:FormItemView = view as FormItemView;
+        return containerView.contentArea.getElementIndex(c);
+    }
+    
+    /**
+     * @private
+     * @royaleignorecoercion mx.containers.beads.FormItemView
+     */
+    override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+    {
+        var containerView:FormItemView = view as FormItemView;
+        containerView.contentArea.removeElement(c, dispatchEvent);
+    }
+    
+    /**
+     * @private
+     * @royaleignorecoercion mx.containers.beads.FormItemView
+     */
+    override public function get numElements():int
+    {
+        var containerView:FormItemView = view as FormItemView;
+        return containerView.contentArea.numElements;
+    }
+    
+    /**
+     * @private
+     * @royaleignorecoercion mx.containers.beads.FormItemView
+     */
+    override public function getElementAt(index:int):IChild
+    {
+        var containerView:FormItemView = view as FormItemView;
+        return containerView.contentArea.getElementAt(index);
+    }
+
 }
 
 }
+
+import mx.core.UIComponent;
+import mx.containers.FormItem;
+import org.apache.royale.core.LayoutBase;
+
+// this blocks other layout beads from doing things
+class FormItemLayout extends LayoutBase
+{
+    override public function layout():Boolean
+    {
+        // don't do anything
+        return false;
+    }
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/FormItemContainer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/FormItemContainer.as
new file mode 100644
index 0000000..46a811f
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/FormItemContainer.as
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers.beads
+{
+
+import mx.containers.Box;
+
+/**
+ *  @private
+ *  The FormItemContainer for emulation.
+ */
+public class FormItemContainer extends Box
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function FormItemContainer()
+	{
+		super();
+        typeNames += " FormItemContainer";
+	}
+    
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        COMPILE::JS
+        {
+            element.style.overflow = "visible";
+        }
+    }
+
+
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/FormItemView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/FormItemView.as
new file mode 100644
index 0000000..37bd002
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/FormItemView.as
@@ -0,0 +1,83 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers.beads
+{
+
+import mx.containers.BoxDirection;
+import mx.containers.Panel;
+import mx.containers.PanelTitleBar;
+import mx.containers.beads.BoxLayout;
+import mx.containers.beads.CanvasLayout;
+import mx.containers.beads.models.PanelModel;
+import mx.core.ContainerLayout;
+import mx.core.UIComponent;
+
+import org.apache.royale.core.IBead;
+import org.apache.royale.core.ILayoutChild;
+import org.apache.royale.core.IStrand;
+import org.apache.royale.core.IViewport;
+import org.apache.royale.core.UIBase;
+import org.apache.royale.html.beads.ContainerView;
+import org.apache.royale.html.beads.layouts.VerticalFlexLayout;
+
+/**
+ *  @private
+ *  The FormItemView for emulation.
+ */
+public class FormItemView extends org.apache.royale.html.beads.ContainerView
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function FormItemView()
+	{
+		super();
+	}
+
+    /**
+     * The content area of the formItem.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.4
+     * 
+     *  @royaleignorecoercion org.apache.royale.core.UIBase;
+     *  @royaleignorecoercion org.apache.royale.core.IViewport;
+     */
+    public function get contentArea():UIBase
+    {
+        return (_strand.getBeadByType(IViewport) as IViewport).contentView as UIBase;
+    }
+
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
index a6657a6..2b8b571 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -639,12 +639,11 @@ public class Container extends UIComponent
      */
     public function get backgroundColor():Object
     {
-        trace("backgroundColor not implemented");
-        return 0;
+        return ValuesManager.valuesImpl.getValue(this, "backgroundColor");
     }
     public function set backgroundColor(value:Object):void
     {
-        trace("backgroundColor not implemented");
+        setStyle("backgroundColor", value);
     }
     
     //----------------------------------


[royale-asjs] 01/02: no spark form yet

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d02891a9a93c1029deda23b4da7396dc11ec5a96
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sat Dec 8 18:56:57 2018 -0800

    no spark form yet
---
 examples/mxroyale/tourdeflexmodules/src/explorer.xml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/mxroyale/tourdeflexmodules/src/explorer.xml b/examples/mxroyale/tourdeflexmodules/src/explorer.xml
index fcc00c6..d9e3eb8 100755
--- a/examples/mxroyale/tourdeflexmodules/src/explorer.xml
+++ b/examples/mxroyale/tourdeflexmodules/src/explorer.xml
@@ -366,7 +366,9 @@
 					<node label="Border" module="spark/containers/BorderExample"/>
                      -->
 					<node label="DataGroup" module="spark/controls/DataGroupExample" />
+                    <!--
 					<node label="Form" module="spark/controls/FormExample" />
+                     -->
 					<node label="HGroup" module="spark/containers/SampleHGroup" />
 					<node label="Group" module="spark/containers/GroupExample"/>
 					<node label="Panel" module="spark/containers/PanelExample"/>