﻿<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">


<!-- FONTS -->

	<Font virtual="true" name="ARKINV_RuleEntryFont" inherits="ARKINV_GameFontNormal" font="Fonts\FRIZQT__.TTF">
		<FontHeight>
			<AbsValue val="12" />
		</FontHeight>
	</Font>



<!-- BUTTONS -->
	
	<Button virtual="true" name="ARKINV_TemplateRuleButton" inherits="UIPanelButtonTemplate">
	
<!--
		<NormalFont inherits="ARKINV_GameFontNormal" />
		
		<HighlightFont inherits="ARKINV_GameFontHighlight" />
		
		<DisabledFont inherits="ARKINV_GameFontDisable" />
-->
		
	</Button>

	
	<Button virtual="true" name="ARKINV_TemplateButtonMenuShort" inherits="ARKINV_TemplateRuleButton">
		<Size x="70" y="32" />
	</Button>

	
	<Button virtual="true" name="ARKINV_TemplateButtonTableSort">
		
		<NormalFont inherits="ARKINV_GameFontNormalSmall" />
		<HighlightFont inherits="ARKINV_GameFontNormalSmall" />
		<DisabledFont inherits="ARKINV_GameFontNormalSmall" />
		
		<NormalTexture inherits="ARKINV_TextureTransparent" />
		<PushedTexture inherits="ARKINV_TextureTransparent" />
		<DisabledTexture inherits="ARKINV_TextureTransparent" />
		<HighlightTexture inherits="ARKINV_TextureHighlight" />
		
		<Scripts>

			<OnClick>
				<!-- PlaySound( "igMainMenuOptionCheckBoxOn" ) -->
				local k = strmatch( self:GetName( ), "^.+_(.-)$" )
			</OnClick>
			
		</Scripts>
		
	</Button>

	
