<?xml version="1.0" encoding="UTF-8"?>
<Application autoNameMapping="true">
	<Window isNameRoot="true">

		<!-- 

			This is a test case to show how a composite class can be defined in pure ADF XML
			and then used in the ADF
			
		 -->

		<Label Property.name="dataContainer" top="15" left="10" width="200" padding="4" paddingLeft="8" 
			backColor="#FFCC00" border="1px outset"/>
		<Property name="dataText" read="true" write="true" src=".dataContainer" srcProperty="text"/>
		
		<MyControl top="50" left="10"/>
		<MyControl top="150" left="10"/>
		<MyControl top="250" left="10"/>
		
		<MyControl top="50" left="300"/>
		<MyControl top="150" left="300"/>
		<MyControl top="250" left="300"/>

	</Window>
	<Resources>
		<CustomClass name="MyControl">
			<!-- 
				
				- Composite Component test -
				
				. load the text of a textfield into the a label at startup
				. update the text in the label as we type and set a warning icon that text changed
				. fake a commit when pressing the button : remove warn icon and set the text to the 
				  top(blue)label and the orange one as well
				
			-->
			<Component width="250" height="80" border="2px groove">
				
				<!-- icon -->
				<Image Property.name="myIcon" height="16" width="16" top="4" right="4" 
					zIndex="99999"  uri="../../html/images/infomark.16.gif" visible="false"
					toolTipText="Text has changed!"/>
	
				<!-- top label -->
				<Label Property.name="myTopLabel" top="0" left="0" right="0" padding="4" paddingLeft="8" 
					foreColor="FFFFFF" backColor="#3399CC" border="1px outset"/>
				 
				<!-- label -->
				<Label Property.name="myLabel" top="26" left="4" right="4" padding="4" backColor="#EFEFEF">
					<EventListener type="create">	<!-- grab text at startup. -->
						<Reference type="property" name="text">
							<Reference.arguments>
								<Reference type="property" src=".parent.myTextField" name="text"/>
							</Reference.arguments>
						</Reference>
					</EventListener>
				</Label>
					
				<!-- input field -->
				<TextField Property.name="myTextField" text="Text" top="50" left="4" right="46">			
					<EventListener type="keyup">
						<Reference type="property" src=".parent.myLabel" name="text">
							<Reference.arguments>
								<Reference type="property" name="text"/>
							</Reference.arguments>
						</Reference>
					</EventListener>
					<EventListener type="textchanged">
						<Reference type="property" src=".parent.myIcon" name="visible" arguments="true"/>
					</EventListener>
				</TextField>
				
				<!-- commit button -->
				<Button text="set" top="50" right="4" height="22" width="38">
					<EventListener type="action">
					 	<Reference type="property" src=".parent.parent" name="dataText">
							<Reference.arguments>
								<Reference type="property" src=".parent.myLabel" name="text"/>
							</Reference.arguments>
						</Reference>
						<Reference type="property" src=".parent.myTopLabel" name="text">
							<Reference.arguments>
								<Reference type="property" src=".parent.myLabel" name="text"/>
							</Reference.arguments>
						</Reference>
						<Reference type="property" src=".parent.myIcon" name="visible" arguments="false"/> 
					</EventListener>		
				</Button>
		
			</Component>
		</CustomClass>
	</Resources>
</Application>