flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cza...@apache.org
Subject git commit: FLEX-33350 updated CallOutButton - patch by Marcus Fritze
Date Sat, 06 Apr 2013 14:05:53 GMT
Updated Branches:
  refs/heads/develop d0baf5f5e -> 579e7c307


FLEX-33350 updated CallOutButton - patch by Marcus Fritze


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

Branch: refs/heads/develop
Commit: 579e7c307f40d4948bfc083a43726b2a66decba8
Parents: d0baf5f
Author: cyrill.zadra <cyrill.zadra@gmail.com>
Authored: Sun Apr 7 01:05:30 2013 +1100
Committer: cyrill.zadra <cyrill.zadra@gmail.com>
Committed: Sun Apr 7 01:05:30 2013 +1100

----------------------------------------------------------------------
 .../src/spark/components/CallOutButton.as          |   16 +++-
 .../supportClasses/CallOutDropDownController.as    |   78 +++++++++++++++
 2 files changed, 91 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/579e7c30/frameworks/projects/experimental/src/spark/components/CallOutButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental/src/spark/components/CallOutButton.as b/frameworks/projects/experimental/src/spark/components/CallOutButton.as
index 6a403a3..c2f8d24 100644
--- a/frameworks/projects/experimental/src/spark/components/CallOutButton.as
+++ b/frameworks/projects/experimental/src/spark/components/CallOutButton.as
@@ -28,11 +28,11 @@ package spark.components
 	import mx.utils.BitFlagUtil;
 	
 	import spark.components.Button;
-	import spark.components.supportClasses.DropDownController;
 	import spark.events.DropDownEvent;
 	import spark.events.PopUpEvent;
 	import spark.layouts.supportClasses.LayoutBase;
 	
+	import spark.components.supportClasses.CallOutDropDownController;
 	import spark.components.supportClasses.IDropDownContainer;
 	
 	use namespace mx_internal;
@@ -73,6 +73,8 @@ package spark.components
 		[SkinPart(required="false")]
 		public var dropDown:IFactory;
 		
+		public var topCallOut:CallOut;
+		public var subCallOut:CallOut;
 		
 		private var _callout:CallOut;
 		[Bindable("calloutChanged")]
@@ -115,7 +117,7 @@ package spark.components
 		[Inspectable(category="General", enumeration="rollOver,click", defaultValue="rollOver")]
//mouseOver
 		public var triggerEvent:String = MouseEvent.ROLL_OVER;
 		
-		private var dropDownController:DropDownController;
+		private var dropDownController:CallOutDropDownController;
 		
 		//--------------------------------------------------------------------------
 		//
@@ -219,7 +221,7 @@ package spark.components
 		
 		override public function initialize():void
 		{
-			dropDownController = new DropDownController();
+			dropDownController = new CallOutDropDownController();
 			dropDownController.closeOnResize = false;
 			dropDownController.addEventListener(DropDownEvent.OPEN, handleDropDownOpen);
 			dropDownController.addEventListener(DropDownEvent.CLOSE, handleDropDownClose);
@@ -294,6 +296,10 @@ package spark.components
 			if (!callout) setCallout(createDynamicPartInstance("dropDown") as CallOut);
 			if (!callout) return;
 			
+			if(topCallOut != null)
+				if(topCallOut.owner != null)
+					(this.topCallOut.owner as CallOutButton).subCallOut = callout;
+			
 			addEventListener(Event.REMOVED_FROM_STAGE, handleButtonRemoved);
 			callout.open(this, false);
 		}
@@ -345,5 +351,9 @@ package spark.components
 			dropDownController.closeDropDown(false);
 		}
 		
+		public function updatePopUpPosition():void
+		{
+			callout.updatePopUpPosition();
+		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/579e7c30/frameworks/projects/experimental/src/spark/components/supportClasses/CallOutDropDownController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental/src/spark/components/supportClasses/CallOutDropDownController.as
b/frameworks/projects/experimental/src/spark/components/supportClasses/CallOutDropDownController.as
new file mode 100644
index 0000000..bff579b
--- /dev/null
+++ b/frameworks/projects/experimental/src/spark/components/supportClasses/CallOutDropDownController.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package spark.components.supportClasses
+{
+	import flash.display.DisplayObject;
+	import flash.events.Event;
+	
+	import mx.collections.ArrayCollection;
+	import mx.core.mx_internal;
+	
+	import spark.components.supportClasses.DropDownController;
+	//import spark.events.DropDownEvent;
+	
+	import spark.components.CallOutButton;
+	
+	use namespace mx_internal;
+	
+	public class CallOutDropDownController extends DropDownController
+	{
+		//private var openDropDowns:ArrayCollection;
+		
+		public function CallOutDropDownController()
+		{
+			super();
+			
+			//openDropDowns = new ArrayCollection();
+			
+			//this.addEventListener(DropDownEvent.OPEN, onOpenDropDown);
+		}
+		
+		override mx_internal function systemManager_mouseDownHandler(event:Event):void
+		{
+			if((openButton as CallOutButton).subCallOut != null)
+			{
+				if( this.hitAreaAdditions)
+				{
+					if(this.hitAreaAdditions.indexOf((openButton as CallOutButton).subCallOut) == -1)
+						this.hitAreaAdditions = Vector.<DisplayObject>( [ (openButton as CallOutButton).subCallOut
] ).concat( this.hitAreaAdditions );
+				}
+				else
+				{
+					this.hitAreaAdditions = Vector.<DisplayObject>( [ (openButton as CallOutButton).subCallOut
] );
+				}
+			}
+			
+			super.mx_internal::systemManager_mouseDownHandler(event);
+		}
+		/*
+		private function onOpenDropDown(event:DropDownEvent):void
+		{
+			var test:String = "neu";
+			
+			openDropDowns.addItem({dropDownController:event.target});
+		}
+		
+		override public function closeDropDown(commit:Boolean):void
+		{
+			var test:String = "neu";
+		}
+		*/
+	}
+}
\ No newline at end of file


Mime
View raw message