<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="DBMLoathebFrameDrag" parent="UIParent" frameStrata="MEDIUM" hidden="true" topLevel="true" enableMouse="true" movable="true">
		<Size>
			<AbsDimension x="100" y="20"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER" relativePoint="CENTER">
				<Offset>
					<AbsDimension x="150" y="-50"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentTitle" inherits="GameFontNormalSmall" text="Loatheb">
					<Anchors>
						<Anchor point="BOTTOM" relativePoint="BOTTOM"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				this:SetUserPlaced(1);				
			</OnLoad>
			<OnMouseDown>
				if arg1 == "LeftButton" and not DBM.AddOns.Loatheb.Options.FrameLocked then
					this:StartMoving();
				end
			</OnMouseDown>
			<OnMouseUp>
				this:StopMovingOrSizing();
				if arg1 == "RightButton" then
					UIDropDownMenu_Initialize(DBMLoathebMenu, DBM.AddOns.Loatheb.InitializeMenu, "MENU");
					ToggleDropDownMenu(1, nil, DBMLoathebMenu, "DBMLoathebMenu", 30, 50);
				end
			</OnMouseUp>
			<OnShow>
				if not DBM.AddOns.Loatheb.HealersSorted then
					SendAddonMessage("DBMLOATHEB", "REQLIST", "RAID");
				end
				DBM.AddOns.Loatheb.OnEvent("UpdateHealerFrame", 0);
			</OnShow>			
		</Scripts>
	</Frame>
	<Frame name="DBMLoathebUpdate" hidden="false">
		<Scripts>
			<OnLoad>
				this:RegisterEvent("CHAT_MSG_ADDON");
				this:RegisterEvent("PLAYER_LOGIN");
				this:RegisterEvent("RAID_ROSTER_UPDATE");
			</OnLoad>
			<OnEvent>
				DBM.AddOns.Loatheb.OnEvent(event, arg1)
			</OnEvent>
			<OnUpdate>
				DBM.AddOns.Loatheb.OnEvent("UpdateHealerFrame", arg1);
			</OnUpdate>
		</Scripts>
	</Frame>
	<Frame name="DBMLoathebHealerTemplate" frameStrata="MEDIUM" virtual="true">
		<Size>
			<AbsDimension x="200" y="20"/>
		</Size>
		<Frames>
			<StatusBar name="$parentBar">
				<Size>
					<AbsDimension x="190" y="12"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER" relativePoint="CENTER">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentBackground">
							<Color r="0" g="0" b="0" a="0.3"/>
						</Texture>
					</Layer>
					<Layer level="OVERLAY">
						<FontString name="$parentName" inherits="GameFontNormalSmall" text="Healer x">
							<Anchors>
								<Anchor point="LEFT" relativePoint="LEFT">
									<Offset>
										<AbsDimension x="1" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="$parentCooldown" inherits="GameFontNormalSmall" text="DBM_LOATHEB_NO_CD">
							<Anchors>
								<Anchor point="RIGHT" relativePoint="RIGHT">
									<Offset>
										<AbsDimension x="-1" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
						<Texture name="$parentSpark" file="Interface\CastingBar\UI-CastingBar-Spark" alphaMode="ADD">
							<Size>
								<AbsDimension x="32" y="32"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Frames>
					<Button name="$parentBorder">
						<Size>
							<AbsDimension x="198" y="32"/>
						</Size>
						<Anchors>
							<Anchor point="LEFT">
								<Offset>
									<AbsDimension x="-5" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
						<NormalTexture name="$parentTextureNormal" file="Interface\PaperDollInfoFrame\UI-Character-Skills-BarBorder"/>				
					</Button>
				</Frames>
				<BarTexture name="$parentTextureBar" file="Interface\PaperDollInfoFrame\UI-Character-Skills-Bar"/>
				<BarColor r="1.0" g="0.7" b="0.0"/>
				<Scripts>
					<OnLoad>
						this:SetMinMaxValues(0, 60);
					</OnLoad>
				</Scripts>
			</StatusBar>
		</Frames>
	</Frame>
	<Frame name="DBMLoathebEditBoxTemplate" virtual="true" hidden="true">
		<Size>
			<AbsDimension x="30" y="20"/>
		</Size>
		<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>
		<Frames>
			<EditBox name="$parentEditBox" numeric="true">
				<Size>
					<AbsDimension x="30" y="20"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER" relativePoint="CENTER">
						<Offset>
							<AbsDimension x="6" y="1"/>
						</Offset>
					</Anchor>
				</Anchors>
				<FontString inherits="ChatFontNormal"></FontString>
				<Scripts>
					<OnLoad>
						this:SetMaxLetters(2);
					</OnLoad>
				</Scripts>
			</EditBox>			
		</Frames>
		<Scripts>
			<OnLoad>
				this:SetBackdropColor(0, 0, 0, 0.4);
			</OnLoad>
			<OnShow>
				getglobal(this:GetName().."EditBox"):SetText("");
				if DBM.AddOns.Loatheb.HealersSorted then
					getglobal(this:GetName().."EditBox"):SetText(DBM.AddOns.Loatheb.Healers[this:GetID()].Sort);
				else
					getglobal(this:GetName().."EditBox"):SetText(this:GetID());
				end
			</OnShow>
		</Scripts>
	</Frame>
	<Button name="DBMLoathebButton" hidden="true">
		<Size>
			<AbsDimension x="128" y="16"/>
		</Size>
		<Scripts>
			<OnClick>
				local i = 1;
				DBMLoathebFrameDrag.ConfigMode = false;
				while getglobal("DBMLoathebHealerFrame"..i.."EditBox") and getglobal("DBMLoathebHealerFrame"..i.."EditBox"):IsShown() do
					if DBM.AddOns.Loatheb.Healers[i] then
						DBM.AddOns.Loatheb.Healers[i].Sort = tonumber(getglobal("DBMLoathebHealerFrame"..i.."EditBoxEditBox"):GetNumber()) or 99;
					end
					getglobal("DBMLoathebHealerFrame"..i.."EditBox"):Hide();
					i = i + 1;
				end
				DBM.AddOns.Loatheb.HealersSorted = true;
				if DBM.Rank >= 1 then
					DBM.AddOns.Loatheb.OnEvent("SendHealList");
				end
				DBM.AddOns.Loatheb.DeleteDeletedHealers();
				DBM.AddOns.Loatheb.OnEvent("RAID_ROSTER_UPDATE");
				this:Hide();
			</OnClick>
		</Scripts>
		<NormalTexture inherits="DialogButtonNormalTexture"/>
		<PushedTexture inherits="DialogButtonPushedTexture"/>
		<HighlightTexture inherits="DialogButtonHighlightTexture"/>
		<ButtonText text="DBM_LOATHEB_SET_HEAL_ROTATION"/>
		<NormalFont inherits="GameFontNormalSmall"/>
		<HighlightFont inherits="GameFontHighlightSmall"/>
	</Button>
	<Frame name="DBMLoathebMenu" parent="DBMLoathebFrameDrag" inherits="UIDropDownMenuTemplate" id="1" hidden="true">
		<Size>
			<AbsDimension x="10" y="10"/>
		</Size>
		<Anchors>
			<Anchor point="BOTTOM" relativeto="DBMLoathebFrameDrag">
				<Offset>
					<AbsDimension x="0" y="-50"/>
				</Offset>
			</Anchor>
		</Anchors>
	</Frame>
</Ui>