<!-- FRAMES -->
	
	<Frame virtual="true" name="ARKINV_TemplateRuleFrameMenu" inherits="ARKINV_TemplateFrameBasic">
		<Size x="200" y="40" />
	</Frame>
	
	
	<Frame virtual="true" name="ARKINV_TemplateRuleFrameTitle" inherits="ARKINV_TemplateFrameBasic">
	
		<Size x="2" y="30" />
		
		<Anchors>
			<Anchor point="TOP" relativeTo="$parent" relativePoint="TOP">
				<Offset x="0" y="-20" />
			</Anchor>
			<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT" />
			<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT" />
		</Anchors>
		
		<Layers>
		
			<Layer level="OVERLAY">
			
				<FontString name="$parentText" inherits="ARKINV_DataEntryFont" text="title">
					<Anchors>
						<Anchor point="CENTER" />
					</Anchors>
					<Color r="1" g="1" b="1" a="1" />
				</FontString>
				
			</Layer>
			
		</Layers>
		
	</Frame>
	
	
	<Frame virtual="true" name="ARKINV_TemplateRuleFrameOkCancel" inherits="ARKINV_TemplateRuleFrameMenu">

		<Frames>

			<Button name="$parentOk" inherits="ARKINV_TemplateButtonMenuShort" text="ok">
			
				<Anchors>
					<Anchor point="LEFT">
						<Offset x="5" y="0" />
					</Anchor>
				</Anchors>
				
				<Scripts>
				
					<OnLoad>
						self:SetText( ArkInventory.Localise["OK"] )
					</OnLoad>
					
					<OnClick>
						PlaySound( "igMainMenuOptionCheckBoxOn" )
						ArkInventoryRules.Frame_Rules_Button_Modify_Ok( )
					</OnClick>
					
				</Scripts>

			</Button>

			<Button name="$parentCancel" inherits="ARKINV_TemplateButtonMenuShort" text="cancel">
			
				<Anchors>
					<Anchor point="RIGHT">
						<Offset x="-5" y="0" />
					</Anchor>
				</Anchors>
				
				<Scripts>
				
					<OnLoad>
						self:SetText( ArkInventory.Localise["CANCEL"] )
					</OnLoad>
					
					<OnClick>
						PlaySound( "igMainMenuOptionCheckBoxOn" )
						ArkInventoryRules.Frame_Rules_Button_Modify_Cancel( )
					</OnClick>
					
				</Scripts>
				
			</Button>

		</Frames>
		
	</Frame>

	
	
	<!-- used for adding, editing and removal -->
	<Frame virtual="true" name="ARKINV_TemplateRuleModify" hidden="true">

		<Anchors>
			<Anchor point="TOP" />
			<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
				<Offset x="20" y="0" />
			</Anchor>
			<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT">
				<Offset x="-20" y="0" />
			</Anchor>
			<Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM">
				<Offset x="0" y="20" />
			</Anchor>
		</Anchors>

		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentType" inherits="ARKINV_DataEntryFont" hidden="true" />
			</Layer>
		</Layers>

		<Frames>
			
			<Frame name="$parentTitle" inherits="ARKINV_TemplateRuleFrameTitle" />

			<Frame name="$parentMenu" inherits="ARKINV_TemplateRuleFrameOkCancel">
				<Anchors>
					<Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM">
						<Offset x="0" y="20" />
					</Anchor>
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>
			</Frame>

			<Frame name="$parentData" inherits="ARKINV_TemplateFrameBasic">

				<Anchors>
					<Anchor point="TOP" relativeTo="$parentTitle" relativePoint="BOTTOM" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
					<Anchor point="BOTTOM" relativeTo="$parentMenu" relativePoint="TOP" />
				</Anchors>

				<Layers>

					<Layer level="OVERLAY">

						<FontString name="$parentIdLabel" inherits="ARKINV_DataEntryLabelFont" text="rule:" justifyH="RIGHT">
							<Anchors>
								<Anchor point="LEFT" relativeTo="$parent" relativePoint="TOPLEFT">
									<Offset x="90" y="-30" />
								</Anchor>
							</Anchors>
							<Scripts>
								<OnLoad>
									self:SetText( "no data" )
								</OnLoad>
							</Scripts>
						</FontString>

						<FontString name="$parentId" inherits="ARKINV_DataEntryFontDisable">
							<Anchors>
								<Anchor point="LEFT" relativeTo="$parentIdLabel" relativePoint="RIGHT">
									<Offset x="10" y="0" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentEnabledLabel" inherits="ARKINV_DataEntryLabelFont" text="enabled:" justifyH="RIGHT">
							<Anchors>
								<Anchor point="TOPRIGHT" relativeTo="$parentIdLabel" relativePoint="BOTTOMRIGHT">
									<Offset x="0" y="-20" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentOrderLabel" inherits="ARKINV_DataEntryLabelFont" text="order:" justifyH="RIGHT">
							<Anchors>
								<Anchor point="TOPRIGHT" relativeTo="$parentEnabledLabel" relativePoint="BOTTOMRIGHT">
									<Offset x="0" y="-20" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentOrderReadOnly" inherits="ARKINV_DataEntryFontDisable" justifyH="LEFT" hidden="true">
							<Anchors>
								<Anchor point="LEFT" relativeTo="$parentOrderLabel" relativePoint="RIGHT">
									<Offset x="10" y="0" />
								</Anchor>
								<Anchor point="RIGHT">
									<Offset x="-30" y="0" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentDescriptionLabel" inherits="ARKINV_DataEntryLabelFont" text="description:" justifyH="RIGHT">
							<Anchors>
								<Anchor point="TOPRIGHT" relativeTo="$parentOrderLabel" relativePoint="BOTTOMRIGHT">
									<Offset x="0" y="-20" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentDescriptionReadOnly" inherits="ARKINV_DataEntryFontDisable" justifyH="LEFT" hidden="true">
							<Anchors>
								<Anchor point="LEFT" relativeTo="$parentDescriptionLabel" relativePoint="RIGHT">
									<Offset x="10" y="0" />
								</Anchor>
								<Anchor point="RIGHT">
									<Offset x="-30" y="0" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentFormulaLabel" inherits="ARKINV_DataEntryLabelFont" text="formula:" justifyH="RIGHT">
							<Anchors>
								<Anchor point="TOPRIGHT" relativeTo="$parentDescriptionLabel" relativePoint="BOTTOMRIGHT">
									<Offset x="0" y="-20" />
								</Anchor>
							</Anchors>
						</FontString>

						<FontString name="$parentFormulaReadOnly" inherits="ARKINV_DataEntryFontDisable" justifyH="LEFT" justifyV="TOP"  hidden="true">
							<Anchors>
								<Anchor point="TOPLEFT" relativeTo="$parentFormulaLabel" relativePoint="TOPRIGHT">
									<Offset x="10" y="0" />
								</Anchor>
								<Anchor point="RIGHT">
									<Offset x="-30" y="0" />
								</Anchor>
								<Anchor point="BOTTOM">
									<Offset x="0" y="20" />
								</Anchor>
							</Anchors>
						</FontString>

					</Layer>
					
				</Layers>

				<Frames>

					<CheckButton name="$parentEnabled" inherits="OptionsCheckButtonTemplate" checked="true">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentEnabledLabel" relativePoint="RIGHT">
								<Offset x="10" y="0" />
							</Anchor>
						</Anchors>
					</CheckButton>
				
					<CheckButton name="$parentEnabledReadOnly" inherits="OptionsCheckButtonTemplate" disabled="true" hidden="true">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentEnabledLabel" relativePoint="RIGHT">
								<Offset x="10" y="0" />
							</Anchor>
						</Anchors>
					</CheckButton>
				
					<EditBox name="$parentOrder" inherits="ARKINV_TemplateEditBoxNoLabel" letters="4" type="numeric">

						<Size x="60" y="40" />
						
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentOrderLabel" relativePoint="RIGHT">
								<Offset x="10" y="0" />
							</Anchor>
						</Anchors>

						<Scripts>
						
							<OnShow>
								self:SetFocus( )
							</OnShow>
							
							<OnEnterPressed>
								self:ClearFocus( )
							</OnEnterPressed>

							<OnTabPressed>
								ArkInventory.UiTabToNext( self, "Order", "ScrollFormula", "Description" )
							</OnTabPressed>

						</Scripts>

					</EditBox>
				
					<EditBox name="$parentDescription" inherits="ARKINV_TemplateEditBoxNoLabel" letters="80">

						<Size x="2" y="40" />

						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentDescriptionLabel" relativePoint="RIGHT">
								<Offset x="10" y="0" />
							</Anchor>
							<Anchor point="RIGHT">
								<Offset x="-10" y="0" />
							</Anchor>
						</Anchors>

						<Scripts>
						
							<OnEnterPressed>
								self:ClearFocus( )
							</OnEnterPressed>

							<OnTabPressed>
								ArkInventory.UiTabToNext( self, "Description", "Order", "ScrollFormula" )
							</OnTabPressed>

						</Scripts>

					</EditBox>

					<ScrollFrame name="$parentScroll" inherits="UIPanelScrollFrameTemplate">
						
						<Anchors>
							<Anchor point="TOP" relativeTo="$parentFormulaLabel" relativePoint="TOP">
								<Offset x="10" y="0" />
							</Anchor>
							<Anchor point="LEFT" relativeTo="$parentFormulaLabel" relativePoint="RIGHT">
								<Offset x="10" y="0" />
							</Anchor>
							<Anchor point="RIGHT">
								<Offset x="-35" y="0" />
							</Anchor>
							<Anchor point="BOTTOM">
								<Offset x="0" y="15" />
							</Anchor>
						</Anchors>
						
						<ScrollChild>
							
							<EditBox name="$parentFormula" multiLine="true" historyLines="0" autoFocus="false">
								
								<Size x="1" y="1" />
							
								<Anchors>
									<Anchor point="TOPLEFT" />
									<Anchor point="BOTTOMRIGHT" />
								</Anchors>
		
								<FontString inherits="ARKINV_DataEntryFont" />
								
								<Scripts>
									
									<OnEscapePressed>
										self:ClearFocus( )
									</OnEscapePressed>
									
									<OnTextChanged>
										ScrollingEdit_OnTextChanged( self )
									</OnTextChanged>
									
									<OnCursorChanged>
										ScrollingEdit_OnCursorChanged( self, x, y, w, h )
									</OnCursorChanged>
									
									<OnUpdate>
										ScrollingEdit_OnUpdate( self, elapsed )
									</OnUpdate>
									
									<OnShow>
										self:SetWidth( self:GetParent( ):GetWidth( ) )
									</OnShow>
									
									<OnTabPressed>
										ArkInventory.UiTabToNext( self, "ScrollFormula", "Description", "Order" )
									</OnTabPressed>
									
								</Scripts>
		
							</EditBox>
					
						</ScrollChild>
						
					</ScrollFrame>
					
					<Frame name="$parentScrollTextBorder">
						<Size x="1" y="1" />
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="$parentScroll">
								<Offset x="-6" y="6" />
							</Anchor>
							<Anchor point="BOTTOM" relativeTo="$parentScroll">
								<Offset x="0" y="-6" />
							</Anchor>
							<Anchor point="RIGHT" relativeTo="$parentScroll">
								<Offset x="6" y="0" />
							</Anchor>
						</Anchors>
						<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border">
							<EdgeSize>
								<AbsValue val="16" />
							</EdgeSize>
							<BorderColor r="0.5" g="0.5" b="0.5" />
						</Backdrop>
					</Frame>
					
				</Frames>
				
			</Frame>
			
		</Frames>

	</Frame>

	
	<Button virtual="true" name="ARKINV_TemplateRuleTableRow" mouseEnabled="true" hidden="true">

		<Size x="2" y="2" />

		<Anchors>
			<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
				<Offset x="5" y="0" />
			</Anchor>
			<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT">
				<Offset x="-30" y="0" />
			</Anchor>
		</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" relativeTo="$parent" relativePoint="TOPLEFT">
							<Offset x="5" y="0" />
						</Anchor>
						<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
							<Offset x="-5" y="0" />
						</Anchor>
					</Anchors>
				</Texture>

				<Texture name="$parentSelected" inherits="ARKINV_TextureSelected">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
							<Offset x="5" y="0" />
						</Anchor>
						<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
							<Offset x="-5" y="0" />
						</Anchor>
					</Anchors>
				</Texture>

			</Layer>

		</Layers>

		<Scripts>

			<OnLoad>
				self:RegisterForClicks( "LeftButtonUp" )
				ArkInventoryRules.Frame_Rules_Build_Row( )
			</OnLoad>

			<OnEnter>
				_G[self:GetName( ) .. "Highlight"]:Show( )
			</OnEnter>

			<OnLeave>
				_G[self:GetName( ) .. "Highlight"]:Hide( )
			</OnLeave>

			<OnClick>
				PlaySound( "igMainMenuOptionCheckBoxOn" )
				ArkInventoryRules.Frame_Rules_Table_Row_OnClick( )
			</OnClick>

		</Scripts>

	</Button>

	
	<Frame virtual="true" name="ARKINV_TemplateRuleTable" 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="15" 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_TemplateRuleTableRow" id="1">
				<Anchors>
					<Anchor point="TOP">
						<Offset x="0" y="-10" />
					</Anchor>
				</Anchors>
			</Button>

			<Button name="$parentRow2" inherits="ARKINV_TemplateRuleTableRow" id="2">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow1" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow3" inherits="ARKINV_TemplateRuleTableRow" id="3">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow2" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow4" inherits="ARKINV_TemplateRuleTableRow" id="4">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow3" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow5" inherits="ARKINV_TemplateRuleTableRow" id="5">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow4" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow6" inherits="ARKINV_TemplateRuleTableRow" id="6">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow5" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow7" inherits="ARKINV_TemplateRuleTableRow" id="7">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow6" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow8" inherits="ARKINV_TemplateRuleTableRow" id="8">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow7" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow9" inherits="ARKINV_TemplateRuleTableRow" id="9">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow8" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow10" inherits="ARKINV_TemplateRuleTableRow" id="10">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow9" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow11" inherits="ARKINV_TemplateRuleTableRow" id="11">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow10" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow12" inherits="ARKINV_TemplateRuleTableRow" id="12">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow11" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow13" inherits="ARKINV_TemplateRuleTableRow" id="13">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow12" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow14" inherits="ARKINV_TemplateRuleTableRow" id="14">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow13" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow15" inherits="ARKINV_TemplateRuleTableRow" id="15">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow14" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow16" inherits="ARKINV_TemplateRuleTableRow" id="16">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow15" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow17" inherits="ARKINV_TemplateRuleTableRow" id="17">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow16" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<Button name="$parentRow18" inherits="ARKINV_TemplateRuleTableRow" id="18">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentRow17" relativePoint="BOTTOM" />
				</Anchors>
			</Button>

			<ScrollFrame name="$parentScroll" inherits="FauxScrollFrameTemplate">

				<Anchors>
					<Anchor point="TOPRIGHT">
						<Offset x="-30" y="-10" />
					</Anchor>
				</Anchors>

				<Scripts>

					<OnVerticalScroll>
						local h = _G[self:GetParent( ):GetName( ) .. "RowHeight"]:GetText( )
						FauxScrollFrame_OnVerticalScroll( self, offset, h, ArkInventoryRules_Frame_Rules_Table_Refresh )
					</OnVerticalScroll>

				</Scripts>

			</ScrollFrame>

		</Frames>

		<Scripts>
		
			<OnLoad>
				ArkInventoryRules.Frame_Rules_Build_Table( )
			</OnLoad>
			
		</Scripts>
		
	</Frame>


	
	
	
	
	<!-- basic view table -->
	<Frame virtual="true" name="ARKINV_TemplateRuleTableView">

		<Size x="2" y="450" />

		<Anchors>
			<Anchor point="TOP" />
			<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
				<Offset x="20" y="0" />
			</Anchor>
			<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT">
				<Offset x="-20" y="0" />
			</Anchor>
			<Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM">
				<Offset x="0" y="20" />
			</Anchor>
		</Anchors>
		
		<Scripts>

			<OnShow>
				_G[self:GetName( ) .. "TableScroll"]:Show( )
			</OnShow>

		</Scripts>

		<Frames>

			<Frame name="$parentTitle" inherits="ARKINV_TemplateRuleFrameTitle">
			
				<Scripts>
					<OnLoad>
						_G[self:GetName( ) .. "Text"]:SetText( string.upper( ArkInventory.Localise["VIEW"] ) )
					</OnLoad>
				</Scripts>
				
			</Frame>

			<Frame name="$parentSearch" inherits="ARKINV_TemplateFrameBasic">

				<Size x="2" y="40" />

				<Anchors>
					<Anchor point="TOP" relativeTo="$parentTitle" relativePoint="BOTTOM" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>

				<Frames>

					<Button name="$parentClear" inherits="ARKINV_TemplateButtonClear">
						<Anchors>
							<Anchor point="RIGHT">
								<Offset x="-8" y="0" />
							</Anchor>
						</Anchors>
					</Button>
					
					<EditBox name="$parentFilter" inherits="ARKINV_TemplateEditBox" letters="80">
					
						<Size x="2" y="20" />

						<Anchors>
							<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
								<Offset x="80" y="0" />
							</Anchor>
							<Anchor point="RIGHT" relativeTo="$parentClear" relativePoint="LEFT">
								<Offset x="-2" y="0" />
							</Anchor>
						</Anchors>

						<Scripts>

							<OnLoad>
								ArkInventory.UiSetEditBoxLabel( ArkInventory.Localise["RULE_SEARCH"] .. ":" )
							</OnLoad>

							<OnCursorChanged>
								ArkInventoryRules.Frame_Rules_Table_Refresh( self:GetParent( ):GetParent( ):GetParent( ):GetName( ) )
							</OnCursorChanged>
							
							<OnEnterPressed>
								self:ClearFocus( )
								ArkInventoryRules.Frame_Rules_Table_Refresh( self:GetParent( ):GetParent( ):GetParent( ):GetName( ) )
							</OnEnterPressed>
							
							<OnShow>
								self:SetFocus( )
							</OnShow>

						</Scripts>

					</EditBox>

				</Frames>

			</Frame>

			<Frame name="$parentSort" inherits="ARKINV_TemplateFrameBasic">

				<Size x="2" y="30" />

				<Anchors>
					<Anchor point="TOP" relativeTo="$parentSearch" relativePoint="BOTTOM" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>

				<Layers>
				
					<Layer level="BACKGROUND">
					
						<FontString name="$parentId" inherits="ARKINV_GameFontNormal" hidden="true" />
						
					</Layer>
					
				</Layers>
				
				<Frames>
					<!-- these buttons are rearranged via LUA for each individual table -->
					<Button name="$parent_T1" inherits="ARKINV_TemplateButtonTableSort" hidden="true" />
					<Button name="$parent_T2" inherits="ARKINV_TemplateButtonTableSort" hidden="true" />
					<Button name="$parent_C1" inherits="ARKINV_TemplateButtonTableSort" hidden="true" />
					<Button name="$parent_C2" inherits="ARKINV_TemplateButtonTableSort" hidden="true" />
					<Button name="$parent_C3" inherits="ARKINV_TemplateButtonTableSort" hidden="true" />
				</Frames>
				
				<Scripts>
				
					<OnLoad>
						ArkInventoryRules.Frame_Rules_Build_Sort( )
					</OnLoad>
					
				</Scripts>

			</Frame>

			<Frame name="$parentTable" inherits="ARKINV_TemplateRuleTable">

				<Anchors>
					<Anchor point="TOP" relativeTo="$parentSort" relativePoint="BOTTOM" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>

			</Frame>

			<Frame name="$parentMenu" inherits="ARKINV_TemplateFrameBasic">

				<Size x="2" y="40" />

				<Anchors>
					<Anchor point="TOP" relativeTo="$parentTable" relativePoint="BOTTOM" />
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>

				<Frames>

					<Button name="$parentEdit" inherits="ARKINV_TemplateButtonMenuShort" text="edit">
					
						<Anchors>
							<Anchor point="CENTER" />
						</Anchors>
						
						<Scripts>
							
							<OnLoad>
								self:SetText( ArkInventory.Localise["EDIT"] )
							</OnLoad>
							
							<OnClick>
								PlaySound( "igMainMenuOptionCheckBoxOn" )
								ArkInventoryRules.Frame_Rules_Button_View_Edit( )
							</OnClick>
							
						</Scripts>
						
					</Button>

					<Button name="$parentAdd" inherits="ARKINV_TemplateButtonMenuShort" text="add">
					
						<Anchors>
							<Anchor point="RIGHT" relativeTo="$parentEdit" relativePoint="LEFT">
								<Offset x="-5" y="0" />
							</Anchor>
						</Anchors>
						
						<Scripts>
						
							<OnLoad>
								self:SetText( ArkInventory.Localise["ADD"] )
							</OnLoad>

							<OnClick>
								PlaySound( "igMainMenuOptionCheckBoxOn" )
								ArkInventoryRules.Frame_Rules_Button_View_Add( )
							</OnClick>
							
						</Scripts>
						
					</Button>

					<Button name="$parentRemove" inherits="ARKINV_TemplateButtonMenuShort" text="remove">
					
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentEdit" relativePoint="RIGHT">
								<Offset x="5" y="0" />
							</Anchor>
						</Anchors>
						
						<Scripts>
						
							<OnLoad>
								self:SetText( ArkInventory.Localise["REMOVE"] )
							</OnLoad>

							<OnClick>
								PlaySound( "igMainMenuOptionCheckBoxOn" )
								ArkInventoryRules.Frame_Rules_Button_View_Remove( )
							</OnClick>
							
						</Scripts>
						
					</Button>

				</Frames>

			</Frame>
		
		</Frames>

	</Frame>

	
	<Frame virtual="true" name="ARKINV_TemplateRuleMain" inherits="ARKINV_TemplateFrameStandard">
	
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentType" text="RULE" hidden="true" />
			</Layer>
		</Layers>

		<Frames>
		
			<Frame name="$parentView" inherits="ARKINV_TemplateRuleTableView" hidden="false" />
			<Frame name="$parentModify" inherits="ARKINV_TemplateRuleModify" hidden="true" />
			
		</Frames>

	</Frame>

	
	
	
