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 2019/12/11 22:25:03 UTC

[royale-asjs] branch develop updated: pay attention to rowHeight

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


The following commit(s) were added to refs/heads/develop by this push:
     new df5998d  pay attention to rowHeight
df5998d is described below

commit df5998d3829912b24ed86fe462774a4d5787623b
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Dec 11 14:24:40 2019 -0800

    pay attention to rowHeight
---
 .../main/royale/mx/controls/AdvancedDataGrid.as    | 11 +++++++-
 .../src/main/royale/mx/controls/DataGrid.as        |  2 +-
 .../mx/controls/beads/AdvancedDataGridView.as      |  1 +
 .../beads/DataGridLinesBeadForICollectionView.as   |  2 +-
 .../royale/mx/controls/listClasses/ListBase.as     | 32 ++++++++++++++++++++++
 5 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/AdvancedDataGrid.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/AdvancedDataGrid.as
index fc84bb2..dcd003e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/AdvancedDataGrid.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/AdvancedDataGrid.as
@@ -9702,7 +9702,7 @@ public class AdvancedDataGrid extends AdvancedListBase implements IDataGrid
      *  @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
      *  @royaleignorecoercion org.apache.royale.core.IBead
      */
-    public function get presentationModel():IBead
+    override public function get presentationModel():IBead
     {
         if (_presentationModel == null) {
             var c:Class = ValuesManager.valuesImpl.getValue(this, "iDataGridPresentationModel");
@@ -9755,6 +9755,15 @@ public class AdvancedDataGrid extends AdvancedListBase implements IDataGrid
         ((view as AdvancedDataGridView).header as DataGridButtonBar).model.dispatchEvent(new Event("dataProviderChanged"));
     }
     
+    override public function set rowHeight(value:Number):void
+    {
+        super.rowHeight = value;
+        if ((view as AdvancedDataGridView).header)
+        {
+            (view as AdvancedDataGridView).header.height = value;
+            dispatchEvent(new Event("layoutNeeded"));
+        }
+    }
 
 }
 
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
index d8d2115..2e9a53f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
@@ -810,7 +810,7 @@ public class DataGrid extends ListBase implements IDataGrid// implements IIMESup
      *  @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
      *  @royaleignorecoercion org.apache.royale.core.IBead
      */
-    public function get presentationModel():IBead
+    override public function get presentationModel():IBead
     {
         if (_presentationModel == null) {
             var c:Class = ValuesManager.valuesImpl.getValue(this, "iDataGridPresentationModel");
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as
index 1b04d3e..5d0bd15 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/AdvancedDataGridView.as
@@ -63,6 +63,7 @@ package mx.controls.beads
             super.handleInitComplete(event);
             
             var host:AdvancedDataGrid = _strand as AdvancedDataGrid;
+            header.height = host.rowHeight;
             
             IEventDispatcher(host).addEventListener("columnsInvalid", handleColumnsInvalid);
             handleColumnsInvalid(null);
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DataGridLinesBeadForICollectionView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DataGridLinesBeadForICollectionView.as
index 818e1fd..9fc6d38 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DataGridLinesBeadForICollectionView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DataGridLinesBeadForICollectionView.as
@@ -101,7 +101,7 @@ package mx.controls.beads
             if (contentView.height > n * rowHeight)
             {
                 var bgColors:Array = (_strand as UIComponent).getStyle("alternatingItemColors");
-                var yy:Number = n * (rowHeight + presentationModel.separatorThickness);
+                var yy:Number = n * rowHeight;
                 
                 var bgFill0:SolidColor = new SolidColor();
                 bgFill0.color = bgColors[0];
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
index 77c59d6..90e688e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
@@ -34,6 +34,7 @@ import mx.utils.UIDUtil;
 import mx.core.ScrollControlBase;
 
 import org.apache.royale.core.ContainerBaseStrandChildren;
+import org.apache.royale.core.IBead;
 import org.apache.royale.core.IBeadLayout;
 import org.apache.royale.core.IBeadView;
 import org.apache.royale.core.IChild;
@@ -46,6 +47,7 @@ import org.apache.royale.core.ILayoutChild;
 import org.apache.royale.core.ILayoutHost;
 import org.apache.royale.core.ILayoutParent;
 import org.apache.royale.core.ILayoutView;
+import org.apache.royale.core.IListPresentationModel;
 import org.apache.royale.core.IParent;
 import org.apache.royale.core.ISelectionModel;
 import org.apache.royale.core.ValuesManager;
@@ -783,6 +785,34 @@ use namespace mx_internal;
             return view as ILayoutHost;
         }
         
+        /**
+         * @private
+         */
+        private var _presentationModel:IListPresentationModel;
+        
+        /**
+         *  The DataGrid's presentation model
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         *  @royaleignorecoercion org.apache.royale.core.IListPresentationModel
+         *  @royaleignorecoercion org.apache.royale.core.IBead
+         */
+        public function get presentationModel():IBead
+        {
+            if (_presentationModel == null) {
+                var c:Class = ValuesManager.valuesImpl.getValue(this, "iListPresentationModel");
+                if (c) {
+                    _presentationModel = new c() as IListPresentationModel;
+                    addBead(_presentationModel as IBead);
+                }
+            }
+            
+            return _presentationModel;
+        }
+        
         /*
         * The following functions are for the SWF-side only and re-direct element functions
         * to the content area, enabling scrolling and clipping which are provided automatically
@@ -1093,6 +1123,7 @@ use namespace mx_internal;
         
         /**
          *  @private
+         *  @royaleignorecoercion org.apache.royale.core.IListPresentationModel
          */
         public function set rowHeight(value:Number):void
         {
@@ -1102,6 +1133,7 @@ use namespace mx_internal;
             {
                 _rowHeight = value;
                 
+                (presentationModel as IListPresentationModel).rowHeight = value;
                 /*
                 invalidateSize();
                 itemsSizeChanged = true;