royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs] branch develop updated: Merge
Date Fri, 01 Jun 2018 10:19:59 GMT
This is an automated email from the ASF dual-hosted git repository.

harbs 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 b93791e  Merge
b93791e is described below

commit b93791e257df5b894ee09bed350ec1612546a8e4
Author: Harbs <harbs@in-tools.com>
AuthorDate: Fri Jun 1 13:19:40 2018 +0300

    Merge
---
 .../org/apache/royale/html/beads/ComboBoxView.as   | 24 ++++++++++++++++++++--
 .../supportClasses/CascadingMenuItemRenderer.as    |  8 ++------
 .../html/supportClasses/MenuBarItemRenderer.as     |  8 ++------
 .../royale/html/supportClasses/MenuItemRenderer.as |  8 ++------
 .../html/supportClasses/StringItemRenderer.as      |  8 ++------
 .../html/supportClasses/TextButtonItemRenderer.as  | 14 +++----------
 .../royale/html/supportClasses/TreeItemRenderer.as |  4 ++--
 7 files changed, 35 insertions(+), 39 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
index ccda141..4b983fe 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
@@ -35,6 +35,7 @@ package org.apache.royale.html.beads
 	import org.apache.royale.core.IPopUpHost;
 	import org.apache.royale.geom.Point;
 	import org.apache.royale.html.beads.IComboBoxView;
