 <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">


	
<!-- FRAMES -->
	
	<Frame virtual="true" name="ARKINV_TemplateSearchFrameMenu" inherits="ARKINV_TemplateFrameBasic">
	
		<Size x="200" y="40" />
		
	</Frame>
	
	
	<Button virtual="true" name="ARKINV_TemplateSearchTableRow" mouseEnabled="true" hidden="true">

		<Size x="2" y="2" />

		<Anchors>
			<Anchor point="LEFT" x="5" y="0" />
			<Anchor point="RIGHT" x="-30" y="0" />
		</Anchors>

		<Layers>

			<Layer level="OVERLAY">

				<!-- objects in this layer are rearranged via LUA for each table -->
				
				<Texture name="$parentT1" inherits="ARKINV_TextureUnknown" hidden="true" />
				<Texture name="$parentT2" inherits="ARKINV_TextureUnknown" hidden="true" />
				
				<FontString name="$parentC1" inherits="ARKINV_TableRowFont" hidden="true" />
				<FontString name="$parentC2" inherits="ARKINV_TableRowFont" hidden="true" />
				<FontString name="$parentC3" inherits="ARKINV_TableRowFont" hidden="true" />
				
			</Layer>
			
			<Layer level="BACKGROUND">

				<FontString name="$parentId" inherits="ARKINV_TableRowFont" hidden="true" />
			
				<Texture name="$parentHighlight" inherits="ARKINV_TextureHighlight">
					<Anchors>
						<Anchor point="TOPLEFT" x="5" y="0" />
						<Anchor point="BOTTOMRIGHT" x="-5" y="0" />
					</Anchors>
				</Texture>

				<Texture name="$parentSelected" inherits="ARKINV_TextureSelected">
					<Anchors>
						<Anchor point="TOPLEFT" x="5" y="0" />
						<Anchor point="BOTTOMRIGHT" x="-5" y="0" />
					</Anchors>
				</Texture>

			</Layer>

		</Layers>

		<Scripts>
			
			<OnLoad>
				self:RegisterForClicks( "LeftButtonUp" )
				ArkInventory.Frame_Search_Table_Row_Build( self )
			</OnLoad>
			
			<OnUpdate>
				if _G[string.format( "%s%s", self:GetName( ), "Highlight" )]:IsShown( ) then
					h = _G[string.format( "%s%s", self:GetName( ), "Id" )]:GetText( )
					ArkInventory.GameTooltipSetHyperlink( self, h )
				end
			</OnUpdate>
			
			<OnEnter>
				_G[string.format( "%s%s", self:GetName( ), "Highlight" )]:Show( )
				h = _G[string.format( "%s%s", self:GetName( ), "Id" )]:GetText( )
				ArkInventory.GameTooltipSetHyperlink( self, h )
			</OnEnter>
			
			<OnLeave>
				_G[string.format( "%s%s", self:GetName( ), "Highlight" )]:Hide( )
				ArkInventory.GameTooltipHide( )
			</OnLeave>

			<OnClick>
				PlaySound( "igMainMenuOptionCheckBoxOn" )
				ArkInventory.Frame_Search_Table_Row_OnClick( self )
			</OnClick>

		</Scripts>

	</Button>

	
	<Frame virtual="true" name="ARKINV_TemplateSearchTable" inherits="ARKINV_TemplateFrameBasic" mouseEnabled="true">

		<Size x="2" y="2" />
		
		<Layers>
			<Layer level="BACKGROUND">
				<!-- fields used to maintain the table, set via LUA in OnLoad -->
				<FontString name="$parentMaxRows" inherits="ARKINV_GameFontNormal" text="19" hidden="true" />
				<FontString name="$parentNumRows" inherits="ARKINV_GameFontNormal" text="1" hidden="true" />
				<FontString name="$parentRowHeight" inherits="ARKINV_GameFontNormal" text="30" hidden="true" />
				<FontString name="$parentSelectedRow" inherits="ARKINV_GameFontNormal" hidden="true" />
				<FontString name="$parentSelectedId" inherits="ARKINV_GameFontNormal" hidden="true" />
			</Layer>
		</Layers>
		
		<Frames>

			<Button name="$parentRow1" inherits="ARKINV_TemplateSearchTableRow" id="1">
				<Anchors>
					<Anchor point="TOP" x="0" y="-10" />
				</Anchors>
			</Button>

			<Button name="$parentRow2" inherits="ARKINV_TemplateSearchTableRow" id="2">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow1" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow3" inherits="ARKINV_TemplateSearchTableRow" id="3">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow2" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow4" inherits="ARKINV_TemplateSearchTableRow" id="4">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow3" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow5" inherits="ARKINV_TemplateSearchTableRow" id="5">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow4" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow6" inherits="ARKINV_TemplateSearchTableRow" id="6">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow5" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow7" inherits="ARKINV_TemplateSearchTableRow" id="7">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow6" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow8" inherits="ARKINV_TemplateSearchTableRow" id="8">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow7" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow9" inherits="ARKINV_TemplateSearchTableRow" id="9">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow8" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow10" inherits="ARKINV_TemplateSearchTableRow" id="10">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow9" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow11" inherits="ARKINV_TemplateSearchTableRow" id="11">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow10" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow12" inherits="ARKINV_TemplateSearchTableRow" id="12">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow11" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow13" inherits="ARKINV_TemplateSearchTableRow" id="13">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow12" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow14" inherits="ARKINV_TemplateSearchTableRow" id="14">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow13" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow15" inherits="ARKINV_TemplateSearchTableRow" id="15">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow14" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow16" inherits="ARKINV_TemplateSearchTableRow" id="16">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow15" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow17" inherits="ARKINV_TemplateSearchTableRow" id="17">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow16" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow18" inherits="ARKINV_TemplateSearchTableRow" id="18">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow17" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow19" inherits="ARKINV_TemplateSearchTableRow" id="19">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow18" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow20" inherits="ARKINV_TemplateSearchTableRow" id="20">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow19" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<ScrollFrame name="$parentScroll" inherits="FauxScrollFrameTemplate">

				<Anchors>
					<Anchor point="TOPRIGHT" x="-30" y="-10" />
					<Anchor point="BOTTOMRIGHT" x="0" y="10" />
				</Anchors>

				<Scripts>

					<OnVerticalScroll>
						local h = _G[string.format( "%s%s", self:GetParent( ):GetName( ), "RowHeight" )]:GetText( )
						FauxScrollFrame_OnVerticalScroll( self, offset, h, ArkInventory.Frame_Search_Table_Scroll )
					</OnVerticalScroll>

					<OnShow>
						ArkInventory.Frame_Search_Table_Refresh( self )
					</OnShow>

				</Scripts>

			</ScrollFrame>

		</Frames>

		<Scripts>
		
			<OnLoad>
				ArkInventory.Frame_Search_Table_Build( self )
			</OnLoad>
			
		</Scripts>
		
	</Frame>


	
	
	
	
	<!-- basic view table -->
	<Frame virtual="true" name="ARKINV_TemplateSearchTableView">

		<Size x="2" y="450" />

		<Anchors>
			<Anchor point="TOP" />
			<Anchor point="LEFT" x="20" y="0" />
			<Anchor point="RIGHT" x="-20" y="0" />
			<Anchor point="BOTTOM" x="0" y="20" />
		</Anchors>
		
		<Scripts>

			<OnShow>
				_G[string.format( "%s%s", self:GetName( ), "TableScroll" )]:Show( )
			</OnShow>

		</Scripts>

		<Frames>

			<Frame name="$parentSearch" inherits="ARKINV_TemplateFrameBasic">

				<Size x="2" y="40" />

				<Anchors>
					<Anchor point="TOP" x="0" y="-20" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>
				
				<Frames>
					
					<Button name="$parentClear" inherits="ARKINV_TemplateButtonClear">
						<Anchors>
							<Anchor point="RIGHT" x="-8" y="0" />
						</Anchors>
					</Button>
					
					<EditBox name="$parentFilter" inherits="ARKINV_TemplateEditBox" letters="80">
						
						<Size x="2" y="20" />
						
						<Anchors>
							<Anchor point="LEFT" x="80" y="0" />
							<Anchor point="RIGHT" relativeTo="$parentClear" relativePoint="LEFT" x="-2" y="0" />
						</Anchors>
						
						<Scripts>
							
							<OnLoad>
								ArkInventory.UiSetEditBoxLabel( self, string.format( "%s:", ArkInventory.Localise["SEARCH"] ) )
							</OnLoad>
							
							<OnShow>
								self:SetFocus( )
							</OnShow>
							
							<OnCursorChanged>
								ArkInventory.Frame_Search_Table_Refresh( self )
							</OnCursorChanged>
							
							<OnEnterPressed>
								self:ClearFocus( )
								ArkInventory.Frame_Search_Table_Refresh( self )
							</OnEnterPressed>
							
						</Scripts>
						
					</EditBox>

				</Frames>

			</Frame>

			<Frame name="$parentTable" inherits="ARKINV_TemplateSearchTable">

				<Anchors>
					<Anchor point="TOP" relativeTo="$parentSearch" relativePoint="BOTTOM" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>

			</Frame>
		
		</Frames>

	</Frame>

	
	<Frame virtual="true" name="ARKINV_TemplateSearchMain" inherits="ARKINV_TemplateFrameStandard">
	
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentType" hidden="true">
					<Scripts>
						<OnLoad>
							self:SetText( ArkInventory.Localise["SEARCH"] )
						</OnLoad>
					</Scripts>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
		
			<Frame name="$parentView" inherits="ARKINV_TemplateSearchTableView" hidden="false" />
			
		</Frames>

	</Frame>

	
	
	
