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 2020/10/22 05:05:14 UTC

[royale-asjs] 02/03: Adding some stubs in emulation and moving some to base classes

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 b7714e00454f751515f904b59f79ff8cfa573678
Author: Yishay Weiss <yi...@yell.com>
AuthorDate: Thu Oct 22 06:03:37 2020 +0100

    Adding some stubs in emulation and moving some to base classes
---
 .../MXRoyale/src/main/royale/mx/controls/Tree.as   |  7 ++-
 .../mx/controls/listClasses/AdvancedListBase.as    | 14 ------
 .../mx/controls/listClasses/DataGridListBase.as    | 58 +++++-----------------
 .../royale/mx/controls/listClasses/ListBase.as     | 38 ++++++++++++++
 .../src/main/royale/mx/display/LoaderInfo.as       |  8 ++-
 .../src/main/royale/spark/components/List.as       | 14 +++---
 6 files changed, 71 insertions(+), 68 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as
index a8f2b6e..f3df2e5 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as
@@ -41,7 +41,7 @@ import mx.collections.XMLListCollection;
 //import mx.collections.errors.ItemPendingError;
 import mx.controls.listClasses.BaseListData;
 //import mx.controls.listClasses.IDropInListItemRenderer;
-//import mx.controls.listClasses.IListItemRenderer;
+import mx.controls.listClasses.IListItemRenderer;
 //import mx.controls.listClasses.ListRowInfo;
 //import mx.controls.listClasses.ListBaseSelectionDataPending;
 import mx.controls.treeClasses.DefaultDataDescriptor;
@@ -851,6 +851,11 @@ public class Tree extends List
                super.maxHorizontalScrollPosition;
     } */
 
+     protected function drawItem(item:IListItemRenderer, selected:Boolean = false, highlighted:Boolean = false, caret:Boolean = false, transition:Boolean = false):void
+     {
+             // not implemented
+     }
+
     /**
      *  @private
      */
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
index ff2ac9c..ac9c708 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
@@ -4544,20 +4544,6 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
     }
 
     /**
-     *  Refresh all rows on next update.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Royale 0.9.4
-     */
-     public function invalidateList():void
-    {
-       // itemsSizeChanged = true;
-       // invalidateDisplayList();
-    } 
-
-    /**
      *  Refreshes all rows now.  Calling this method can require substantial
      *  processing, because can be expensive at it completely redraws all renderers
      *  in the list and won't return until complete.
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as
index 2874ff2..52416b1 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/DataGridListBase.as
@@ -44,6 +44,7 @@ COMPILE::JS{
     import DisplayObject = org.apache.royale.core.UIBase;
 }
 
+import mx.controls.listClasses.IListItemRenderer;
 import mx.collections.CursorBookmark;
 import mx.collections.ICollectionView;
 import mx.collections.IViewCursor;
@@ -3830,27 +3831,6 @@ public class DataGridListBase extends ListBase /* extends UIComponent
         return UIDUtil.getUID(data);
     } */
 
-    /**
-     *  Returns the item renderer for a given item in the data provider,
-     *  if there is one.  Since item renderers only exist for items
-     *  that are within the set of viewable rows, this method
-     *  returns <code>null</code> if the item is not visible.
-     *  For a data grid, this returns the first column's renderer.
-     *
-     *  @param item The data provider item.
-     *
-     *  @return The item renderer or <code>null</code> if the item is not 
-     *  currently displayed.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Royale 0.9.4
-     */
-    /* public function itemToItemRenderer(item:Object):IListItemRenderer
-    {
-        return visibleData[itemToUID(item)];
-    } */
 
     /**
      *  Determines if an item is being displayed by a renderer.
@@ -4387,20 +4367,21 @@ public class DataGridListBase extends ListBase /* extends UIComponent
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.4
      */
