<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/">
	<Frame name="SW_TL_Item" virtual="true">
		<Size>
			<AbsDimension x="150" y="20" />
		</Size>
		<Scripts>
			<OnEnter>getglobal(this:GetName().."_Highlight"):Show();</OnEnter>
			<OnLeave>getglobal(this:GetName().."_Highlight"):Hide();</OnLeave>
			<OnMouseUp>
				SW_DataCollection:setSelected(this.segmentID);
				SW_TL_ScrollUpdate(); 
				
			</OnMouseUp>
		</Scripts>
		<Backdrop bgFile="Interface\AddOns\SW_Stats\images\back" tile="true">
			<TileSize>
				<AbsValue val="16" />
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="1" right="1" top="1" bottom="1" />
			</BackgroundInsets>
		</Backdrop>
		<Layers>
			<Layer level="BORDER">
				<FontString name="$parent_Text" inherits="SW_FontBar" wraponspaces="false" justifyH="LEFT" text="entry">
					<Anchors>
						<Anchor point="LEFT">
							<Offset>
								<AbsDimension x="45" y="0" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
			<Layer level="OVERLAY">
				<Texture name="$parent_Highlight" file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"
					hidden="true">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="1" y="-1" />
							</Offset>
						</Anchor>
						<Anchor point="BOTTOMRIGHT">
							<Offset>
								<AbsDimension x="-1" y="1" />
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture name="$parent_Selected" hidden="true">
					<Color r="8.0" g="0" b="0" a="0.4" />
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="1" y="-1" />
							</Offset>
						</Anchor>
						<Anchor point="BOTTOMRIGHT">
							<Offset>
								<AbsDimension x="-1" y="1" />
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="$parent_Delete" inherits="SW_RoundButton" hidden="false">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="2" y="-2" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnMouseUp>SW_TL_ScrollUpdate(); SW_TL_Delete(this:GetParent().segmentID);</OnMouseUp>
					<OnLoad>SW_RoundButtonRegister(this, {1,0,0,0.9}, "X");</OnLoad>
					<OnEnter>
						getglobal(this:GetParent():GetName().."_Highlight"):Show();
						this.HighlightF:Show();
						this.NormalF:Hide();
					</OnEnter>
					<OnLeave>
						getglobal(this:GetParent():GetName().."_Highlight"):Hide();
						this.HighlightF:Hide();
						this.NormalF:Show();
					</OnLeave>
				</Scripts>
			</Frame>
			<Frame name="$parent_Rename" inherits="SW_RoundButton" hidden="false">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Delete" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="3" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>SW_RoundButtonRegister(this, {1,0,0,0.9}, "R");</OnLoad>
					<OnMouseUp>
						if this:GetParent().InEdit then
							SW_TL_ScrollUpdate(true);
						else
							SW_TL_ScrollUpdate();
							this:GetParent().InEdit = true;
							getglobal(this:GetParent():GetName().."_Text"):Hide();
							local eb = getglobal(this:GetParent():GetName().."_EditBox");
							local tmpData = SW_DataCollection.data[this:GetParent().segmentID];
							if tmpData then
								eb:SetText(tmpData.Name);
							end
							eb:Show();
						end
					</OnMouseUp>
					<OnEnter>
						getglobal(this:GetParent():GetName().."_Highlight"):Show();
						this.HighlightF:Show();
						this.NormalF:Hide();
					</OnEnter>
					<OnLeave>
						getglobal(this:GetParent():GetName().."_Highlight"):Hide();
						this.HighlightF:Hide();
						this.NormalF:Show();
					</OnLeave>
				</Scripts>
			</Frame>
			<EditBox name="$parent_EditBox" letters="30" hidden="true">
				<Size>
					<AbsDimension x="100" y="10"></AbsDimension>
				</Size>
				<Anchors>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="45" y="0" />
						</Offset>
					</Anchor>
					<Anchor point="RIGHT">
						<Offset>
							<AbsDimension x="-20" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture>
							<Color r="0.3" g="0.3" b="0.3" />
							<Anchors>
								<Anchor point="TOPLEFT" />
								<Anchor point="BOTTOMRIGHT" />
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnEnterPressed>
						SW_TL_ScrollUpdate(true);
					</OnEnterPressed>
					<OnEscapePressed>
						this:Hide();
						getglobal(this:GetParent():GetName().."_Text"):Show();
					</OnEscapePressed>
				</Scripts>
				<FontString inherits="GameFontNormalSmall">
					<FontHeight>
						<AbsValue val="10" />
					</FontHeight>
				</FontString>
			</EditBox>
		</Frames>
	</Frame>
	<Frame name="SW_TimeLine" inherits="SW_Frame" enableMouse="true" movable="true" 
		frameStrata="MEDIUM" frameLevel="150" parent="UIParent">
		<Scripts>
			<OnLoad>
				this:SetBackdropBorderColor(SW_COLOR_ACT["r"],SW_COLOR_ACT["g"],SW_COLOR_ACT["b"],1);
			</OnLoad>
			<OnHide></OnHide>
			<OnShow>SW_TL_ScrollUpdate();</OnShow>
		</Scripts>
		<Size>
			<AbsDimension x="380" y="330" />
		</Size>
		<Anchors>
			<Anchor point="CENTER" />
		</Anchors>
		<Frames>
			<!-- <Frame name="$parent_Resizer" inherits="SW_Frame_Resize" parent="SW_TimeLine" /> -->
			<Frame name="$parent_Title" inherits="SW_BarFrame_Title">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
						<Offset>
							<AbsDimension x="5" y="-4" />
						</Offset>
					</Anchor>
					<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-5" y="-24" />
						</Offset>
					</Anchor>
				</Anchors>
				<Frames>
					<Frame name="$parent_Close" inherits="SW_RoundButton" hidden="false">
						<Anchors>
							<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
								<Offset>
									<AbsDimension x="-3" y="-3" />
								</Offset>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnMouseUp>this:GetParent():GetParent():Hide();</OnMouseUp>
							<OnLoad>SW_RoundButtonRegister(this, {1,0,0,0.9}, "X");
							table.insert(SW_Registered_BF_TitleButtons, this:GetName());</OnLoad>
						</Scripts>
					</Frame>
				</Frames>
			</Frame>
			<CheckButton name="SW_Chk_TL_SafeMode" inherits="SW_OptChk_TT" hidden="false">
				<Size>
					<AbsDimension x="20" y="20" />
				</Size>
				<Scripts>
					<OnShow>
						if SW_Settings["TL_SafeMode"] then
							this:SetChecked(true);
						else
							this:SetChecked(false);
						end
					</OnShow>
					<OnClick>
						if this:GetChecked() then
							SW_Settings["TL_SafeMode"] = true;
						else
							SW_Settings["TL_SafeMode"] = false;
						end
					</OnClick>
				</Scripts>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="5" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>
			<CheckButton name="SW_Chk_TL_SingleSelect" inherits="SW_OptChk_TT" hidden="false">
				<Size>
					<AbsDimension x="20" y="20" />
				</Size>
				<Scripts>
					<OnShow>
						if SW_Settings.TL_SingleSelect then
							this:SetChecked(true);
						else
							this:SetChecked(false);
						end
					</OnShow>
					<OnClick>
						if this:GetChecked() then
							SW_Settings.TL_SingleSelect = true;
						else
							SW_Settings.TL_SingleSelect = false;
							SW_DataCollection:clearSelected();
						end
					</OnClick>
				</Scripts>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="100" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>
			<Button name="SW_TL_ReloadUI" inherits="GameMenuButtonTemplate">
				<Size>
					<AbsDimension x="80" y="20" />
				</Size>
				<Anchors>
					<Anchor point="TOPRIGHT">
						<Offset>
							<AbsDimension x="-10" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						ReloadUI();
					</OnClick>
					<OnEnter>
						GameTooltip:SetOwner(this, "ANCHOR_LEFT");
						GameTooltip:SetText(SW_GS_Tooltips["SW_TL_ReloadUI"],nil,nil,nil,nil,1);
					
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Button>
			<Button name="SW_TL_Nuke" inherits="GameMenuButtonTemplate">
				<Size>
					<AbsDimension x="80" y="20" />
				</Size>
				<Anchors>
					<Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeTo="SW_TL_ReloadUI">
						<Offset>
							<AbsDimension x="-5" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>StaticPopup_Show("SW_TL_Nuke");</OnClick>
				</Scripts>
			</Button>
			<CheckButton name="SW_Chk_TL_AutoZone" inherits="SW_OptChk_TT" hidden="false">
				<Size>
					<AbsDimension x="20" y="20" />
				</Size>
				<Scripts>
					<OnShow>
						if SW_Settings.SW_TL_AutoZone then
							this:SetChecked(true);
						else
							this:SetChecked(false);
						end
					</OnShow>
					<OnClick>
						if this:GetChecked() then
							SW_Settings.SW_TL_AutoZone = true;
						else
							SW_Settings.SW_TL_AutoZone = false;
						end
					</OnClick>
				</Scripts>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="5" y="-50" />
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>
			<CheckButton name="SW_Chk_TL_AutoDelete" inherits="SW_OptChk_TT" hidden="false">
				<Size>
					<AbsDimension x="20" y="20" />
				</Size>
				<Scripts>
					<OnShow>
						if SW_Settings.SW_TL_AutoDelete then
							this:SetChecked(true);
						else
							this:SetChecked(false);
						end
					</OnShow>
					<OnClick>
						if this:GetChecked() then
							SW_Settings.SW_TL_AutoDelete = true;
							SW_DataCollection:autoDelete(SW_TL_AUTO_THRESH);
						else
							SW_Settings.SW_TL_AutoDelete = false;
						end
					</OnClick>
				</Scripts>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="SW_Chk_TL_SingleSelect">
						<Offset>
							<AbsDimension x="0" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>
			<ScrollFrame name="SW_TL_Selector" inherits="FauxScrollFrameTemplate">
				<Size>
					<AbsDimension x="160" y="200" />
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="0" y="-80" />
						</Offset>
					</Anchor>
					<Anchor point="TOPRIGHT">
						<Offset>
							<AbsDimension x="-30" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnVerticalScroll>FauxScrollFrame_OnVerticalScroll(20, SW_TL_ScrollUpdate);</OnVerticalScroll>
					<OnShow>SW_TL_ScrollUpdate()</OnShow>
				</Scripts>
			</ScrollFrame>
			<Button name="$parent_Item1" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="SW_TL_Selector" relativePoint="TOPLEFT">
						<Offset>
							<AbsDimension x="8" y="0" />
						</Offset>
					</Anchor>
					<Anchor point="TOPRIGHT" relativeTo="SW_TL_Selector" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="0" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
			</Button>
			<Button name="$parent_Item2" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item1" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item1" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item3" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item2" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item2" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item4" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item3" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item3" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item5" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item4" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item4" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item6" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item5" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item5" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			
			<Button name="$parent_Item7" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item6" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item6" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item8" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item7" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item7" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item9" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item8" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item8" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			<Button name="$parent_Item10" inherits="SW_TL_Item">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parent_Item9" relativePoint="BOTTOMLEFT" />
					<Anchor point="TOPRIGHT" relativeTo="$parent_Item9" relativePoint="BOTTOMRIGHT" />
				</Anchors>
			</Button>
			
			<Button name="SW_TL_Select" inherits="GameMenuButtonTemplate">
				<Size>
					<AbsDimension x="80" y="20" />
				</Size>
				<Anchors>
					<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" relativeTo="SW_TL_Selector">
						<Offset>
							<AbsDimension x="20" y="-5" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						SW_DataCollection:useSelected();
					</OnClick>
				</Scripts>
			</Button>
			<Button name="SW_TL_Merge" inherits="GameMenuButtonTemplate">
				<Size>
					<AbsDimension x="80" y="20" />
				</Size>
				<Anchors>
					<Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeTo="SW_TL_Select">
						<Offset>
							<AbsDimension x="-5" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						if SW_Settings["TL_SafeMode"] then
							StaticPopup_Show("SW_TL_Merge");
						else
							SW_DataCollection:mergeSelected();
						end
					</OnClick>
				</Scripts>
			</Button>
			
		</Frames>
	</Frame>
</Ui>