+	import org.apache.royale.html.util.getLabelFromData;
 	
 	/**
 	 *  The ComboBoxView class creates the visual elements of the org.apache.royale.html.ComboBox

@@ -107,6 +108,8 @@ package org.apache.royale.html.beads
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+		 * @royaleignorecoercion org.apache.royale.core.UIBase
 		 */
 		override public function set strand(value:IStrand):void
 		{
@@ -118,11 +121,22 @@ package org.apache.royale.html.beads
 			input.className = "ComboBoxTextInput";			
 			
 			button = new TextButton();
-			button.className = "opt_org-apache-royale-html-ComboBox_Button";
+			button.style = {
+				"padding": 0,
+				"margin": 0
+			};
 			button.text = '\u25BC';
 			
 			if (isNaN(host.width)) input.width = 100;
 			
+			COMPILE::JS 
+			{
+				// inner components are absolutely positioned so we want to make sure the host is the
offset parent
+				if (!host.element.style.position)
+				{
+					host.element.style.position = "relative";
+				}
+			}
 			host.addElement(input);
 			host.addElement(button);
 			
@@ -156,6 +170,10 @@ package org.apache.royale.html.beads
 			if (list) return list.visible;
 			else return false;
 		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IComboBoxModel
+		 * @royaleignorecoercion org.apache.royale.core.IUIBase
+		 */
 		public function set popUpVisible(value:Boolean):void
 		{
 			if (value && !list.visible) {
@@ -200,15 +218,17 @@ package org.apache.royale.html.beads
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion org.apache.royale.core.IComboBoxModel
 		 */
 		protected function itemChangeAction():void
 		{
 			var model:IComboBoxModel = _strand.getBeadByType(IComboBoxModel) as IComboBoxModel;
-			input.text = model.selectedItem as String;
+			input.text = getLabelFromData(model,model.selectedItem);
 		}
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion org.apache.royale.core.UIBase
 		 */
 		protected function sizeChangeAction():void
 		{
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/CascadingMenuItemRenderer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/CascadingMenuItemRenderer.as
index 81b3dd2..6c34085 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/CascadingMenuItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/CascadingMenuItemRenderer.as
@@ -23,6 +23,7 @@ package org.apache.royale.html.supportClasses
 	import org.apache.royale.html.beads.ITextItemRenderer;
 	import org.apache.royale.svg.Rect;
 	import org.apache.royale.core.DataItemRenderer;
+	import org.apache.royale.html.util.getLabelFromData;
 
 	/**
 	 * The CascadingMenuItemRenderer is the itemRenderer class for the elements of a CascadingMenu.
@@ -95,18 +96,13 @@ package org.apache.royale.html.supportClasses
 				}
 			}
 			else {
-				var text:String;
-				if (value is String) text = value as String;
-				else if (labelField) text = String(value[labelField]);
-				else if (dataField) text = String(value[dataField]);
-				else text = String(value);
 				
 				if (label == null) {
 					label = new Label();
 					addElement(label);
 				}
 				
-				label.text = text;
+				label.text = getLabelFromData(this,value);
 				
 				if (value.hasOwnProperty("menu")) {
 					if (submenuIndicator == null) {
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuBarItemRenderer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuBarItemRenderer.as
index 8a606c4..654cb8d 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuBarItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuBarItemRenderer.as
@@ -21,6 +21,7 @@ package org.apache.royale.html.supportClasses
 	import org.apache.royale.html.Label;
 	import org.apache.royale.html.beads.ITextItemRenderer;
 	import org.apache.royale.core.DataItemRenderer;
+	import org.apache.royale.html.util.getLabelFromData;
 	
 	public class MenuBarItemRenderer extends DataItemRenderer implements ITextItemRenderer
 	{
@@ -44,13 +45,8 @@ package org.apache.royale.html.supportClasses
 		override public function set data(value:Object):void
 		{
 			super.data = value;
-			var text:String;
-			if (value is String) text = value as String;
-			else if (labelField) text = String(value[labelField]);
-			else if (dataField) text = String(value[dataField]);
-			else text = String(value);
 			
-			label.text = text;
+			label.text = getLabelFromData(this,value);
 			
 			adjustSize();
 		}
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuItemRenderer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuItemRenderer.as
index bafc945..340c98b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/MenuItemRenderer.as
@@ -22,6 +22,7 @@ package org.apache.royale.html.supportClasses
 	import org.apache.royale.html.Label;
 	import org.apache.royale.html.beads.ITextItemRenderer;
 	import org.apache.royale.core.DataItemRenderer;
+	import org.apache.royale.html.util.getLabelFromData;
 
 	/**
 	 * The MenuItemRenderer class is the default itemRenderer for Menus.
@@ -74,13 +75,8 @@ package org.apache.royale.html.supportClasses
 		override public function set data(value:Object):void
 		{
 			super.data = value;
-			var text:String;
-			if (value is String) text = value as String;
-			else if (labelField) text = String(value[labelField]);
-			else if (dataField) text = String(value[dataField]);
-			else text = String(value);
 			
-			label.text = text;
+			label.text = getLabelFromData(this,value);
 		}
 		
 		/**
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
index cb3425b..b111354 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/StringItemRenderer.as
@@ -33,6 +33,7 @@ package org.apache.royale.html.supportClasses
     import org.apache.royale.events.Event;
     import org.apache.royale.html.beads.ITextItemRenderer;
 	import org.apache.royale.core.DataItemRenderer; 
+	import org.apache.royale.html.util.getLabelFromData;
 
 	/**
 	 *  The StringItemRenderer class displays data in string form using the data's toString()
@@ -147,12 +148,7 @@ package org.apache.royale.html.supportClasses
 		{
 			super.data = value;
             var text:String;
-			if (value is String) text = value as String;
-			else if (labelField) text = "" + value[labelField];
-			else if (dataField) text = "" + value[dataField];
-			else text = "" + value;
-
-            this.text = text;
+            this.text = getLabelFromData(this,value);
 		}
 
         // COMPILE::JS
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
index 4f2fe1b..1b599eb 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as
@@ -27,6 +27,7 @@ package org.apache.royale.html.supportClasses
 	import org.apache.royale.html.TextButton;
 	import org.apache.royale.html.beads.ITextItemRenderer;
 	import org.apache.royale.events.ItemClickedEvent;
+	import org.apache.royale.html.util.getLabelFromData;
 
 	COMPILE::JS
 	{
@@ -84,17 +85,8 @@ package org.apache.royale.html.supportClasses
 			var valueAsString:String;
 
 			if (data == null) return;
-
-			if (data is String) {
-				valueAsString = data as String;
-			}
-			else if (labelField != null) {
-				valueAsString = "" + data[labelField];
-			}
-			else if (data.hasOwnProperty("label")) {
-				valueAsString = "" + data["label"];
-			}
-			else if (data.hasOwnProperty("title")) {
+			valueAsString = getLabelFromData(this,data);
+			if (!valueAsString && data.hasOwnProperty("title")) {
 				valueAsString = "" + data["title"];
 			}
 
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TreeItemRenderer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TreeItemRenderer.as
index 8065c54..b232655 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TreeItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/TreeItemRenderer.as
@@ -51,8 +51,8 @@ package org.apache.royale.html.supportClasses
 			var extraSpace:String = " ";
 			
 			COMPILE::JS {
-				indentSpace = "&nbsp;&nbsp;&nbsp;&nbsp;";
-				extraSpace = "&nbsp;";
+				indentSpace = "\u00a0\u00a0\u00a0\u00a0";
+				extraSpace = "\u00a0";
 			}
 				
 			var indent:String = "";

-- 
To stop receiving notification emails like this one, please contact
harbs@apache.org.

Mime
View raw message