flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [2/8] git commit: [flex-asjs] [refs/heads/dual] - Updated MapSearch example.
Date Mon, 24 Apr 2017 20:24:44 GMT
Updated MapSearch example.


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

Branch: refs/heads/dual
Commit: 37573389f7431c8acf09743a710bab450d6bef23
Parents: 1ae959d
Author: Peter Ent <pent@apache.org>
Authored: Tue Apr 18 15:01:43 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Tue Apr 18 15:01:43 2017 -0400

----------------------------------------------------------------------
 .../MapSearch/src/main/flex/MyInitialView.mxml  | 81 ++++++++++++--------
 .../flexjs/MapSearch/src/main/flex/NoLayout.as  | 26 +++++++
 .../MapSearch/src/main/flex/models/MyModel.as   |  5 +-
 3 files changed, 78 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37573389/examples/flexjs/MapSearch/src/main/flex/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MapSearch/src/main/flex/MyInitialView.mxml b/examples/flexjs/MapSearch/src/main/flex/MyInitialView.mxml
index 54ec4a2..433057e 100644
--- a/examples/flexjs/MapSearch/src/main/flex/MyInitialView.mxml
+++ b/examples/flexjs/MapSearch/src/main/flex/MyInitialView.mxml
@@ -122,14 +122,36 @@ limitations under the License.
 	
 		<fx:Style>
 		@namespace basic "library://ns.apache.org/flexjs/basic";
+			
+		.TopContainer {
+			backgroundColor: darkgray;
+			margin-top: 20px;
+			margin-left: auto;
+			margin-right: auto;
+			border: 1px solid #555555;
+		}
+			
+		.InnerBox {
+			padding: 10px;
+			flex-grow: 0;
+		}
+			
+		.MainMap {
+			flex-grow: 2;
+		}
+			
+		.Results {
+			backgroundColor: lightgray;
+			flex-grow: 1;
+			border: 1px solid #555555;
+			margin-left: 10px;
+			margin-right: 10px;
+			margin-bottom: 10px;
+		}
 		
 		.FormLabel {
 			font-weight: bold;
 			font-size: 12;
-			padding-left: 20px;
-			padding-right: 20px;
-			padding-top: 20px;
-			padding-bottom: 20px;
 			height: 22px;
 		}
 		
@@ -147,56 +169,51 @@ limitations under the License.
 		
 		.FormInput {
 			font-weight: normal;
-			font-size: 12;
-			color: #0000DE;
-			padding: 0px;
-			height: 20px;
-		}
-		
-		.InnerBox {
-			margin-top: 11px;
-			margin-bottom: 10px;
+			font-size: 14;
+			margin-left: 5px;
+			margin-right: 5px;
 		}
 	</fx:Style>
 	
 	<js:beads>
+		<local:NoLayout />
 		<js:ViewDataBinding />
 	</js:beads>
 	
-	
-	<js:Container x="5" y="5" className="topContainer" >
+	<js:Group className="TopContainer" width="50%" height="600">
 		<js:beads>
-			<js:VerticalLayout />
+			<js:VerticalFlexLayout />
 		</js:beads>
 		
-		<js:Container className="InnerBox">
+		<js:Group className="InnerBox">
 			<js:beads>
-				<js:HorizontalLayout />
+				<js:OneFlexibleChildHorizontalLayout flexibleChild="mapLocation" />
 			</js:beads>
 			<js:Label id="label1" text="Location:" className="FormLabel"  />
-			<js:TextInput id="mapLocation" />
+			<js:TextInput id="mapLocation" className="FormInput" />
 			<js:TextButton text="Go" id="goButton" click="orientMap()" className="FormButton" />
+			<js:Spacer width="5" />
 			
-			<js:DropDownList id="list" width="100" height="20"
-								change="changeCity(event)"
-								dataProvider="{MyModel(applicationModel).cities}" />
-		</js:Container>
+			<js:DropDownList id="list" width="100"
+							 change="changeCity(event)"
+							 dataProvider="{MyModel(applicationModel).cities}" />
+		</js:Group>
 		
-		<google:Map id="map" width="450" height="300" className="MainMap"
-				   token="AIzaSyDkQgg2iojLCYeuW6hK7DkuAHD-SwJJhdE" 
-				   ready="onMapReady()"/>
+		<google:Map id="map" className="MainMap"
+					token="AIzaSyDkQgg2iojLCYeuW6hK7DkuAHD-SwJJhdE" 
+					ready="onMapReady()"/>
 		
-		<js:Container className="InnerBox">
+		<js:Group className="InnerBox">
 			<js:beads>
-				<js:HorizontalLayout />
+				<js:OneFlexibleChildHorizontalLayout flexibleChild="search" />
 			</js:beads>
 			<js:Label id="label2" text="Search on Map:" className="FormLabel" />
-			<js:TextInput id="search" />
+			<js:TextInput id="search" className="FormInput" />
 			<js:TextButton text="Find" click="searchOnMap()" className="FormButton" />
 			<js:TextButton text="Clear"click="clearSearchResults()" className="FormButton" />
-		</js:Container>
+		</js:Group>
 		
-		<js:List id="resultsList" width="450" height="200">
+		<js:List id="resultsList" className="Results">
 			<js:beads>
 				<js:SimpleBinding
 					sourceID="applicationModel"
@@ -206,6 +223,6 @@ limitations under the License.
 			</js:beads>
 		</js:List>
 		
-	</js:Container>
+	</js:Group>
 	
 </js:View>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37573389/examples/flexjs/MapSearch/src/main/flex/NoLayout.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/MapSearch/src/main/flex/NoLayout.as b/examples/flexjs/MapSearch/src/main/flex/NoLayout.as
new file mode 100644
index 0000000..86ca2b7
--- /dev/null
+++ b/examples/flexjs/MapSearch/src/main/flex/NoLayout.as
@@ -0,0 +1,26 @@
+//
+//      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
+{
+	import org.apache.flex.core.LayoutBase;
+	
+	/**
+	 * Provides no layout allowing CSS to control everything
+	 */
+	
+	public class NoLayout extends LayoutBase
+	{
+		public function NoLayout()
+		{
+			super();
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37573389/examples/flexjs/MapSearch/src/main/flex/models/MyModel.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/MapSearch/src/main/flex/models/MyModel.as b/examples/flexjs/MapSearch/src/main/flex/models/MyModel.as
index 8a1e8fd..61ad036 100644
--- a/examples/flexjs/MapSearch/src/main/flex/models/MyModel.as
+++ b/examples/flexjs/MapSearch/src/main/flex/models/MyModel.as
@@ -37,7 +37,7 @@ package models
 			_strand = value;
 		}
 		
-		private var _cities:Array = ["Sydney", "NYC", "Mexico City", "London", "Rio de Janeiro"];
+		private var _cities:Array = ["San Jose, CA", "Sydney", "NYC", "Mexico City", "London",
"Rio de Janeiro"];
 		
 		[Bindable]
 		public function get cities():Array
@@ -45,7 +45,8 @@ package models
 			return _cities;
 		}
 		
-		private var _coordinates:Array = [{lat:-33.86, lng:151.211},
+		private var _coordinates:Array = [{lat:-37.3, lng: -121.5},
+			{lat:-33.86, lng:151.211},
 			{lat:40.712, lng:-74.0059},
 			{lat:19.26, lng:-99.03},
 			{lat:51.4, lng:-0.1},


Mime
View raw message