<?xml version="1.0" encoding="utf-8"?>
<!--creationComplete="myDataGrid.selectedIndex=0;"-->
<mx:Application 
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	xmlns:controls="com.fxcomponents.controls.*" 
	layout="absolute"
	width="800" height="620"
 	backgroundGradientAlphas="[1.0, 0.0]" 
	backgroundGradientColors="[#B0AEAE, #FFFFFF]" 
	borderStyle="none" 
	borderColor="#FFFFFF" 
	cornerRadius="20" 
	alpha="1.0" 
	borderThickness="1" xmlns:ns1="com.google.maps.controls.*">
	<mx:Script source="com/projekt/maps.as"/>
	<mx:Script>
		<![CDATA[

// Ein- und Ausblenden der explizit angegebenen Tabs + Umbennung expliziter Knopf		
 		private function testTabSwitch():void{	
 	    if (tabs.getTabAt(4).visible==true){
 	    tabs.getTabAt(4).visible = false;	
  	    tabs.getTabAt(5).visible = false;	
  	    tabs.getTabAt(6).visible = false;	
  	    tabs.getTabAt(7).visible = false;	
  	    tabs.getTabAt(8).visible = false;	
  	    tabs.getTabAt(9).visible = false; 		
		test_knopf.label = "Testtab ein";	
 	    }
 	    else {
 	    tabs.getTabAt(4).visible = true;	
  	    tabs.getTabAt(5).visible = true;	
  	    tabs.getTabAt(6).visible = true;	
  	    tabs.getTabAt(7).visible = true;	
  	    tabs.getTabAt(8).visible = true;	
  	    tabs.getTabAt(9).visible = true; 		
		test_knopf.label = "Testtab aus";	
 	    }
 	    } 
   
// txt laden und an explizite Stelle zurückschreiben
		import flash.net.navigateToURL;
    	import flash.net.URLLoader;
    	import flash.net.URLRequest;
 	    import mx.controls.Alert;
 	    
 	    function textLaden(ort:String):void{
 	    	var request:URLRequest = new URLRequest(ort);
            var loader:URLLoader = new URLLoader();
            var txt:String = new String();
            loader.addEventListener(Event.COMPLETE, completeHandler);
            loader.dataFormat = URLLoaderDataFormat.TEXT;           
            try{
                loader.load(request);
            }
            catch (error:ArgumentError){
                Alert.show("Datei anzeigen hat nicht geklappt", error.message);
            }
            catch (error:SecurityError){
                Alert.show("Datei anzeigen hat nicht geklappt", error.message);
            }
        	function completeHandler(event:Event):void{
        		var quelltext:URLLoader = URLLoader(event.target);
        		txt_text.text = quelltext.data;
        	} 	    	
 	    }
			]]>
	</mx:Script>

