flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Fix to NonVirtualDataGroup on the JS side to set its positioner. Fix to ListView (JS and AS) to handle size changes and adjust its dataGroup accordingly.
Date Thu, 30 Jan 2014 21:41:12 GMT
Updated Branches:
  refs/heads/develop 0b8875a87 -> fd4bf1f60


Fix to NonVirtualDataGroup on the JS side to set its positioner. Fix to ListView (JS and AS)
to handle size changes and adjust its dataGroup accordingly.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fd4bf1f6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fd4bf1f6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fd4bf1f6

Branch: refs/heads/develop
Commit: fd4bf1f60a6f32ea25da742acfd3545a635f8977
Parents: 0b8875a
Author: Peter Ent <pent@apache.org>
Authored: Thu Jan 30 16:41:00 2014 -0500
Committer: Peter Ent <pent@apache.org>
Committed: Thu Jan 30 16:41:00 2014 -0500

----------------------------------------------------------------------
 .../flex/html/staticControls/beads/ListView.as  | 21 +++++++++++++++++---
 .../flex/html/staticControls/beads/ListView.js  | 19 ++++++++++++++++++
 .../supportClasses/NonVirtualDataGroup.js       |  2 ++
 3 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd4bf1f6/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ListView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ListView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ListView.as
index f1ac5d3..f90994e 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ListView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ListView.as
@@ -21,9 +21,9 @@ package org.apache.flex.html.staticControls.beads
 	import flash.display.DisplayObject;
 	import flash.display.DisplayObjectContainer;
 	
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IBeadLayout;
+	import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IBeadView;
 	import org.apache.flex.core.IItemRenderer;
 	import org.apache.flex.core.IItemRendererParent;
@@ -33,8 +33,10 @@ package org.apache.flex.html.staticControls.beads
 	import org.apache.flex.core.ISelectionModel;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.Strand;
+	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.html.staticControls.beads.models.ScrollBarModel;
 	import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
 	import org.apache.flex.html.staticControls.supportClasses.Border;
@@ -96,6 +98,9 @@ package org.apache.flex.html.staticControls.beads
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
+			
+			IEventDispatcher(_strand).addEventListener("widthChanged", handleSizeChange);
+			IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
             
             listModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
             listModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
@@ -113,7 +118,9 @@ package org.apache.flex.html.staticControls.beads
             {
                 var mapper:IBeadLayout = new (ValuesManager.valuesImpl.getValue(_strand,
"iBeadLayout")) as IBeadLayout;
 				strand.addBead(mapper);
-            }            
+            }  
+			
+			handleSizeChange(null);
 		}
 		
 		private var lastSelectedIndex:int = -1;
@@ -167,6 +174,14 @@ package org.apache.flex.html.staticControls.beads
             IParent(_strand).addElement(vsb);
 			return vsb;
 		}
+		
+		private function handleSizeChange(event:Event):void
+		{
+			UIBase(_dataGroup).x = 0;
+			UIBase(_dataGroup).y = 0;
+			UIBase(_dataGroup).width = UIBase(_strand).width;
+			UIBase(_dataGroup).height = UIBase(_strand).height;
+		}
 				
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd4bf1f6/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ListView.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ListView.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ListView.js
index dd2ac4e..32afbac 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ListView.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ListView.js
@@ -59,6 +59,11 @@ org.apache.flex.html.staticControls.beads.ListView.prototype.set_strand
=
 
   this.strand_ = value;
 
+  this.strand_.addEventListener('widthChanged',
+      goog.bind(this.handleSizeChange, this));
+  this.strand_.addEventListener('heightChanged',
+      goog.bind(this.handleSizeChange, this));
+
   /*if (this.strand_.getBeadByType(org.apache.flex.core.IBeadLayout) == null) {
     var m = org.apache.flex.core.ValuesManager.valuesImpl.
         getValue(this.strand_,'iBeadLayout');
@@ -74,6 +79,8 @@ org.apache.flex.html.staticControls.beads.ListView.prototype.set_strand
=
       org.apache.flex.html.staticControls.supportClasses.NonVirtualDataGroup();
   this.dataGroup_.set_strand(this);
   this.strand_.addElement(this.dataGroup_);
+
+  this.handleSizeChange(null);
 };
 
 
@@ -149,3 +156,15 @@ org.apache.flex.html.staticControls.beads.ListView.prototype.set_vScrollBar
= fu
 org.apache.flex.html.staticControls.beads.ListView.prototype.get_resizeableView = function()
{
   return this;
 };
+
+
+/**
+ * @expose
+ * @param {Object} event The event that triggered the resize.
+ */
+org.apache.flex.html.staticControls.beads.ListView.prototype.handleSizeChange = function(event)
{
+  this.dataGroup_.set_x(0);
+  this.dataGroup_.set_y(0);
+  this.dataGroup_.set_width(this.strand_.get_width());
+  this.dataGroup_.set_height(this.strand_.get_height());
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd4bf1f6/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.js
index 0ccde8c..ab6a850 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/supportClasses/NonVirtualDataGroup.js
@@ -63,6 +63,8 @@ org.apache.flex.html.staticControls.supportClasses.NonVirtualDataGroup.
   this.element.style.position = 'inherit';
   this.set_className('NonVirtualDataGroup');
 
+  this.positioner = this.element;
+
   return this.element;
 };
 


Mime
View raw message