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/02/13 22:55:58 UTC

[royale-asjs] branch develop updated: tourdejewel: demo of combobox popup automatic positioning

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 b3fe01b  tourdejewel: demo of combobox popup automatic positioning
b3fe01b is described below

commit b3fe01bf72238395c9ee16caa073e112bc565f82
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Feb 13 23:55:50 2019 +0100

    tourdejewel: demo of combobox popup automatic positioning
---
 .../src/main/royale/ComboBoxPlayGround.mxml        | 21 +++++++--
 .../royale/components/ComboBoxPopUpContent.mxml    | 54 ++++++++++++++++++++++
 2 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ComboBoxPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ComboBoxPlayGround.mxml
index d61ba09..f2da488 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ComboBoxPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ComboBoxPlayGround.mxml
@@ -22,7 +22,8 @@ limitations under the License.
 	xmlns:html="library://ns.apache.org/royale/html" 
 	xmlns:js="library://ns.apache.org/royale/basic" 
 	xmlns:c="components.*" 
-	xmlns:models="models.*" sourceCodeUrl="ComboBoxPlayGround.mxml">
+	xmlns:models="models.*"
+	sourceCodeUrl="ComboBoxPlayGround.mxml">
 	
 	<fx:Script>
 		<![CDATA[
@@ -178,14 +179,12 @@ limitations under the License.
 	</j:Grid>
 
 	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
-
 		<j:GridCell desktopNumerator="1" desktopDenominator="1" tabletNumerator="1" tabletDenominator="1" phoneNumerator="1" phoneDenominator="1">
-
 			<j:Card>
 				<html:H3 text="Jewel ComboBox with Search Filter"/>
 
 				<j:HGroup gap="3" itemsVerticalAlign="itemsCentered">
-					<j:ComboBox id="searchcmb" labelField="label" dataProvider="{listModel.avengers}">
+					<j:ComboBox labelField="label" dataProvider="{listModel.avengers}">
 						<j:beads>
 							<j:SearchFilter/>
 						</j:beads>
@@ -193,7 +192,21 @@ limitations under the License.
 				</j:HGroup>
 			</j:Card>
 		</j:GridCell>
+	</j:Grid>
 
+	<j:Grid gap="true">
+		<j:GridCell desktopNumerator="1" desktopDenominator="1" tabletNumerator="1" tabletDenominator="1" phoneNumerator="1" phoneDenominator="1">
+			<j:Card>
+				<html:H3 text="Jewel ComboBox"/>
+
+				<!-- PopUp 2-->
+				<j:Label text="Click the button below to display a non modal PopUp"/>
+				<j:Button text="show comboboxes" emphasis="primary" click="popup1.open = !popup1.open;"/>
+				<j:PopUp id="popup1">
+					<c:ComboBoxPopUpContent width="100%" height="100%"/>
+				</j:PopUp>
+			</j:Card>
+		</j:GridCell>
 	</j:Grid>
 
 	<!-- <j:HGroup gap="3" itemsVerticalAlign="itemsCentered">
diff --git a/examples/royale/TourDeJewel/src/main/royale/components/ComboBoxPopUpContent.mxml b/examples/royale/TourDeJewel/src/main/royale/components/ComboBoxPopUpContent.mxml
new file mode 100644
index 0000000..c14c1fd
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/components/ComboBoxPopUpContent.mxml
@@ -0,0 +1,54 @@
+<?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.
+
+-->
+<j:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
+    xmlns:j="library://ns.apache.org/royale/jewel" 
+    xmlns:js="library://ns.apache.org/royale/basic"
+    xmlns:models="models.*">
+
+    <j:beads>
+		<js:ContainerDataBinding/>
+	</j:beads>
+    
+    <j:model>
+		<models:ListsModel id="listModel"/>
+	</j:model>
+
+    <j:ComboBox labelField="label" dataProvider="{listModel.avengers}" style="top: 0; left: 50%">
+        <j:beads>
+            <j:SearchFilter/>
+        </j:beads>
+    </j:ComboBox>
+    <j:ComboBox labelField="label" dataProvider="{listModel.avengers}" style="top: 50%; left: 0">
+        <j:beads>
+            <j:SearchFilter/>
+        </j:beads>
+    </j:ComboBox>
+    <j:ComboBox labelField="label" dataProvider="{listModel.avengers}" style="top: 50%; right: 0;">
+        <j:beads>
+            <j:SearchFilter/>
+        </j:beads>
+    </j:ComboBox>
+    <j:ComboBox labelField="label" dataProvider="{listModel.avengers}" style="bottom: 0; left: 50%;">
+        <j:beads>
+            <j:SearchFilter/>
+        </j:beads>
+    </j:ComboBox>
+
+</j:Group>
\ No newline at end of file