<!-- RULE FRAME STARTS HERE -->

	<Frame name="ARKINV_Rules" parent="UIParent" toplevel="true" movable="true" enableMouse="true" hidden="true" clampedToScreen="true">
	
		<Size x="600" y="600" />

		<Anchors>
			<Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER" />
		</Anchors>

		<Frames>

			<Frame name="$parentTitle" inherits="ARKINV_TemplateFrameStandard">

				<Size x="400" y="40" />

				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" />
					<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT" />
				</Anchors>
			
				<Frames>
				
					<Button name="$parentMenu">
					
						<Size x="24" y="24" />
						
						<NormalTexture file="Interface\Icons\INV_Misc_Book_10" />
						
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
								<Offset x="6" y="0" />
							</Anchor>
						</Anchors>
						
					</Button>

					<Button name="$parentClose" inherits="ARKINV_TemplateButtonClose">
					
						<Anchors>
							<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT">
								<Offset x="-8" y="0" />
							</Anchor>
						</Anchors>
						
						<Scripts>
						
							<OnClick>
								ArkInventory.Frame_Rules_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">
											<Offset x="5" y="0" />
										</Anchor>
										<Anchor point="RIGHT" relativeTo="$parentClose" relativePoint="RIGHT">
											<Offset x="-20" y="0" />
										</Anchor>
									</Anchors>
								</FontString>
							</Layer>
						</Layers>
					</Frame>

				</Frames>

			</Frame>
			
			<Frame name="$parentFrame" inherits="ARKINV_TemplateRuleMain">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="2" />
					</Anchor>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Frame>

		</Frames>

		<Scripts>

			<OnLoad>
				self.name = ArkInventory.Localise["CONFIG_RULES"]
				self.parent = ArkInventory.Const.Program.Name
				
				self:RegisterForDrag( "LeftButton" )
				tinsert( UISpecialFrames, self:GetName( ) )
			</OnLoad>

			<OnDragStart>
				self:StartMoving( )
			</OnDragStart>

			<OnDragStop>
				self:StopMovingOrSizing( )
			</OnDragStop>

			<OnShow>
				PlaySound( "igMainMenuOptionCheckBoxOn" )
				ArkInventoryRules.Frame_Rules_Paint( )
			</OnShow>
			
			<OnHide>
				PlaySound( "igMainMenuOptionCheckBoxOn" )
			</OnHide>
			
		</Scripts>
		
	</Frame>
	
<!-- END OF MAIN FRAME -->

	<GameTooltip name="ARKINV_RuleTooltip" inherits="ArkScanTooltipTemplate" />
	
</Ui>