<!--GUI - Layout -->


	<mx:Panel id="panel"
		width="795" height="615" 
		layout="absolute" 
		fontSize="12" 
		borderStyle="inset" 
		alpha="1.0" 
		borderColor="#67BEDE" 
		themeColor="#043F64" 
		borderThickness="3" 
		backgroundColor="#E8E7E7"
	    left="1" top="1" title="Stkm - FM - IT - KlinSys" horizontalAlign="center"  fontStyle="normal" textDecoration="normal" fontWeight="normal">
		
		<mx:Image id="logo"
			width="65" height="67"  
			source="img/stkm.png" 
			scaleContent="true" 
			autoLoad="true" 
		/>
		
		<mx:TabNavigator id="tabs"      
			x="0" y="73" width="743" height="468">
			<mx:Canvas label="Organisation" width="100%" height="100%" id="org_tab">		
				<mx:TextArea x="22" y="21" height="335" width="687"/>
			</mx:Canvas>
			<mx:Canvas label="Projekte" width="100%" height="100%" id="pro_tab">
			</mx:Canvas>
			<mx:Canvas label="Fortbildung" width="100%" height="100%" id="fob_tab" >
			</mx:Canvas>
			<mx:Canvas label="Hilfe" width="100%" height="100%" id="hil_tab" >
			</mx:Canvas>
			<mx:Canvas label="xml" width="100%" height="100%" id="e1" >
			</mx:Canvas>
			<mx:Canvas label="txt" width="100%" height="100%" id="e2" >
				<mx:TextArea id="txt_text"
					x="10" y="43" width="721" height="376" 
					editable="false" 
					fontSize="10" fontFamily="Courier New" 
				/>
				<mx:LinkButton id="txt_linkQ"
					x="10" y="10" 
					label="Quelltext anzeigen" fontSize="10"  
					click="textLaden('txt/xml_ich.mxml')"
				/>
				<mx:LinkButton id="txt_linkH"
					x="145" y="10" 
					label="Hilfetext anzeigen" fontSize="10"  
					click="textLaden('txt/hilfe.txt')"
				/>
				<mx:LinkButton id="txt_linkpdf"
					x="277" y="10" 
					label="pdf anzeigen" fontSize="10"
					click="navigateToURL(new URLRequest('txt/pdf_test.pdf'), '_blank')" />
			 
			</mx:Canvas>
			<mx:Canvas label="flash" width="100%" height="100%" id="e3" >
				<mx:SWFLoader x="10" y="10" width="721" height="409" id="flash">
					<mx:source>swf/projekt.swf</mx:source>
				</mx:SWFLoader>
			</mx:Canvas>
			<mx:Canvas label="video" width="100%" height="100%" id="e4" >
				<controls:FXVideo id="videocont" width="591" height="379" source="video/demo_kurz.flv" autoPlay="false" bufferTime="10"  x="140" y="0"/> 
				<mx:Label x="10" y="10" text="Video auswählen"/>
				<mx:ComboBox id="video_select" x="10" y="38" width="113"   editable="false"
					change="videocont.source ='video/demo_lang.flv' ;videocont.play()" >
				 	<mx:dataProvider>
						<mx:String>Demo kurz</mx:String>
						<mx:String>Demo lang</mx:String>
						<mx:String>externe URL</mx:String>
					</mx:dataProvider>					
				</mx:ComboBox>
			</mx:Canvas>
			<mx:Canvas label="maps" width="100%" height="100%" id="e5" >
			
			<!-- key="ABQIAAAAroW6Aw_GFUiFCrVuyp3uQRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQc4ViGo_zxQ35_cu-YD6m_6_39yw" für localhost -->
			<!-- key="ABQIAAAAroW6Aw_GFUiFCrVuyp3uQRSPR7udORx7-O937BfVzWu5_BlVohSIiOdyu8_cM3hb1al5OZmDSBATtA" für festenberg.de -->
				
				<maps:Map xmlns:maps="com.google.maps.*" id="map"
 					key="ABQIAAAAroW6Aw_GFUiFCrVuyp3uQRSPR7udORx7-O937BfVzWu5_BlVohSIiOdyu8_cM3hb1al5OZmDSBATtA"
 					
       				 mapevent_mapready="onMapReady(event, 'Bonnerplatz 3 München')"
					width="582" height="421" 
					horizontalCenter="69" verticalCenter="-4"
		
				/>			
				
				<mx:Button id="maps_knopf1"
					x="33" y="40" 
					label="Anzeigen" fontSize="10"
					click="doGeocode(event, maps_ziel.text);"
				/>
				
				<mx:TextInput  id="maps_ziel"
					x="10" y="10" width="131"
					text="Bonnerplatz 3 München"
					enter="doGeocode(event, maps_ziel.text);"
					 fontSize="10"
				/>
				
				<mx:CheckBox id="maps_kartenTyp"
					x="10" y="101" 
					label="Kartentyp wählen" fontSize="10" 
					selected="true" 
				 	click="toggleControl('mtc',maps_kartenTyp.selected)"
				 />
				
				<mx:CheckBox id="maps_toggleUebersicht"
					x="10" y="119" 
					label="Übersichtsfenster" fontSize="10"  
					selected="true"
				 	click="toggleControl('omc',maps_toggleUebersicht.selected)"
				/>
			</mx:Canvas>
			
			<mx:Canvas label="db" width="100%" height="100%" id="e6" >
				<mx:TextArea x="30" y="40" width="223" height="187" id="db_textarea">
					<mx:text>Hier sollen die Inhalte der DB Tabellen angezeigt werden als xml tree</mx:text>
				</mx:TextArea>
				<mx:ComboBox id="db_tabSelector"
					x="30" y="10" width="223" 
					editable="false">
				 	<mx:dataProvider>
						<mx:String>Germany</mx:String>
						<mx:String>France</mx:String>
						<mx:String>China</mx:String>
					</mx:dataProvider>
				</mx:ComboBox>
				<mx:DataGrid x="30" y="268" width="266">
					<mx:columns>
						<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
						<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
						<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
					</mx:columns>
				</mx:DataGrid>
				<mx:PlotChart x="331" y="10" id="plotchart1">
					<mx:series>
						<mx:PlotSeries displayName="Series 1" yField=""/>
					</mx:series>
				</mx:PlotChart>
			</mx:Canvas>
		</mx:TabNavigator>
		
		<mx:Button id="test_knopf"
			x="630" y="10" width="112"
			label="Testtabs aus" fontSize="10"
			click="testTabSwitch()"  
		/>

	</mx:Panel>
	
</mx:Application>
