You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Harbs <ha...@gmail.com> on 2017/10/30 11:07:15 UTC

Re: [royale-asjs] branch develop updated: Made drag drop optional (drag image and drop indicator seems to be broken at the moment)

Peter,

Can you please look at this?

For some reason my change seems to have broken the beads which draw the drag image and the drop indicator. It looks to me like the beads are added, but they are not behaving the same.

Thanks,
Harbs

> On Oct 30, 2017, at 1:01 AM, harbs@apache.org wrote:
> 
> 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 f835970  Made drag drop optional (drag image and drop indicator seems to be broken at the moment)
> f835970 is described below
> 
> commit f835970f9d13654ddc5d8487b23f2752c08e2e78
> Author: Harbs <ha...@in-tools.com>
> AuthorDate: Mon Oct 30 01:01:31 2017 +0200
> 
>    Made drag drop optional (drag image and drop indicator seems to be broken at the moment)
> ---
> .../Express/src/main/resources/defaults.css        |  4 +-
> .../royale/org/apache/royale/express/DataGrid.as   | 75 +++++++++++++++++-----
> 2 files changed, 62 insertions(+), 17 deletions(-)
> 
> diff --git a/frameworks/projects/Express/src/main/resources/defaults.css b/frameworks/projects/Express/src/main/resources/defaults.css
> index d4f74ee..eb78141 100644
> --- a/frameworks/projects/Express/src/main/resources/defaults.css
> +++ b/frameworks/projects/Express/src/main/resources/defaults.css
> @@ -47,9 +47,9 @@ DataGrid
> {
> 	IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel");
> 	IDataProviderNotifier: ClassReference("org.apache.royale.html.beads.EasyDataProviderChangeNotifier");
> -	IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView");
> +	IBeadView: ClassReference("org.apache.royale.html.beads.DataGridColumnReorderView");
> 	IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel");
> -	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalFlexLayout");
> +	IBeadLayout: ClassReference("org.apache.royale.html.beads.DataGridWithDrawingLayerLayout");
> 	
> 	background-color: #FFFFFF;
> 	border-style: solid;
> diff --git a/frameworks/projects/Express/src/main/royale/org/apache/royale/express/DataGrid.as b/frameworks/projects/Express/src/main/royale/org/apache/royale/express/DataGrid.as
> index 27da60c..0043858 100644
> --- a/frameworks/projects/Express/src/main/royale/org/apache/royale/express/DataGrid.as
> +++ b/frameworks/projects/Express/src/main/royale/org/apache/royale/express/DataGrid.as
> @@ -18,6 +18,7 @@
> ////////////////////////////////////////////////////////////////////////////////
> package org.apache.royale.express
> {
> +	import org.apache.royale.core.IBeadLayout;
> 	import org.apache.royale.core.IDataProviderNotifier;
> 	import org.apache.royale.core.ValuesManager;
> 	import org.apache.royale.html.DataGrid;
> @@ -28,6 +29,7 @@ package org.apache.royale.express
> 	import org.apache.royale.html.beads.SingleSelectionDropIndicatorBead;
> 	import org.apache.royale.html.beads.DataGridWithDrawingLayerLayout;
> 	import org.apache.royale.html.beads.DataGridDrawingLayerBead;
> +	import org.apache.royale.utils.loadBeadFromValuesManager;
> 
> 	/**
> 	 * This class extends DataGrid and adds beads for drag and drop and
> @@ -56,28 +58,71 @@ package org.apache.royale.express
> 		public function DataGrid()
> 		{
> 			super();
> -
> -			addBead(new SingleSelectionDragSourceBead());
> -			addBead(new SingleSelectionDragImageBead());
> -			addBead(new SingleSelectionDropTargetBead());
> -			addBead(new SingleSelectionDropIndicatorBead());
> -			addBead(new DataGridWithDrawingLayerLayout());
> -			addBead(new DataGridDrawingLayerBead());
> -			addBead(new DataGridColumnReorderView());
> 		}
> 		override public function addedToParent():void
> 		{
> 			if (!dataNotifier) {
> -				var c:Class = ValuesManager.valuesImpl.getValue(this, "iDataProviderNotifier");
> -				if (c) {
> -					dataNotifier = new c() as IDataProviderNotifier;
> -					if (dataNotifier) {
> -						addBead(dataNotifier);
> -					}
> -				}
> +				dataNotifier = loadBeadFromValuesManager(IDataProviderNotifier, "iDataProviderNotifier", this) as IDataProviderNotifier;
> 			}
> 			super.addedToParent();
> +			if(getBeadByType(IBeadLayout) is DataGridWithDrawingLayerLayout)
> +			{
> +				addBead(new DataGridDrawingLayerBead());
> +			}
> 		}
> 		public var dataNotifier:IDataProviderNotifier;
> +
> +		private var _dragEnabled:Boolean = false;
> +		/**
> +		 *  Allows list items to be dragged
> +		 *
> +		 *  @langversion 3.0
> +		 *  @playerversion Flash 10.2
> +		 *  @playerversion AIR 2.6
> +		 *  @productversion Royale 0.9
> +		 */
> +		public function get dragEnabled():Boolean
> +		{
> +			return _dragEnabled;
> +		}
> +		public function set dragEnabled(value:Boolean):void
> +		{
> +			if(value == _dragEnabled)
> +				return;
> +			_dragEnabled = value;
> +			if(value)
> +			{
> +				addBead(new SingleSelectionDragSourceBead());
> +				addBead(new SingleSelectionDragImageBead());
> +			}
> +		}
> +		
> +		private var _dropEnabled:Boolean;
> +		/**
> +		 *  Allows items to be dropped in the list (such as reordering items)
> +		 *
> +		 *  @langversion 3.0
> +		 *  @playerversion Flash 10.2
> +		 *  @playerversion AIR 2.6
> +		 *  @productversion Royale 0.9
> +		 */
> +		public function get dropEnabled():Boolean
> +		{
> +			return _dropEnabled;
> +		}
> +		public function set dropEnabled(value:Boolean):void
> +		{
> +			if(value == _dropEnabled)
> +				return;
> +			_dropEnabled = value;
> +			if(value)
> +			{
> +				addBead(new SingleSelectionDropTargetBead());
> +				addBead(new SingleSelectionDropIndicatorBead());
> +			}
> +		}
> +		
> +
> +		
> 	}
> }
> 
> -- 
> To stop receiving notification emails like this one, please contact
> ['"commits@royale.apache.org" <co...@royale.apache.org>'].