<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">
	
	
	<!-- Main Script -->
	<Script file="LootFilter.lua"/>

	<Frame name="LootFilterFrame" enableMouse="false" parent="UIParent">
		<Scripts>
			<OnLoad>
				LootFilter.OnLoad();
			</OnLoad>
			<OnEvent>
				LootFilter.OnEvent();
			</OnEvent>
		</Scripts>
	</Frame>


	<CheckButton name="LootFilterCheckboxTemplate" hidden="false" virtual="true">
		<Size>
			<AbsDimension x="32" y="32"/>
		</Size>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentText" inherits="GameFontNormalSmall" text="">
					<Anchors>
						<Anchor point="LEFT" relativePoint="RIGHT">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
		<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
		<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
		<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
		<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
	</CheckButton>

	
	
	<Frame name="LootFilterOptions" toplevel="true" movable="true" parent="UIParent" enableMouse="true" hidden="true">
		<Scripts>
			<OnLoad>
				LootFilter.setTitle();	
			</OnLoad>
		</Scripts>
		<TitleRegion setAllPoints="true"/>
		<Size>
			<AbsDimension x="600" y="420" />
		</Size>
		<Anchors>
			<Anchor point="CENTER" />
		</Anchors>
		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border"
			tile="true">
			<BackgroundInsets>
				<AbsInset left="11" right="12" top="12" bottom="11" />	
				<Size>
					<AbsDimension x="128" y="17" />
				</Size>
			</BackgroundInsets>
			<TileSize>
				<AbsValue val="32" />
			</TileSize>
			<EdgeSize>
				<AbsValue val="32" />
			</EdgeSize>
		</Backdrop>
		
		<Layers>
			<Layer level="ARTWORK">
				<Texture name="LootFilterFrameTitle" file="Interface\DialogFrame\UI-DialogBox-Header">
					<Size>
						<AbsDimension x="276" y="64" />
					</Size>
					<Anchors>
						<Anchor point="TOP">
							<Offset>
								<AbsDimension x="0" y="12" />
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<FontString name="LootFilterFrameTitleText" inherits="GameFontNormal" text="Loot Filter">
					<Anchors>
						<Anchor point="TOP" relativeTo="LootFilterOptions">
							<Offset>
								<AbsDimension x="0" y="-3" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="LootFilterEditBoxTitle2" inherits="GameFontNormal" text="Items that you want to KEEP.">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
							<Offset>
								<AbsDimension x="300" y="-30" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="LootFilterEditBoxTitle3" inherits="GameFontNormal" text="Insert a new name on a new line.">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
							<Offset>
								<AbsDimension x="300" y="-40" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="LootFilterEditBoxTitle5" inherits="GameFontNormal" text="Items that you want to DELETE.">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
							<Offset>
								<AbsDimension x="300" y="-210" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="LootFilterEditBoxTitle6" inherits="GameFontNormal" text="Insert a new name on a new line.">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
							<Offset>
								<AbsDimension x="300" y="-220" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="LootFilterEditBoxTitle7" inherits="GameFontNormal" text="Filter on:">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
							<Offset>
								<AbsDimension x="20" y="-100" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
		
		<CheckButton name="LootFilterCheckboxOnOff" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-30" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(99);
				</OnShow>
				<OnClick>
					LootFilter.setOption(99);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckboxNotify" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-60" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(199);
				</OnShow>
				<OnClick>
					LootFilter.setOption(199);
				</OnClick>
			</Scripts>
		</CheckButton>

		<CheckButton name="LootFilterCheckboxItemValue" hidden="true" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-120" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(299);
				</OnShow>
				<OnClick>
					LootFilter.setOption(299);
				</OnClick>
			</Scripts>
		</CheckButton>

		<EditBox name="LootFilterEditBox3" letters="5" hidden="true" enableMouse="true" autoFocus="false">
			<Size>
				<AbsDimension x="40" y="20"/>
			</Size>
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="160" y="-127"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getItemValue();
				</OnShow>
				<OnTextChanged>
				</OnTextChanged>
				<OnClick>
					this:SetFocus();
				</OnClick>
				<OnEscapePressed>
					this:ClearFocus();
				</OnEscapePressed>
				<OnEditFocusGained>
				</OnEditFocusGained>
				<OnEditFocusLost>
				</OnEditFocusLost>
			</Scripts>
			<FontString inherits="ChatFontNormal"/>
		</EditBox>

		<Frame name="LootFilterTextBackground3" hidden="true">
			<Size>
				<AbsDimension x="50" y="25"/>
			</Size>
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="154" y="-125"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
				<EdgeSize>
					<AbsValue val="16"/>
				</EdgeSize>
				<TileSize>
					<AbsValue val="16"/>
				</TileSize>
				<BackgroundInsets>
					<AbsInset left="5" right="5" top="5" bottom="5"/>
				</BackgroundInsets>
			</Backdrop>
			<Scripts>
				<OnLoad>
					this:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
					this:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
				</OnLoad>
			</Scripts>
		</Frame>

		<CheckButton name="LootFilterCheckbox1" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-150" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(1);
				</OnShow>
				<OnClick>
					LootFilter.setOption(1);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox2" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-180" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(2);
				</OnShow>
				<OnClick>
					LootFilter.setOption(2);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox3" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-210" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(3);
				</OnShow>
				<OnClick>
					LootFilter.setOption(3);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox4" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-240" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(4);
				</OnShow>
				<OnClick>
					LootFilter.setOption(4);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox5" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-270" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(5);
				</OnShow>
				<OnClick>
					LootFilter.setOption(5);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox6" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-300" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(6);
				</OnShow>
				<OnClick>
					LootFilter.setOption(6);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox7" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-330" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(7);
				</OnShow>
				<OnClick>
					LootFilter.setOption(7);
				</OnClick>
			</Scripts>
		</CheckButton>
		<CheckButton name="LootFilterCheckbox8" inherits="LootFilterCheckboxTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
					<Offset>
						<AbsDimension x="20" y="-360" />
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnShow>
					LootFilter.getOption(8);
				</OnShow>
				<OnClick>
					LootFilter.setOption(8);
				</OnClick>
			</Scripts>
		</CheckButton>

			<ScrollFrame name="LootFilterScrollFrame1" inherits="UIPanelScrollFrameTemplate">
				<Size>
					<AbsDimension x="250" y="115"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
						<Offset>
							<AbsDimension x="300" y="-60"/>
						</Offset>
					</Anchor>
				</Anchors>
				<ScrollChild>
				<Frame name="LootFilterScrollChildFrame1" enableMouse="true">
					<Size>
						<AbsDimension x="250" y="115"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Frames>
						<EditBox name="LootFilterEditBox1" letters="7500" multiLine="true" enableMouse="true" autoFocus="false">
							<Size>
								<AbsDimension x="250" y="115"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Scripts>
								<OnShow>
									LootFilter.getNames();
								</OnShow>
								<OnTextChanged>
									local scrollBar = getglobal(this:GetParent():GetParent():GetName().."ScrollBar")
									this:GetParent():GetParent():UpdateScrollChildRect();
									local min;
									local max;
									min, max = scrollBar:GetMinMaxValues();
									if ( max > 0 and (this.max ~= max) ) then
										this.max = max;
										scrollBar:SetValue(max);
									end
								</OnTextChanged>
								<OnClick>
								</OnClick>
								<OnEscapePressed>
									LootFilter.updateFocus(1, false);
								</OnEscapePressed>
								<OnEditFocusGained>
									LootFilter.updateFocus(1, true);
								</OnEditFocusGained>
								<OnEditFocusLost>
								</OnEditFocusLost>
							</Scripts>
							<FontString inherits="ChatFontNormal"/>
						</EditBox>
					</Frames>
					<Scripts>
						<OnMouseUp>
							LootFilterEditBox1:SetFocus();
						</OnMouseUp>
					</Scripts>
				</Frame>
			</ScrollChild>
		</ScrollFrame>

			<ScrollFrame name="LootFilterScrollFrame2" inherits="UIPanelScrollFrameTemplate">
				<Size>
					<AbsDimension x="250" y="115"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="LootFilterOptions">
						<Offset>
							<AbsDimension x="300" y="-240"/>
						</Offset>
					</Anchor>
				</Anchors>
				<ScrollChild>
				<Frame name="LootFilterScrollChildFrame2" enableMouse="true">
					<Size>
						<AbsDimension x="250" y="115"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Frames>
						<EditBox name="LootFilterEditBox2" letters="7500" multiLine="true" enableMouse="true" autoFocus="false">
							<Size>
								<AbsDimension x="250" y="115"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Scripts>
								<OnShow>
									LootFilter.getNamesDelete();
								</OnShow>
								<OnTextChanged>
									local scrollBar = getglobal(this:GetParent():GetParent():GetName().."ScrollBar")
									this:GetParent():GetParent():UpdateScrollChildRect();
									local min;
									local max;
									min, max = scrollBar:GetMinMaxValues();
									if ( max > 0 and (this.max ~= max) ) then
										this.max = max;
										scrollBar:SetValue(max);
									end
								</OnTextChanged>
								<OnClick>
								</OnClick>
								<OnEscapePressed>
									LootFilter.updateFocus(2, false);
								</OnEscapePressed>
								<OnEditFocusGained>
									LootFilter.updateFocus(2, true);
								</OnEditFocusGained>
								<OnEditFocusLost>
								</OnEditFocusLost>
							</Scripts>
							<FontString inherits="ChatFontNormal"/>
						</EditBox>
					</Frames>
					<Scripts>
						<OnMouseUp>
							LootFilterEditBox2:SetFocus();
						</OnMouseUp>
					</Scripts>
				</Frame>
			</ScrollChild>
		</ScrollFrame>



			<Frame name="LootFilterTextBackground1">
				<Size>
					<AbsDimension x="290" y="128"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="LootFilterScrollFrame1">
						<Offset>
							<AbsDimension x="-10" y="7"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
					<EdgeSize>
						<AbsValue val="16"/>
					</EdgeSize>
					<TileSize>
						<AbsValue val="16"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="5" right="5" top="5" bottom="5"/>
					</BackgroundInsets>
				</Backdrop>
				<Scripts>
					<OnLoad>
						this:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
						this:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="LootFilterTextBackground2">
				<Size>
					<AbsDimension x="290" y="128"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="LootFilterScrollFrame2">
						<Offset>
							<AbsDimension x="-10" y="7"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
					<EdgeSize>
						<AbsValue val="16"/>
					</EdgeSize>
					<TileSize>
						<AbsValue val="16"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="5" right="5" top="5" bottom="5"/>
					</BackgroundInsets>
				</Backdrop>
				<Scripts>
					<OnLoad>
						this:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
						this:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
					</OnLoad>
				</Scripts>
			</Frame>

		
			<Button name="LootFilterClose" inherits="GameMenuButtonTemplate" text="Close">
				<Anchors>
					<Anchor point="CENTER" relativePoint="BOTTOM" relativeTo="LootFilterOptions">
						<Offset>
							<AbsDimension x="0" y="30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						LootFilter.setNames();
						LootFilter.setNamesDelete();
						LootFilter.setItemValue();
						this:GetParent():Hide();
						LootFilter.hasFocus= 0;
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
	</Frame>
</Ui>