<!-- SEARCH FRAME STARTS HERE -->

	<Frame name="ARKINV_Search" parent="UIParent" toplevel="true" movable="true" enableMouse="true" hidden="true" clampedToScreen="true" frameStrata="MEDIUM">
	
		<Size x="500" y="600" />

		<Anchors>
			<Anchor point="CENTER" />
		</Anchors>

		<Frames>

			<Frame name="$parentTitle" inherits="ARKINV_TemplateFrameStandard">

				<Size x="400" y="40" />

				<Anchors>
					<Anchor point="TOPLEFT" />
					<Anchor point="RIGHT" />
				</Anchors>
			
				<Frames>
				
					<Button name="$parentMenu">
					
						<Size x="24" y="24" />
						
						<NormalTexture file="Interface\Minimap\Tracking\None" />
						
						<Anchors>
							<Anchor point="LEFT" x="6" y="0" />
						</Anchors>
						
					</Button>

					<Button name="$parentClose" inherits="ARKINV_TemplateButtonClose">
					
						<Anchors>
							<Anchor point="RIGHT" x="-8" y="0" />
						</Anchors>
						
						<Scripts>
						
							<OnClick>
								ArkInventory.Frame_Search_Hide( )
							</OnClick>
							
						</Scripts>
						
					</Button>


					<Frame>
						<Layers>
							<Layer level="ARTWORK">
								<FontString name="$parentWho" inherits="ARKINV_GameFontNormalLarge" justifyH="LEFT" text="ERROR">
									<Anchors>
										<Anchor point="TOP" relativeTo="$parentMenu" relativePoint="TOP" />
										<Anchor point="BOTTOM" relativeTo="$parentMenu" relativePoint="BOTTOM" />
										<Anchor point="LEFT" relativeTo="$parentMenu" relativePoint="RIGHT" x="5" y="0" />
										<Anchor point="RIGHT" relativeTo="$parentClose" relativePoint="RIGHT" x="-20" y="0" />
									</Anchors>
								</FontString>
							</Layer>
						</Layers>
					</Frame>

				</Frames>

			</Frame>
			
			<Frame name="$parentFrame" inherits="ARKINV_TemplateSearchMain">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT" x="0" y="2" />
					<Anchor point="BOTTOMRIGHT" />
				</Anchors>
			</Frame>
			
		</Frames>
		
		<Scripts>
			
			<OnLoad>
				self.name = ArkInventory.Localise["SEARCH"]
				self.parent = ArkInventory.Const.Program.Name
			
				self:RegisterForDrag( "LeftButton" )
				table.insert( UISpecialFrames, self:GetName( ) )
				
				self:SetDontSavePosition( true )
				self:SetUserPlaced( false )
			</OnLoad>
			
			<OnDragStart>
				self:StartMoving( )
			</OnDragStart>
			
			<OnDragStop>
				self:StopMovingOrSizing( )
			</OnDragStop>
			
			<OnShow>
				PlaySound( "igMainMenuOptionCheckBoxOn" )
				ArkInventory.Frame_Search_Paint( )
			</OnShow>
			
			<OnHide>
				PlaySound( "igMainMenuOptionCheckBoxOn" )
			</OnHide>
			
		</Scripts>
		
	</Frame>
	
<!-- END OF MAIN FRAME -->
	
</Ui>
