This is an automated email from the ASF dual-hosted git repository. carlosrovira pushed a commit to branch feature/jewel-ui-set in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/jewel-ui-set by this push: new 71fed14 new AlertPlayGround in jewel example with Tour de Flex Alert examples 71fed14 is described below commit 71fed14de61306796957b891354ef1d6b0b9c065 Author: Carlos Rovira <carlosrov...@apache.org> AuthorDate: Sun Apr 1 00:05:40 2018 +0200 new AlertPlayGround in jewel example with Tour de Flex Alert examples --- .../src/main/royale/AlertPlayGround.mxml | 62 ++++++++++++++++++++++ .../src/main/royale/ButtonPlayGround.mxml | 21 +------- .../JewelExample/src/main/royale/MainContent.mxml | 1 + 3 files changed, 64 insertions(+), 20 deletions(-) diff --git a/examples/royale/JewelExample/src/main/royale/AlertPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/AlertPlayGround.mxml new file mode 100644 index 0000000..230f74d --- /dev/null +++ b/examples/royale/JewelExample/src/main/royale/AlertPlayGround.mxml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<js:Group xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/royale/basic" + xmlns:html="library://ns.apache.org/royale/html" + xmlns:j="library://ns.apache.org/royale/jewel" + className="container"> + + <fx:Script> + <![CDATA[ + import org.apache.royale.jewel.Alert; + import org.apache.royale.events.CloseEvent; + + // Event handler function uses a static method to show + // a pop-up window with the title, message, and requested buttons. + private function clickHandler(event:Event):void { + var alert:Alert = Alert.show("Do you want to save your changes?", "Save Changes", 3); + alert.addEventListener(CloseEvent.CLOSE, alertClickHandler); + alert.height = 300; + } + + // Event handler function for displaying the selected Alert button. + private function alertClickHandler(event:CloseEvent):void { + if (event.detail==Alert.YES) + status.text="You answered Yes"; + else + status.text="You answered No"; + } + ]]> + </fx:Script> + + <js:beads> + <j:VerticalLayoutWithPaddingAndGap gap="10"/> + </js:beads> + + <html:H3 text="Jewel Alert"/> + + <j:Label text="Click the button below to display a simple Alert window"/> + <j:TextButton text="Click Me" click="Alert.show('This is an Alert component example that shows a label text and the default OK button.', 'Alert Example')"/> + + <j:Label text="Click the button below to display an Alert window and capture the button pressed by the user."/> + <j:TextButton text="Click Me" click="clickHandler(event)"/> + <j:Label id="status"/> + +</js:Group> diff --git a/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml index 6facd75..b2d396e 100644 --- a/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml +++ b/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml @@ -23,32 +23,13 @@ limitations under the License. xmlns:j="library://ns.apache.org/royale/jewel" className="container"> - <fx:Script> - <![CDATA[ - import org.apache.royale.jewel.Alert; - - private function showAlert(event:MouseEvent):void - { - var alert:Alert = Alert.show("This is an Alert component example that shows a label text and two buttons.", "Alert Example", Alert.OK | Alert.CANCEL); - //alert.height = 450; - alert.addEventListener("close", onClose); - } - - private function onClose(event:CloseEvent):void - { - trace("Hi!"); - //alertStatus.text = "Alert status: " + event.detail; - } - ]]> - </fx:Script> - <js:beads> <j:VerticalLayoutWithPaddingAndGap gap="10"/> </js:beads> <html:H3 text="Jewel Button"/> - <j:Button click="showAlert(event)"/> + <j:Button/> <j:Button primary="true"/> <j:Button emphasized="true"/> diff --git a/examples/royale/JewelExample/src/main/royale/MainContent.mxml b/examples/royale/JewelExample/src/main/royale/MainContent.mxml index b38b2e3..3cdb9d4 100644 --- a/examples/royale/JewelExample/src/main/royale/MainContent.mxml +++ b/examples/royale/JewelExample/src/main/royale/MainContent.mxml @@ -50,6 +50,7 @@ limitations under the License. </js:beads> <local:SliderPlayGround/> <local:HeadingsAndText/> + <local:AlertPlayGround/> </js:Group> </js:Group> -- To stop receiving notification emails like this one, please contact carlosrov...@apache.org.