<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">
  <Script file="GEM_external.lua"/>
  
  <Frame name="GEMExternalFrame" movable="true" frameStrata="HIGH" hidden="true" parent="UIParent" enableMouse="true">
	<Size>
		<AbsDimension x="310" y="275"/>
	</Size>
	<Anchors>
		<Anchor point="TOPLEFT">
			<Offset>
				<AbsDimension x="100" y="-104"/>
			</Offset>
		</Anchor>
	</Anchors>
	<Backdrop name="$parentBackdrop" bgFile="Interface\TutorialFrame\TutorialFrameBackground" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
		<EdgeSize>
			<AbsValue val="16"/>
		</EdgeSize>
		<TileSize>
			<AbsValue val="16"/>
		</TileSize>
		<BackgroundInsets>
			<AbsInset left="3" right="5" top="3" bottom="5"/>
		</BackgroundInsets>
	</Backdrop>
	 <Layers>
	     <Layer level="BACKGROUND">
		 <FontString name="$parentTitle" inherits="GameFontNormal" text="GEM_TEXT_EXTERNAL_HEADER">
		     <Anchors>
			 <Anchor point="TOP" relativePoint="TOP">
			     <Offset>
				 <AbsDimension x="-5" y="-6"/>
			     </Offset>
			 </Anchor>
		     </Anchors>
		 </FontString>
	     </Layer>
	 </Layers>
	<Frames>
		<Frame name="GEMExternalClassBorderFrame" inherits="OptionFrameBoxTemplate">
			<Size>
				<AbsDimension x="270" y="210"/>
			</Size>
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
					<Offset>
						<AbsDimension x="20" y="-26"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Layers>
				<Layer level="BACKGROUND">
					<FontString name="GEMExternalFrame_NameString" inherits="GameFontHighlightSmall" text="GEM_TEXT_EXTERNAL_NAME">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
								<Offset>
									<AbsDimension x="18" y="-20"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
					<FontString name="GEMExternalFrame_GuildString" inherits="GameFontHighlightSmall" text="GEM_TEXT_EXTERNAL_GUILD">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="GEMExternalFrame_NameString">
								<Offset>
									<AbsDimension x="0" y="-20"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
					<FontString name="GEMExternalFrame_LevelString" inherits="GameFontHighlightSmall" text="GEM_TEXT_EXTERNAL_LEVEL">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="GEMExternalFrame_GuildString">
								<Offset>
									<AbsDimension x="0" y="-20"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
					<FontString name="GEMExternalFrame_ClassString" inherits="GameFontHighlightSmall" text="GEM_TEXT_EXTERNAL_CLASS">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="GEMExternalFrame_LevelString">
								<Offset>
									<AbsDimension x="0" y="-20"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
					<FontString name="GEMExternalFrame_CommentString" inherits="GameFontHighlightSmall" text="GEM_TEXT_EXTERNAL_COMMENT">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="GEMExternalFrame_ClassString">
								<Offset>
									<AbsDimension x="0" y="-22"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
					<FontString name="GEMExternalFrame_ForcesubString" inherits="GameFontHighlightSmall" text="GEM_TEXT_EXTERNAL_FORCESUB">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="GEMExternalFrame_CommentString">
								<Offset>
									<AbsDimension x="0" y="-20"/>
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
				</Layer>
			</Layers>
			<Frames>
				<Frame name="GEMExternalClassDropDown" inherits="UIDropDownMenuTemplate" enableMouse="true" hidden="false">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="GEMExternalFrame_ClassString" relativePoint="TOPRIGHT">
							<Offset>
								<AbsDimension x="26" y="5"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Scripts>
						<OnShow> GEMExternalClassDropDown_OnShow(); </OnShow>
						<OnLoad> GEMExternalClassDropDown_OnShow(); </OnLoad>
					</Scripts>
				</Frame>

				<EditBox name="GEMExternalFrame_Name" letters="30" numeric="false" inherits="GEMEditBoxTemplate">
					<Size>
						<AbsDimension x="120" y="26"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="GEMExternalFrame_NameString" relativePoint="TOPLEFT">
							<Offset>
								<AbsDimension x="85" y="5"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Scripts>
						<OnTabPressed>
							GEMExternalFrame_Guild:SetFocus();
						</OnTabPressed>
					</Scripts>
				</EditBox>
				<EditBox name="GEMExternalFrame_Guild" letters="30" numeric="false" inherits="GEMEditBoxTemplate">
					<Size>
						<AbsDimension x="150" y="26"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="GEMExternalFrame_GuildString" relativePoint="TOPLEFT">
							<Offset>
								<AbsDimension x="85" y="5"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Scripts>
						<OnTabPressed>
							GEMExternalFrame_Level:SetFocus();
						</OnTabPressed>
					</Scripts>
				</EditBox>
				<EditBox name="GEMExternalFrame_Level" letters="2" numeric="true" inherits="GEMEditBoxTemplate">
					<Size>
						<AbsDimension x="30" y="26"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="GEMExternalFrame_LevelString" relativePoint="TOPLEFT">
							<Offset>
								<AbsDimension x="85" y="5"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Scripts>
						<OnTabPressed>
							if(GEMExternalFrame_Comment:IsVisible()) then                                                  
								GEMExternalFrame_Comment:SetFocus();
							end
						</OnTabPressed>
					</Scripts>
				</EditBox>
				<EditBox name="GEMExternalFrame_Comment" letters="100" numeric="false" inherits="GEMEditBoxTemplate">
					<Size>
						<AbsDimension x="150" y="26"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="GEMExternalFrame_CommentString" relativePoint="TOPLEFT">
							<Offset>
								<AbsDimension x="85" y="5"/>
							</Offset>
						</Anchor>
					</Anchors>
				</EditBox>
				<CheckButton name="GEMExternalFrame_Forcesub" hidden="false" inherits="OptionsCheckButtonTemplate">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="GEMExternalFrame_ForcesubString" relativePoint="TOPRIGHT">
							<Offset>
								<AbsDimension x="10" y="5"/>
							</Offset>
						</Anchor>
					</Anchors>
					<HitRectInsets>
						<AbsInset left="0" right="0" top="0" bottom="0"/>
					</HitRectInsets>
					<Size>
						<AbsDimension x="26" y="26"/>
					</Size>
				</CheckButton>
			</Frames>
			<Scripts>
				<OnLoad>
					this:SetBackdropColor(1,1,1,0)
				</OnLoad>
			</Scripts>
		</Frame>

		<Button name="GEMExternalCloseButton" inherits="UIPanelCloseButton">
			<Anchors>
				<Anchor point="TOPRIGHT">
					<Offset>
						<AbsDimension x="1" y="2"/>
					</Offset>
				</Anchor>
			</Anchors>
		</Button>

		<Button name="$parent_Validate" inherits="UIPanelButtonTemplate" text="GEM_TEXT_EXTERNAL_ADD">
			<Size>
				<AbsDimension x="100" y="24"/>
			</Size>
			<Anchors>
				<Anchor point="BOTTOMRIGHT" relativeTo="GEMExternalFrame" relativePoint="BOTTOMRIGHT">
					<Offset>
						<AbsDimension x="-15" y="10"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					GEMExternalAdd_OnClick();
				</OnClick>
			</Scripts>
		</Button>
		<Button name="$parent_Target" inherits="UIPanelButtonTemplate" text="GEM_TEXT_EXTERNAL_TARGET">
			<Size>
				<AbsDimension x="130" y="24"/>
			</Size>
			<Anchors>
				<Anchor point="BOTTOMLEFT" relativeTo="GEMExternalFrame" relativePoint="BOTTOMLEFT">
					<Offset>
						<AbsDimension x="15" y="10"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					GEMExternalTarget_OnClick();
				</OnClick>
			</Scripts>
		</Button>

	</Frames>
	<Scripts>
		<OnMouseUp>
			if ( this.isMoving ) then
				this:StopMovingOrSizing();
				this.isMoving = false;
			end
		</OnMouseUp>
		<OnMouseDown>
			if ( ( ( not this.isLocked ) or ( this.isLocked == 0 ) ) and ( arg1 == "LeftButton" ) ) then
				this:StartMoving();
				this.isMoving = true;
			end
		</OnMouseDown>
		<OnHide>
			if ( this.isMoving ) then
				this:StopMovingOrSizing();
				this.isMoving = false;
			end
		</OnHide>
		<OnShow>
			GEMExternal_OnShow();
		</OnShow>
	</Scripts>
  </Frame>
</Ui>