-   /*  protected function drawSelectionIndicator(
-                                indicator:Sprite, x:Number, y:Number,
+   // not implemented
+   protected function drawSelectionIndicator(
+                                indicator:UIComponent, x:Number, y:Number,
                                 width:Number, height:Number, color:uint,
                                 itemRenderer:IListItemRenderer):void
     {
-        var g:Graphics = Sprite(indicator).graphics;
-        g.clear();
-        g.beginFill(color);
-        g.drawRect(0, 0, width, height);
-        g.endFill();
-        
-        indicator.x = x;
-        indicator.y = y;
-    } */
+        //var g:Graphics = Sprite(indicator).graphics;
+        //g.clear();
+        //g.beginFill(color);
+        //g.drawRect(0, 0, width, height);
+        //g.endFill();
+        //
+        //indicator.x = x;
+        //indicator.y = y;
+    }
 
     
     /**
@@ -4544,19 +4525,6 @@ public class DataGridListBase extends ListBase /* extends UIComponent
         }
     } */
 
-    /**
-     *  Refresh all rows on next update.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Royale 0.9.4
-     */
-     public function invalidateList():void
-    {
-       // itemsSizeChanged = true;
-       // invalidateDisplayList();
-    } 
 
     /**
      *  Refreshes all rows now.  Calling this method can require substantial
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 232b5b0..fcfd394 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
@@ -799,6 +799,21 @@ use namespace mx_internal;
             return _strandChildren;
         }
         
+    /**
+     *  Refresh all rows on next update.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Royale 0.9.4
+     */
+     public function invalidateList():void
+    {
+	// not implemented
+       // itemsSizeChanged = true;
+       // invalidateDisplayList();
+    } 
+
         public function scrollToIndex(index:int):Boolean
         {
 
@@ -923,6 +938,29 @@ use namespace mx_internal;
                 this.dispatchEvent(new ValueEvent("childrenRemoved", c));
         }
         
+      /**
+       *  Returns the item renderer for a given item in the data provider,
+       *  if there is one.  Since item renderers only exist for items
+       *  that are within the set of viewable rows, this method
+       *  returns <code>null</code> if the item is not visible.
+       *  For a data grid, this returns the first column's renderer.
+       *
+       *  @param item The data provider item.
+       *
+       *  @return The item renderer or <code>null</code> if the item is not 
+       *  currently displayed.
+       *  
+       *  @langversion 3.0
+       *  @playerversion Flash 9
+       *  @playerversion AIR 1.1
+       *  @productversion Royale 0.9.4
+       */
+      public function itemToItemRenderer(item:Object):IListItemRenderer
+      {
+	      // not implemented
+          //return visibleData[itemToUID(item)];
+	      return null;
+      }
         /**
          * @private
          */
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/display/LoaderInfo.as b/frameworks/projects/MXRoyale/src/main/royale/mx/display/LoaderInfo.as
index 0afeb1f..bdcfb9c 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/display/LoaderInfo.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/display/LoaderInfo.as
@@ -19,6 +19,7 @@
 package mx.display
 {
     import org.apache.royale.events.EventDispatcher;
+    import mx.core.UIComponent;
 
     public class LoaderInfo extends EventDispatcher
     {
@@ -30,6 +31,11 @@ package mx.display
             _loader = loaderValue;
         }
 
+	public function get content():UIComponent
+	    {
+		    return _loader.content;
+	    }
+
         public function get loader():Loader
         {
         	return _loader;
@@ -48,4 +54,4 @@ package mx.display
         }
 
     }
-}
\ No newline at end of file
+}
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 2a04ecd..8744367 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/List.as
@@ -815,7 +815,7 @@ public class List extends ListBase implements IFocusManagerComponent
      *  @private
      *  Storage for the dragMoveEnabled property.
      */
-    /* private var _dragMoveEnabled:Boolean = false;
+    private var _dragMoveEnabled:Boolean = false;
     
     [Inspectable(defaultValue="false")] */
     
@@ -839,18 +839,18 @@ public class List extends ListBase implements IFocusManagerComponent
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    /* public function get dragMoveEnabled():Boolean
+    public function get dragMoveEnabled():Boolean
     {
-        return _dragMoveEnabled;
-    } */
+        return _dragMoveEnabled; // not implemented
+    }
     
     /**
      *  @private
      */
-    /* public function set dragMoveEnabled(value:Boolean):void
+    public function set dragMoveEnabled(value:Boolean):void
     {
-        _dragMoveEnabled = value;
-    } */
+        _dragMoveEnabled = value; // not implemented
+    }
 
     //----------------------------------
     //  dropEnabled