﻿<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">
	<Frame name="EnchantBot" hidden="true" parent="UIParent">
		<Scripts>
			<OnLoad>EnchantBot_OnLoad()</OnLoad>
			<OnEvent>EnchantBot_OnEvent(self,event,...)</OnEvent>
		</Scripts>
	</Frame>
	
	<FontString name="EnchantBotLabelTemplate" virtual="true" inherits="GameFontNormal" justifyH="LEFT">
		<Size>
			<AbsDimension x="100" y="32"/>
		</Size>
	</FontString>
	
	<Frame name="EnchantBotCheckBoxTemplate" virtual="true">
		<Size>
			<AbsDimension x="75" y="32"/>
		</Size>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parent_Text" inherits="GameFontNormal" text="">
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="20" y="1" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<CheckButton name="$parent_Button" inherits="UICheckButtonTemplate">
				<Size>
					<AbsDimension x="18" y="18"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT"/>
				</Anchors>
				<HitRectInsets>
					<AbsInset left="0" right="-60" top="-10" bottom="0"/>
				</HitRectInsets>
				<Scripts>
					<OnClick>
						if self:GetChecked() then
							PlaySound("igMainMenuOptionCheckBoxOn")
						else
							PlaySound("igMainMenuOptionCheckBoxOff")
						end
						EnchantBot_SetOptionValue(self)
					</OnClick>
				</Scripts>
			</CheckButton>
		</Frames>
		<Scripts>
			<OnShow>EnchantBot_GetOptionValue(self)</OnShow>
		</Scripts>
	</Frame>

	<Frame name="EnchantBotOptionTemplate" virtual="true">
		<Size>
			<AbsDimension x="75" y="32"/>
		</Size>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parent_Text" inherits="GameFontNormal" text="">
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="20" y="1" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<CheckButton name="$parent_Button" inherits="UIRadioButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" >
						<Offset>
							<AbsDimension x="0" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>EnchantBot_SetOptionValue(self)</OnClick>
				</Scripts>
			</CheckButton>
		</Frames>
		<Scripts>
			<OnShow>EnchantBot_GetOptionValue(self)</OnShow>
		</Scripts>
	</Frame>

	<EditBox name="EnchantBotEditBoxTemplate" virtual="true" letters="255" autoFocus="false">
		<Size>
			<AbsDimension x="320" y="32"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Left">
					<Size>
						<AbsDimension x="170" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="-10"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0" right="1.0" top="0" bottom="1.0"/>
				</Texture>
				<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Right">
					<Size>
						<AbsDimension x="170" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="10"/>
							</Offset>
						</Anchor>
					</Anchors>
					<TexCoords left="0" right="1.0" top="0" bottom="1.0"/>
				</Texture>
			</Layer>
		</Layers>
		<FontString inherits="GameFontNormal" justifyH="LEFT">
			<FontHeight>
				<AbsValue val="14" />
			</FontHeight>
			<Shadow>
				<Color r="0" g="0" b="0" />
				<Offset>
					<AbsDimension x="1" y="-1" />
				</Offset>
			</Shadow>
		</FontString>
		<Scripts>
			<OnEscapePressed>self:ClearFocus()</OnEscapePressed>
			<OnTextSet>self:HighlightText(0,0)</OnTextSet>
		</Scripts>
	</EditBox>

	<Frame name="EnchantBotOptionFrame" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" parent="UIParent" hidden="true" clampedToScreen="true">
		<Size>
			<AbsDimension x="500" y="300"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER"/>
		</Anchors>
		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
                <TileSize>
                        <AbsValue val="32"/>
                </TileSize>
                <EdgeSize>
                        <AbsValue val="32"/>
                </EdgeSize>
                <BackgroundInsets>
                        <AbsInset left="11" right="12" top="12" bottom="11"/>
                </BackgroundInsets>
        </Backdrop>
		<Layers>
			<Layer level="OVERLAY">
				<Texture name="$parentHeaderTexture" file="Interface\DialogFrame\UI-DialogBox-Header">
					<Size>
						<AbsDimension x="350" y="64"/>
					</Size>
					<Anchors>
						<Anchor point="TOP" relativeTo="$parent">
							<Offset>
								<AbsDimension y="12"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<FontString name="$parentHeaderText" inherits="GameFontNormal" text="">
					<Anchors>
						<Anchor point="TOP" relativeTo="$parentHeaderTexture">
							<Offset>
								<AbsDimension y="-14"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentLabelLocalization" inherits="EnchantBotLabelTemplate" text="">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parent">
							<Offset>
								<AbsDimension x="35" y="-60"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentLabelMode" inherits="EnchantBotLabelTemplate" text="">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentLabelLocalization">
							<Offset>
								<AbsDimension y="-40"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentLabelCustomMsg" inherits="EnchantBotLabelTemplate" text="">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentLabelMode">
							<Offset>
								<AbsDimension y="-40"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentLabelLimit" inherits="EnchantBotLabelTemplate" text="">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentLabelCustomMsg">
							<Offset>
								<AbsDimension y="-40"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentLabelMinRank" inherits="EnchantBotLabelTemplate" text="">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentLabelLimit">
							<Offset>
								<AbsDimension y="-40"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentMinRank" inherits="EnchantBotLabelTemplate" text="">
					<Size>
						<AbsDimension x="290" y="32"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentLabelMinRank" relativePoint="RIGHT"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<EditBox name="$parentLocalization" inherits="EnchantBotEditBoxTemplate">
				<Size>
					<AbsDimension x="290" y="32"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentLabelLocalization" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnEnterPressed>EnchantBot_SetLocalization(EnchantBotOptionFrameLocalization:GetText());</OnEnterPressed>
					<OnTabPressed>EnchantBotOptionFrameCustomMsg:SetFocus()</OnTabPressed>
					<OnEnter>EnchantBot_ShowCustomTooltip(true, "Localization")</OnEnter>
					<OnLeave>EnchantBot_ShowCustomTooltip(false, "")</OnLeave>
				</Scripts>
			</EditBox>
			<EditBox name="$parentCustomMsg" inherits="EnchantBotEditBoxTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentLabelCustomMsg" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnEnterPressed>EnchantBot_Set_Custom_Msg(EnchantBotOptionFrameCustomMsg:GetText());</OnEnterPressed>
					<OnTabPressed>EnchantBotOptionFrameLimit:SetFocus()</OnTabPressed>
					<OnEnter>EnchantBot_ShowCustomTooltip(true, "CustomMsg")</OnEnter>
					<OnLeave>EnchantBot_ShowCustomTooltip(false, "")</OnLeave>
				</Scripts>
			</EditBox>
			<EditBox name="$parentLimit" inherits="EnchantBotEditBoxTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentLabelLimit" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnEnterPressed>EnchantBot_Set_Limit(EnchantBotOptionFrameLimit:GetNumber())</OnEnterPressed>
					<OnTabPressed>EnchantBotOptionFrameLocalization:SetFocus()</OnTabPressed>
					<OnEnter>EnchantBot_ShowCustomTooltip(true, "Limit")</OnEnter>
					<OnLeave>EnchantBot_ShowCustomTooltip(false, "")</OnLeave>
				</Scripts>
			</EditBox>
			<Frame name="$parentModeSell" inherits="EnchantBotOptionTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentLabelMode" relativePoint="RIGHT"/>
				</Anchors>
			</Frame>
			<Frame name="$parentModeTips" inherits="EnchantBotOptionTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentModeSell" relativePoint="RIGHT"/>
				</Anchors>
			</Frame>
			<Frame name="$parentModeCustom" inherits="EnchantBotOptionTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentModeTips" relativePoint="RIGHT"/>
				</Anchors>
			</Frame>
			<Frame name="$parentSilent" inherits="EnchantBotCheckBoxTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentMinRank" relativePoint="BOTTOMLEFT"/>
				</Anchors>
			</Frame>
			<Frame name="$parentABSupport" inherits="EnchantBotCheckBoxTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentSilent" relativePoint="RIGHT"/>
				</Anchors>
			</Frame>
			<Button name="$parentButtonClose" inherits="UIPanelCloseButton">
                <Anchors>
                    <Anchor point="TOPRIGHT">
                        <Offset>
                            <AbsDimension x="-6" y="-6"/>
                        </Offset>
                    </Anchor>
                </Anchors>
            </Button>
		</Frames>
		<Scripts>
			<OnMouseDown>self:StartMoving()</OnMouseDown>
			<OnMouseUp>self:StopMovingOrSizing()</OnMouseUp>
			<OnDragStop>self:StopMovingOrSizing()</OnDragStop>
			<OnShow>EnchantBot_Options_OnShow()</OnShow>
			<OnHide>EnchantBot_Options_OnHide()</OnHide>
			<OnLoad>tinsert(UISpecialFrames,self:GetName())</OnLoad>
		</Scripts>
	</Frame>
	
    <Frame name="EnchantBotMinRankDropDownMenu" parent="EnchantBotOptionFrame" id="1">
        <Size>
        	<AbsDimension x="32" y="32"/>
        </Size>
        <Anchors>
            <Anchor point="LEFT" relativeTo="EnchantBotOptionFrameMinRank" relativePoint="RIGHT">
                <Offset>
                	<AbsDimension x="6"/>
                </Offset>
            </Anchor>
        </Anchors>
        <Frames>
            <Button name="$parentButton">
                <Size>
                	<AbsDimension x="32" y="32"/>
                </Size>
                <Anchors>
                    <Anchor point="RIGHT" relativeTo="EnchantBotMinRankDropDownMenu"/>
                </Anchors>
                <Scripts>
                    <OnClick>ToggleDropDownMenu()</OnClick>
                </Scripts>
                <NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up">
                    <Size>
                    	<AbsDimension x="32" y="32"/>
                    </Size>
                    <Anchors>
                    	<Anchor point="RIGHT"/>
                    </Anchors>
                </NormalTexture>
                <HighlightTexture alphaMode="ADD" name="$parentHighlightTexture" file="Interface\Buttons\UI-Common-MouseHilight">
                    <Size>
                    	<AbsDimension x="32" y="32"/>
                    </Size>
                    <Anchors>
                    	<Anchor point="RIGHT"/>
                    </Anchors>
                </HighlightTexture>
                <PushedTexture name="$parentPushedTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down">
                    <Size>
                    	<AbsDimension x="32" y="32"/>
                    </Size>
                    <Anchors>
                    	<Anchor point="RIGHT"/>
                    </Anchors>
                </PushedTexture>
                <Scripts>
                    <OnShow>EnchantBot_MinRank_DDM_OnLoad()</OnShow>
                </Scripts>
            </Button>
        </Frames>
        <Scripts>
            <OnHide>CloseDropDownMenus()</OnHide>
        </Scripts>
    </Frame>

    <Frame name="EnchantBotLocalizationDropDownMenu" parent="EnchantBotOptionFrame" id="1">
        <Size>
        	<AbsDimension x="32" y="32"/>
        </Size>
        <Anchors>
            <Anchor point="LEFT" relativeTo="EnchantBotOptionFrameLocalization" relativePoint="RIGHT">
                <Offset>
                	<AbsDimension x="6"/>
                </Offset>
            </Anchor>
        </Anchors>
        <Frames>
            <Button name="$parentButton">
                <Size>
                	<AbsDimension x="32" y="32"/>
                </Size>
                <Anchors>
                    <Anchor point="RIGHT" relativeTo="EnchantBotLocalizationDropDownMenu"/>
                </Anchors>
                <Scripts>
                    <OnClick>ToggleDropDownMenu()</OnClick>
                </Scripts>
                <NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up">
                    <Size>
                    	<AbsDimension x="32" y="32"/>
                    </Size>
                    <Anchors>
                    	<Anchor point="RIGHT"/>
                    </Anchors>
                </NormalTexture>
                <HighlightTexture alphaMode="ADD" name="$parentHighlightTexture" file="Interface\Buttons\UI-Common-MouseHilight">
                    <Size>
                    	<AbsDimension x="32" y="32"/>
                    </Size>
                    <Anchors>
                    	<Anchor point="RIGHT"/>
                    </Anchors>
                </HighlightTexture>
                <PushedTexture name="$parentPushedTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down">
                    <Size>
                    	<AbsDimension x="32" y="32"/>
                    </Size>
                    <Anchors>
                    	<Anchor point="RIGHT"/>
                    </Anchors>
                </PushedTexture>
                <Scripts>
                    <OnShow>EnchantBot_Localization_DDM_OnLoad()</OnShow>
                </Scripts>
            </Button>
        </Frames>
        <Scripts>
            <OnHide>CloseDropDownMenus()</OnHide>
        </Scripts>
    </Frame>
</Ui>

