You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ti...@apache.org on 2012/01/20 12:23:50 UTC

svn commit: r1233871 - /incubator/flex/whiteboard/tink/navigators/examples/src/MenuBarExamples.mxml

Author: tink
Date: Fri Jan 20 11:23:50 2012
New Revision: 1233871

URL: http://svn.apache.org/viewvc?rev=1233871&view=rev
Log:
Examples for the MenuBar control.

Added:
    incubator/flex/whiteboard/tink/navigators/examples/src/MenuBarExamples.mxml

Added: incubator/flex/whiteboard/tink/navigators/examples/src/MenuBarExamples.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/tink/navigators/examples/src/MenuBarExamples.mxml?rev=1233871&view=auto
==============================================================================
--- incubator/flex/whiteboard/tink/navigators/examples/src/MenuBarExamples.mxml (added)
+++ incubator/flex/whiteboard/tink/navigators/examples/src/MenuBarExamples.mxml Fri Jan 20 11:23:50 2012
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+					   xmlns:s="library://ns.adobe.com/flex/spark" 
+					   xmlns:st="library://ns.tink.ws/flex/spark">
+		
+		<fx:Library>
+			<fx:Definition name="Divider">
+				<s:Graphic width="15" height="18">
+					<s:Rect width="15" height="18">
+						<s:fill>
+							<s:SolidColor alpha="0"/>
+						</s:fill>
+					</s:Rect>
+					<s:Line height="18" horizontalCenter="0">
+						<s:stroke>
+							<s:SolidColorStroke weight="2" color="0x000000" caps="none"/>
+						</s:stroke>
+					</s:Line>
+				</s:Graphic> 
+			</fx:Definition>
+		</fx:Library>
+		
+		
+		<s:Scroller width="100%" height="100%">
+			<s:VGroup horizontalAlign="center" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
+				
+				<s:Panel title="MenuBar with NavigatorGroup Example" bottom="10" left="10" right="10" top="10">
+					
+					<s:layout>
+						<s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"/>
+					</s:layout>
+					
+					<st:MenuBar dataProvider="{navigator}" labelField="id"
+								allowBranchSelection="{allowBranchSelection.selected}"
+								closeOnSelection="{closeOnSelection.selected}">
+					</st:MenuBar>
+					
+					<st:NavigatorGroup id="navigator" width="380" height="100">
+						<st:NavigatorGroup id="level_0" width="380" height="100">
+							<st:NavigatorGroup id="level_0_0" width="380" height="100">
+								<s:BorderContainer id="level_0_0_0_red" backgroundColor="0xFF00F00"/>
+								<s:BorderContainer id="level_0_0_1_green" backgroundColor="0x00FF00"/>
+								<s:BorderContainer id="level_0_0_2_blue" backgroundColor="0x0000FF"/>
+							</st:NavigatorGroup>
+							<st:NavigatorGroup id="level_0_1" width="380" height="100">
+								<s:BorderContainer id="level_0_1_0_yellow" backgroundColor="0xFFFF00"/>
+								<s:BorderContainer id="level_0_1_1_cyan" backgroundColor="0x00FFFF"/>
+								<s:BorderContainer id="level_0_1_2_purple" backgroundColor="0xFF00FF"/>
+							</st:NavigatorGroup>
+						</st:NavigatorGroup>
+						
+						<st:NavigatorGroup id="level_1" width="380" height="100">
+							<st:NavigatorGroup id="level_1_0" width="380" height="100">
+								<s:BorderContainer id="level_1_0_0_black" backgroundColor="0x000000"/>
+								<s:BorderContainer id="level_1_0_1_grey" backgroundColor="0xCCCCCC"/>
+								<s:BorderContainer id="level_1_0_2_white" backgroundColor="0xFFFFFF"/>
+							</st:NavigatorGroup>
+							<st:NavigatorGroup id="level_1_1" width="380" height="100">
+								<s:BorderContainer id="level_1_1_0_red3s" backgroundColor="0x330000"/>
+								<s:BorderContainer id="level_1_1_1_red6s" backgroundColor="0x660000"/>
+								<s:BorderContainer id="level_1_1_2_red9s" backgroundColor="0x990000"/>
+							</st:NavigatorGroup>
+						</st:NavigatorGroup>
+						
+						<st:NavigatorGroup id="level_2" width="380" height="100">
+							<s:BorderContainer id="level_2_0_grey3s" backgroundColor="0x333333"/>
+							<s:BorderContainer id="level_2_1_grey6s" backgroundColor="0x666666"/>
+							<s:BorderContainer id="level_2_2_grey9s" backgroundColor="0x999999"/>
+						</st:NavigatorGroup>
+						
+						<s:BorderContainer id="level_3_yellow" backgroundColor="0xFFFF00"/>
+						
+					</st:NavigatorGroup>
+					
+				</s:Panel>
+				
+				<s:Panel title="MenuBar with IList Example" bottom="10" left="10" right="10" top="10">
+					
+					<s:layout>
+						<s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"/>
+					</s:layout>
+					
+					<st:MenuBar id="menuBar" labelField="uid"
+								allowBranchSelection="{allowBranchSelection.selected}"
+								closeOnSelection="{closeOnSelection.selected}">
+						<st:dataProvider>
+							<s:ArrayList uid="navigator">
+								<s:ArrayList uid="level_0">
+									<s:ArrayList uid="level_0_0">
+										<fx:Object uid="level_0_0_0_red"/>
+										<fx:Object uid="level_0_0_1_green"/>
+										<fx:Object uid="level_0_0_2_blue"/>
+									</s:ArrayList>
+									<s:ArrayList uid="level_0_1">
+										<fx:Object uid="level_0_1_0_yellow"/>
+										<fx:Object uid="level_0_1_1_cyan"/>
+										<fx:Object uid="level_0_1_2_purple"/>
+									</s:ArrayList>
+								</s:ArrayList>
+								
+								<s:ArrayList uid="level_1">
+									<s:ArrayList uid="level_1_0">
+										<fx:Object uid="level_1_0_0_black"/>
+										<fx:Object uid="level_1_0_1_grey"/>
+										<fx:Object uid="level_1_0_2_white"/>
+									</s:ArrayList>
+									<s:ArrayList uid="level_1_1">
+										<fx:Object uid="level_1_1_0_red3s"/>
+										<fx:Object uid="level_1_1_1_red6s"/>
+										<fx:Object uid="level_1_1_2_red9s"/>
+									</s:ArrayList>
+								</s:ArrayList>
+								
+								<s:ArrayList uid="level_2">
+									<fx:Object uid="level_2_0_grey3s"/>
+									<fx:Object uid="level_2_1_grey6s"/>
+									<fx:Object uid="level_2_2_grey9s"/>
+								</s:ArrayList>
+								
+								<fx:Object uid="level_3_yellow"/>
+								
+							</s:ArrayList>
+						</st:dataProvider>
+					</st:MenuBar>
+					
+					<s:Label text="selectedLabels: {menuBar.selectedLabels.toString()}"/>
+					
+				</s:Panel>
+				
+				<s:Label text="MenuBar Properties" fontWeight="bold" fontSize="13" height="30" verticalAlign="bottom"/>
+				
+				<s:HGroup gap="0">
+					<s:CheckBox id="allowBranchSelection" label="allowBranchSelection:" fontWeight="bold" fontSize="8"/>
+					<fx:Divider/>
+					<s:CheckBox id="closeOnSelection" label="closeOnSelection:" fontWeight="bold" fontSize="8"/>
+				</s:HGroup>
+				
+			</s:VGroup>
+		</s:Scroller>
+	
+</s:Application>