You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/12/18 14:10:28 UTC

[royale-asjs] branch develop updated: jewel-popup: example of how to instantiate a PopUp via AS3

This is an automated email from the ASF dual-hosted git repository.

carlosrovira 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 1653934  jewel-popup: example of how to instantiate a PopUp via AS3
1653934 is described below

commit 165393449114c215e80e538644c03b00c7e42ba5
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Dec 18 15:10:19 2019 +0100

    jewel-popup: example of how to instantiate a PopUp via AS3
---
 .../src/main/royale/PopUpPlayGround.mxml           | 23 ++++++++++++++++++++++
 .../main/royale/org/apache/royale/jewel/PopUp.as   |  6 ++----
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml
index 45e8a5c..342a856 100644
--- a/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml
@@ -26,6 +26,7 @@ limitations under the License.
 	<fx:Script>
 		<![CDATA[
 		import org.apache.royale.events.Event;
+		import components.FormExample;
 
 		public function openPopUpHandler(event:Event):void
 		{
@@ -35,6 +36,24 @@ limitations under the License.
 		{
 			trace("[closePopUp] ", event.target, popup1.content);
 		}
+
+		private var programaticPopup:PopUp;
+		public function createProgramaticPopup(event:Event):void
+		{
+			if(!programaticPopup)
+			{
+				var fe:FormExample = new FormExample();
+				fe.width = 490;
+				fe.height = 392;
+				fe.label = "AS3 Form Instance"
+
+				programaticPopup = new PopUp();
+				programaticPopup.content = fe;
+				addElement(programaticPopup);
+			}
+
+			programaticPopup.open = true; 
+		}
 		]]>
 	</fx:Script>
 
@@ -67,6 +86,10 @@ limitations under the License.
 						 closePopUp="popupFormContent.formValidator.removeAllErrorTips()">
 					<c:FormExample localId="popupFormContent" label="Form example in a PopUp" width="490" height="392"/>
 				</j:PopUp>
+
+				<html:H3 text="Jewel PopUp (Declared in AS3)"/>
+				<j:Button text="Create Programatic Popup" emphasis="primary"
+                   click="createProgramaticPopup(event)"/>
 			</j:Card>
 		</j:GridCell>
 	</j:Grid>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/PopUp.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/PopUp.as
index 9c6e9f8..f816478 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/PopUp.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/PopUp.as
@@ -20,11 +20,9 @@ package org.apache.royale.jewel
 {
 	COMPILE::JS
     {
-        import org.apache.royale.core.WrappedHTMLElement;
-        import org.apache.royale.html.util.addElementToWrapper;
+	import org.apache.royale.core.WrappedHTMLElement;
+	import org.apache.royale.html.util.addElementToWrapper;
     }
-	import org.apache.royale.core.IPopUpHost;
-	import org.apache.royale.core.IPopUpHostParent;
 	import org.apache.royale.core.StyledUIBase;
 	import org.apache.royale.core.UIBase;
 	import org.apache.royale.events.Event;