<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="TellMeWhen_GenericBorder" virtual="true" parentKey="border" setAllPoints="true">
		<Size x="1" y="1"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="borderTop">
					<Size x="1" y="1"/>
				</Texture>
				<Texture parentKey="borderBottom">
					<Size x="1" y="1"/>
				</Texture>
				<Texture parentKey="borderLeft">
					<Size x="1" y="1"/>

					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.borderTop" relativePoint="BOTTOMLEFT"/>
						<Anchor point="BOTTOMLEFT" relativeKey="$parent.borderBottom" relativePoint="TOPLEFT"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderRight">
					<Size x="1" y="1"/>
					<Anchors>
						<Anchor point="TOPRIGHT" relativeKey="$parent.borderTop" relativePoint="BOTTOMRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.borderBottom" relativePoint="TOPRIGHT"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				function self:SetSize(pixels)
					self.borderTop:ClearAllPoints()
					self.borderTop:SetPoint("TOPLEFT", -pixels, pixels)
					self.borderTop:SetPoint("TOPRIGHT", pixels, pixels)
					
					self.borderBottom:ClearAllPoints()
					self.borderBottom:SetPoint("BOTTOMLEFT", -pixels, -pixels)
					self.borderBottom:SetPoint("BOTTOMRIGHT", pixels, -pixels)

					for i, tex in TMW:Vararg(self:GetRegions()) do
						tex:SetSize(pixels, pixels)
					end
				end

				function self:SetColor(r, g, b, a)
					a = a or 1

					for i, tex in TMW:Vararg(self:GetRegions()) do
						tex:SetTexture(r, g, b, a)
					end
				end

				self:SetSize(1)
				self:SetColor(0, 0, 0, 1)
			</OnLoad>
		</Scripts>
	</Frame>

	<Frame name="TellMeWhen_OptionsModuleContainer" virtual="true" hidden="true">
		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_Panel"/>
		</Attributes>

		<Anchors>
			<Anchor point="LEFT" x="0"/>
			<Anchor point="RIGHT" />
		</Anchors>
		<Backdrop edgeFile="Interface\DialogFrame\UI-DialogBox-Background-Dark" tile="true">
			<EdgeSize>
				<AbsValue val="1"/>
			</EdgeSize>
		</Backdrop>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" setAllPoints="true"/>
			</Layer>
			<Layer level="OVERLAY">
				<FontString name="$parentHeader" parentKey="Header" inherits="GameFontNormalSmall" justifyH="CENTER" alpha="1">
					<Anchors>
						<Anchor point="BOTTOM" relativePoint="TOP" y="0"/>
						<Anchor point="LEFT" x="1" />
						<Anchor point="RIGHT" x="-1" />
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
	</Frame>
	
	<Frame name="TellMeWhen_ChooseName" inherits="TellMeWhen_OptionsModuleContainer" virtual="true">
		<!-- <Size y="50"/> -->
		<Frames>
			<EditBox name="$parentName" inherits="TellMeWhen_InputBoxTemplate" multiline="true" parentKey="Name" autoFocus="false">
				<Size x="545" y="15"/>
				<Anchors>
					<Anchor point="TOP" y="-5"/>
					<Anchor point="LEFT" x="9" />
					<Anchor point="RIGHT" x="-9" />
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentFS1" inherits="GameFontHighlightSmall" parentKey="text" justifyH="LEFT">
							<Anchors>
								<Anchor point="LEFT" relativePoint="RIGHT" x="19" y="-1"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self.BackgroundText:SetWidth(self:GetWidth())
						
						-- Turn it into a setting frame (automatically handles loading settings)
						TMW:CInit(self, {
							setting = "Name",
							doCleanString = true,
						})
						
						TMW.Classes.ChatEdit_InsertLink_Hook:New(self, function(self, text, linkType, linkData)
							if TMW.Types[TMW.CI.ics.Type].checksItems and linkType ~= "item" then
								-- notify failure if the icon is an item cooldown icon and the link is not an item link
								return false
							elseif not TMW.Types[TMW.CI.ics.Type].checksItems and linkType ~= "spell" and linkType ~= "enchant" then
								-- notify failure if the icon is not an item cooldown and the link isn't a spell or enchant link
								-- DONT just check (not TMW.Types[TMW.CI.ics.Type].checksItems and linkType == "item")
								-- because there are link types we want to exclude, like achievements.
								return false
							end

							local editbox = self.editbox

							-- find the next semicolon in the string
							local NameText = editbox:GetText()
							
							local start = #NameText
							for i = editbox:GetCursorPosition()-1, #NameText, 1 do
								if strsub(NameText, i, i) == ";" then
									start = i+1
									break
								end
							end

							local linkID = strmatch(linkData, "^(%d+)")

							-- put the cursor right after the semicolon
							editbox:SetCursorPosition(start)
							-- insert the text
							editbox:Insert("; " .. linkID .. "; ")
							-- clean the text
							TMW:CleanString(editbox)
							-- put the cursor after the newly inserted text
							editbox:SetCursorPosition(start + #linkID + 2)

							-- notify success
							return true
						end)
						
						
						TMW:RegisterCallback("TMW_ICON_SETUP_POST", function(event, icon)
							-- Warnings for missing durations and first-time instructions for duration syntax
							if icon.typeData.DurationSyntax and icon:IsBeingEdited() == "MAIN" then
								TMW.HELP:Show{
									code = "ICON_DURS_FIRSTSEE",
									icon = nil,
									relativeTo = TMW.IE.Main.Type,
									x = 20,
									y = 0,
									text = format(TMW.L["HELP_FIRSTUCD"])
								}

								local s = ""
								local array = TMW:GetSpellNames(self:GetText())
								for k, v in pairs(TMW:GetSpellDurations(self:GetText())) do
									if v == 0 then
										s = s .. (s ~= "" and "; " or "") .. array[k]
									end
								end
								if s ~= "" then
									TMW.HELP:Show{
										code = "ICON_DURS_MISSING",
										icon = icon,
										relativeTo = self,
										x = 0,
										y = 0,
										text = format(TMW.L["HELP_MISSINGDURS"], s)
									}
								else
									TMW.HELP:Hide("ICON_DURS_MISSING")
								end
							end
						end)

					</OnLoad>
					<OnEnter>
						TMW:TT_Anchor(self)
						GameTooltip:AddLine(self.__title, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b)
						GameTooltip:AddLine(self.__text, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1)

						GameTooltip:TMW_AddSpellBreakdown(TMW.IE:GetRealNames(self:GetText()))

						GameTooltip:Show()
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide()
					</OnLeave>
					<OnEditFocusGained>
						self.BackgroundText:SetText(nil)
					</OnEditFocusGained>
					<OnReceiveDrag>
						TMW.IE:SpellItemToIcon(TMW.CI.icon)
					</OnReceiveDrag>
					<OnMouseUp>
						TMW.IE:SpellItemToIcon(TMW.CI.icon)
					</OnMouseUp>
					<OnTextChanged>
						local text = self:GetText()
						if text == "" then
							local label = self.label
							local append = TMW.Types[TMW.CI.ics.Type].appendNameLabel
							if append then
								label = label .. " " .. append
							end
							self.BackgroundText:SetText(label)
						else
							self.BackgroundText:SetText(nil)
						end
						
						self:GetParent():AdjustHeight()


						TMW:CancelTimer(self.ttUpdateHandler, 1)
						self.ttUpdateHandler = TMW:ScheduleTimer("TT_Update", 1, self)
					</OnTextChanged>
				</Scripts>
			</EditBox>
		</Frames>
		<Scripts>
			<OnLoad>				
				function self:AdjustHeight()
					--self:SetHeight(11 + self.Name:GetHeight())
					TMW:AnimateHeightChange(self, 11 + self.Name:GetHeight(), 0.1)
				end
						
				function self:SetLabels(title, text)
					title = title or TMW.L["ICONMENU_CHOOSENAME2"]
					text = text or TMW.L["CHOOSENAME_DIALOG"]

					self.Name.label = title
					self.Name.__title = title
					self.Name.__text = text
					self:SetTitle(title)
					
					self.Name:GetScript("OnTextChanged")(self.Name)
				end

				function self:OnSetup(panelInfo, supplementalData)
					if supplementalData then
						self:SetLabels(supplementalData.title, supplementalData.text)

						TMW.SUG:EnableEditBox(self.Name, supplementalData.SUGType or "spell")
					else									
						TMW.SUG:EnableEditBox(self.Name, "spell")
					end
				end
			</OnLoad>
		</Scripts>
	</Frame>
	
	<Frame name="TellMeWhen_Unit" inherits="TellMeWhen_OptionsModuleContainer" virtual="true">
		<Frames>
			<EditBox name="$parentUnit" inherits="TellMeWhen_UnitEditBox" parentKey="Unit">
				<Anchors>
					<Anchor point="TOP" y="-5"/>
					<Anchor point="LEFT" x="9" />
					<Anchor point="RIGHT" x="-9" />
				</Anchors>
				<Scripts>
					<OnLoad>						
						self:RegisterEvent("MODIFIER_STATE_CHANGED")
						self.label = TMW.L["ICONMENU_UNITSTOWATCH"]
						self.BackgroundText:SetWidth(self:GetWidth())

						self.normalTooltip = TMW.L["ICONMENU_UNIT_DESC"]
						
						local text = function()
							if IsModifierKeyDown() then
								self.__noWrapTooltipText = true
								return TMW.UNITS:GetUnitInputDetailedTooltip(self)
							else
								self.__noWrapTooltipText = false
								return self.normalTooltip
							end
						end
						
						function self:SetLabels(title, text)
							self.label = title
							self.__title = title
							self.normalTooltip = text
							self:GetParent().Header:SetText(title)
							
							self:GetScript("OnTextChanged")(self)
						end

						TMW:CInit(self, {
							setting = "Unit",
							title = TMW.L["ICONMENU_UNITSTOWATCH"],
							tooltip = text,
							doCleanString = true,
							OnTextChanged = function(self)
								self:GetParent():AdjustHeight()
							end,
						})
						
						TMW:RegisterCallback("TMW_CONFIG_PANEL_SETUP", function(event, frame, panelInfo)
							if frame == self:GetParent() then
								local supplementalData = panelInfo.supplementalData
								self.supplementalData = supplementalData
								
								local title, text
								
								if supplementalData then
									title = supplementalData.title or TMW.L["ICONMENU_UNITSTOWATCH"]
									text = supplementalData.text or TMW.L["ICONMENU_UNIT_DESC"]
									
									TMW.SUG:EnableEditBox(self, supplementalData.SUGType or "units")
								else
									title = TMW.L["ICONMENU_UNITSTOWATCH"]
									text  = TMW.L["ICONMENU_UNIT_DESC"]
									
									TMW.SUG:EnableEditBox(self, "units")
								end

								self:SetLabels(title, text)
							end
						end)
						
					</OnLoad>
					<OnTextChanged>
						local text = self:GetText()

						local allowNoUnit = self.supplementalData and self.supplementalData.allowNoUnit
						
						if text == "" then
							if allowNoUnit then
								self.BackgroundText:SetText(self.label)
								TMW.HELP:Hide("ICON_UNIT_MISSING")
							else
								self.BackgroundText:SetText("|cFFFF5050" .. self.label)
								TMW.HELP:Show{
									code = "ICON_UNIT_MISSING",
									icon = TMW.CI.icon,
									relativeTo = self,
									x = 0,
									y = 0,
									text = format(TMW.L["HELP_NOUNITS"])
								}
							end
						else
							self.BackgroundText:SetText(nil)
							TMW.HELP:Hide("ICON_UNIT_MISSING")
						end
					</OnTextChanged>
				</Scripts>
			</EditBox>
			
			<Button name="$parentUnitConditions" parentKey="UnitConditions" inherits="TellMeWhen_ButtonTemplate">
				<Size x="160" y="16"/>
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentUnit" relativePoint="BOTTOM" y="-7"/>
					<!-- <Anchor point="LEFT" relativeTo="$parentUnit" x="-1"/>
					<Anchor point="RIGHT" relativeTo="$parentUnit" x="1"/> -->
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetScale(0.9)
						self:SetFrameLevel(self:GetParent():GetFrameLevel()+2)
						self.Background:SetAlpha(0.7)
						
						TMW:TT(self, "UNITCONDITIONS", "UNITCONDITIONS_DESC")
						
						TMW:RegisterCallback("TMW_CONFIG_PANEL_SETUP", function(event, frame, panelInfo)
							if frame == self:GetParent() then
								local supplementalData = panelInfo.supplementalData
								self.supplementalData = supplementalData
								
								if supplementalData then
									if supplementalData.implementsConditions then
										self:Show()
									else
										self:Hide()
									end
								else
									self:Hide()
								end
							end
						end)
					</OnLoad>
					<OnUpdate>
						local text = TMW.CNDT:GetTabText("Unit")
						
						self:SetText(text)
						self:SetWidth(self:GetTextWidth()+20)
					</OnUpdate>
					<OnClick>
						TMW.CNDT:LoadConfig("Unit")
					</OnClick>
					<OnShow>
						self:SetHeight(16)
						if self:GetParent().AdjustHeight then
							self:GetParent():AdjustHeight()
						end
					</OnShow>
					<OnHide>
						self:SetHeight(-7)
						if self:GetParent().AdjustHeight then
							self:GetParent():AdjustHeight()
						end
					</OnHide>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				self.Header:SetText(TMW.L["ICONMENU_UNITSTOWATCH"])
				
				function self:AdjustHeight()
					--self:SetHeight(15 + self.UnitConditions:GetHeight()+self.Unit:GetHeight())
					TMW:AnimateHeightChange(self, 15 + self.UnitConditions:GetHeight()+self.Unit:GetHeight(), 0.1)
				end
			</OnLoad>
		</Scripts>
	</Frame>
	
	<Frame name="TellMeWhen_SortSettings" inherits="TellMeWhen_OptionsModuleContainer" virtual="true">
		<Size y="92"/>
		<Scripts>
			<OnLoad>
				self.Header:SetText(TMW.L["SORTBY"])

				TMW.IE:BuildSimpleCheckSettingFrame(self, {
					numPerRow = 3,
					{
						setting = "Sort",
						value = false,
						title = TMW.L["SORTBYNONE"],
						tooltip = TMW.L["SORTBYNONE_DESC"],
					},
					{
						setting = "Sort",
						value = -1,
						title = TMW.L["ICONMENU_SORTASC"],
						tooltip = TMW.L["ICONMENU_SORTASC_DESC"],
					},
					{
						setting = "Sort",
						value = 1,
						title = TMW.L["ICONMENU_SORTDESC"],
						tooltip = TMW.L["ICONMENU_SORTDESC_DESC"],
					},
				})
			</OnLoad>
		</Scripts>
	</Frame>
	
	<Frame name="TellMeWhen_SortSettingsWithStacks" inherits="TellMeWhen_OptionsModuleContainer" virtual="true">
		<Size y="92"/>
		<Scripts>
			<OnLoad>
				local function disableStackSort()
					TMW.CI.ics.StackSort = false
				end
				local function disableDurSort()
					TMW.CI.ics.Sort = false
				end

				self.Header:SetText(TMW.L["SORTBY"])
				TMW.IE:BuildSimpleCheckSettingFrame(self, {
					numPerRow = 3,
					{
						setting = "Sort",
						value = false,
						title = TMW.L["SORTBYNONE_DURATION"],
						tooltip = TMW.L["SORTBYNONE_DESC"],
					},
					{
						setting = "Sort",
						value = -1,
						title = TMW.L["ICONMENU_SORTASC"],
						tooltip = TMW.L["ICONMENU_SORTASC_DESC"],
						OnClick = disableStackSort,
					},
					{
						setting = "Sort",
						value = 1,
						title = TMW.L["ICONMENU_SORTDESC"],
						tooltip = TMW.L["ICONMENU_SORTDESC_DESC"],
						OnClick = disableStackSort,
					},

					{
						setting = "StackSort",
						value = false,
						title = TMW.L["SORTBYNONE_STACKS"],
						tooltip = TMW.L["SORTBYNONE_DESC"],
					},
					{
						setting = "StackSort",
						value = -1,
						title = TMW.L["ICONMENU_SORT_STACKS_ASC"],
						tooltip = TMW.L["ICONMENU_SORT_STACKS_ASC_DESC"],
						OnClick = disableDurSort,
					},
					{
						setting = "StackSort",
						value = 1,
						title = TMW.L["ICONMENU_SORT_STACKS_DESC"],
						tooltip = TMW.L["ICONMENU_SORT_STACKS_DESC_DESC"],
						OnClick = disableDurSort,
					},
				})
			</OnLoad>
		</Scripts>
	</Frame>
	
	<Frame name="TellMeWhen_WhenCheckSet" virtual="true">
		<Size y="40"/>

		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_Frame_WhenChecks"/>
		</Attributes>

		<Frames>
			<CheckButton name="$parentCheck" parentKey="Check" inherits="TellMeWhen_CheckTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" x="5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetWidth(self:GetParent():GetWidth()-7)
					</OnLoad>
				</Scripts>
			</CheckButton>
			<Slider name="$parentAlpha" parentKey="Alpha" inherits="TellMeWhen_SliderTemplate_Alpha" valuestep="1">
				<Size y="17"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentCheck" relativePoint="RIGHT" x="5" />
					<Anchor point="RIGHT" x="-11" />
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetWidth(self:GetWidth())
					</OnLoad>
				</Scripts>
			</Slider>
		</Frames>
	</Frame>
	<Frame name="TellMeWhen_WhenChecks" inherits="TellMeWhen_OptionsModuleContainer" virtual="true">
		<Size y="78"/>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentFS1" inherits="GameFontNormal" parentKey="text" justifyH="LEFT">
					<Anchors>
						<Anchor point="TOPLEFT" x="-10" y="10"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="$parentAlpha" inherits="TellMeWhen_WhenCheckSet">
				<Anchors>
					<Anchor point="TOP" y="-6"/>
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							alphaSettingName = "Alpha",
							bit = 0x2,
						})
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentUnAlpha" inherits="TellMeWhen_WhenCheckSet">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentAlpha" relativePoint="BOTTOM" y="2"/>
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							alphaSettingName = "UnAlpha",
							bit = 0x1,
						})
					</OnLoad>
				</Scripts>
			</Frame>					
		</Frames>
		<Scripts>
			<OnLoad>
				TMW:RegisterCallback("TMW_CONFIG_PANEL_SETUP", function(event, frame, panelInfo)
					if frame == self then
						local supplementalData = panelInfo.supplementalData
						
						assert(supplementalData, "Supplemental data (arg5 to RegisterConfigPanel_XMLTemplate) must be provided for TellMeWhen_WhenChecks!")
						
						-- Set the title for the frame
						self.Header:SetText(supplementalData.text or TMW.L["ICONMENU_SHOWWHEN"])
					end
				end)
			</OnLoad>
		</Scripts>
	</Frame>
	
	<!-- TEMPLATES -->
	
	<ScrollFrame name="TellMeWhen_ScrollFrameTemplate" parentKey="ScrollFrame" virtual="true">
		<Scripts>
			<OnLoad>
				self.edgeScrollMouseCursorRange = 5
				self.edgeScrollScrollDistancePerSecond = 150
				self.scrollPercentage = 1/2
			</OnLoad>
			<OnScrollRangeChanged>
				local yrange = self:GetVerticalScrollRange()

				if ( floor(yrange) == 0 ) then
					self.ScrollBar:Hide()
				else
					self.ScrollBar:Show()
				end

				if 0 >= self:GetVerticalScroll() then
					self:SetVerticalScroll(0)
				elseif self:GetVerticalScroll() > yrange then
					self:SetVerticalScroll(yrange)
				end

				local height = self:GetHeight()
				self.percentage = height/(yrange+height)

				self.ScrollBar.Thumb:SetHeight(max(height*self.percentage, 15))

				self.ScrollBar.Thumb:SetPoint("TOP", self, "TOP", 0, -(self:GetVerticalScroll()*self.percentage))
			</OnScrollRangeChanged>
		  
			<OnVerticalScroll>			
				self.ScrollBar.Thumb:SetPoint("TOP", self, "TOP", 0, -(offset*self.percentage))

			</OnVerticalScroll>
			<OnMouseWheel>
				local scrollStep = self.scrollStep or self:GetHeight() * self.scrollPercentage
				local newScroll
				if ( delta > 0 ) then
					newScroll = self:GetVerticalScroll() - scrollStep
				else
					newScroll = self:GetVerticalScroll() + scrollStep
				end
				if 0 > newScroll then
					newScroll = 0
				elseif newScroll > self:GetVerticalScrollRange() then
					newScroll = self:GetVerticalScrollRange()
				end
				self:SetVerticalScroll(newScroll)
			</OnMouseWheel>
			
			<OnUpdate>
				if self.AllowEdgeScrolling then
					local scale = self:GetEffectiveScale()
					local self_top, self_bottom = self:GetTop()*scale, self:GetBottom()*scale
					
					local _, cursorY = GetCursorPosition()
					
					local absDistance_top = abs(self_top - cursorY)
					local absDistance_bottom = abs(self_bottom - cursorY)
					
					local scrollStep
					if absDistance_top > absDistance_bottom then
						-- We are closer to the bottom of the frame
						if self.edgeScrollMouseCursorRange > absDistance_bottom then
							scrollStep = -self.edgeScrollScrollDistancePerSecond*elapsed
						end
					else
						-- We are closer to the top of the frame
						if self.edgeScrollMouseCursorRange > absDistance_top then
							scrollStep = self.edgeScrollScrollDistancePerSecond*elapsed
						end
					end
				
					if scrollStep then
						local newScroll = self:GetVerticalScroll() - scrollStep
						
						if 0 > newScroll then
							newScroll = 0
						elseif newScroll > self:GetVerticalScrollRange() then
							newScroll = self:GetVerticalScrollRange()
						end
						self:SetVerticalScroll(newScroll)
					end
				end
			</OnUpdate>
			<OnSizeChanged>
				-- container's width doesn't get adjusted as we resize. Fix this.
			    self.container:SetWidth(self:GetWidth())
			</OnSizeChanged>
		</Scripts>
		<Frames>
			<Frame name="$parentScrollBar" parentKey="ScrollBar" hidden="true">
				<Size x="10"/>
				<Anchors>
					<Anchor point="TOP"/>
					<Anchor point="BOTTOM"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="$parentBackdrop" setAllPoints="true" parentKey="Backdrop" >
							<Color r="0.15" g="0.15" b="0.15" a="1"/>
					
							<Gradient orientation="HORIZONTAL">
								<MinColor r="1" g="1" b="1" a="1"/>
								<MaxColor r="0.6" g="0.6" b="0.6" a="1"/>
							</Gradient>
						</Texture>
					</Layer>
				</Layers>
				
				<Frames>
					<Button name="$parentThumb" parentKey="Thumb" >
						<Anchors>
							<Anchor point="LEFT"/>
							<Anchor point="RIGHT"/>
						</Anchors>
						
						<NormalTexture setAllPoints="true">
							<Color r="0.6" g="0.6" b="0.6" a="1"/>
							
							<Gradient orientation="HORIZONTAL">
								<MinColor r="1" g="1" b="1" a="1"/>
								<MaxColor r="0.6" g="0.6" b="0.6" a="1"/>
							</Gradient>
						</NormalTexture>
						<HighlightTexture setAllPoints="true" alpha="0.25">
							<Color r=".1" g="1" b="1"/>
						</HighlightTexture>
						<PushedTexture setAllPoints="true" >
							<Color r="0.8" g="0.8" b="0.8" a="1"/>
							
							<Gradient orientation="HORIZONTAL">
								<MinColor r="1" g="1" b="1" a="1"/>
								<MaxColor r="0.6" g="0.6" b="0.6" a="1"/>
							</Gradient>
						</PushedTexture>
						
						<Layers>
							<Layer level="OVERLAY">							
								<Texture parentKey="tick1">
									<Color r="0.2" g="0.2" b="0.2"/>
									<Size y="1"/>
					
									<Anchors>
										<Anchor point="LEFT" x="1"/>
										<Anchor point="RIGHT" x="-1"/>
									</Anchors>
								</Texture>
								<Texture>
									<Color r="0.2" g="0.2" b="0.2"/>
									<Size y="1"/>
									<Anchors>
										<Anchor point="LEFT" x="1"/>
										<Anchor point="RIGHT" x="-1"/>
										<Anchor point="BOTTOM" relativeKey="$parent.tick1" relativePoint="TOP" y="2"/>
									</Anchors>
								</Texture>
								
								<Texture>
									<Color r="0.2" g="0.2" b="0.2"/>
									<Size y="1"/>
					
									<Anchors>
										<Anchor point="LEFT" x="1"/>
										<Anchor point="RIGHT" x="-1"/>
										<Anchor point="TOP" relativeKey="$parent.tick1" relativePoint="BOTTOM" y="-2"/>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								self:RegisterForDrag("LeftButton")
							</OnLoad>
							<OnDragStart>
								local _
								self.IsScrolling = true
								_, self.startY = GetCursorPosition()
								self.startHeight = select(5, self:GetPoint(1))
								self:SetButtonState("PUSHED")
								self:LockHighlight()
							</OnDragStart>
							<OnDragStop>
								self.IsScrolling = false
								self:SetButtonState("NORMAL")
								self:UnlockHighlight()
							</OnDragStop>
							<OnUpdate>
								if self.IsScrolling then
									local _, currentY = GetCursorPosition()
									local delta = (currentY - self.startY)/self:GetEffectiveScale()
									
									local ScrollFrame = self:GetParent():GetParent()
									
									
									local maxTop = -(ScrollFrame:GetHeight() - self:GetHeight())
									local minTop = 0
									
									local newTop = (self.startHeight + delta)
									if maxTop > newTop then
										newTop = maxTop
									elseif newTop > minTop then
										newTop = minTop
									end
									
									ScrollFrame:SetVerticalScroll(-(newTop/ScrollFrame.percentage))
									self:SetPoint("TOP", ScrollFrame, "TOP", 0, newTop)
								end
							</OnUpdate>
						</Scripts>
					
					</Button>
				</Frames>
				<Scripts>
					<OnMouseWheel>
						self:GetParent():GetScript("OnMouseWheel")(self:GetParent(), delta)
					</OnMouseWheel>
					<OnMouseDown>
						local delta
						local _, y = GetCursorPosition()
						if self.Thumb:GetBottom()*self:GetEffectiveScale() > y then
							delta = -1
						elseif y > self.Thumb:GetTop()*self:GetEffectiveScale() then
							delta = 1
						end
						
						self:GetParent():GetScript("OnMouseWheel")(self:GetParent(), delta)
					</OnMouseDown>
				</Scripts>
			</Frame>
		</Frames>
	</ScrollFrame>
	
	
	<CheckButton name="TellMeWhen_CheckTemplate" virtual="true">
		<Size x="30" y="30"/>
		
		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_CheckButton"/>
		</Attributes>

        <Layers>
			<Layer level="ARTWORK">
				<FontString parentKey="text" justifyH="LEFT" inherits="GameFontHighlightSmall">
					<Anchors>
						<Anchor point="LEFT" relativePoint="RIGHT" x="-2"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<Button parentKey="clickinterceptor">
				<Scripts>
					<OnLoad>
						self.parent = self:GetParent()
						self:SetAllPoints(self.parent.text)
					</OnLoad>
					<OnEnter>
						if not self.parent:IsEnabled() and not self.parent:GetMotionScriptsWhileDisabled() then
							return
						end
						
						self.parent:LockHighlight()
						
						local OnEnter = self.parent:GetScript("OnEnter")
						if OnEnter then
							OnEnter(self.parent)
						end
					</OnEnter>
					<OnLeave>
						self.parent:UnlockHighlight()
						
						local OnLeave = self.parent:GetScript("OnLeave")
						if OnLeave then
							OnLeave(self.parent)
						end
					</OnLeave>
					<OnClick>
						if not self.parent:IsEnabled() then return end
						
						self.parent:Click(button)
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnEnable>
				self:SetAlpha(1)
			</OnEnable>
			<OnDisable>
				self:SetAlpha(0.4)
			</OnDisable>
			<OnEnter>
				self:LockHighlight()
			</OnEnter>
			<OnLeave>
				self:UnlockHighlight()
			</OnLeave>
		</Scripts>
		<NormalTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Up"/>
		<PushedTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Down"/>
		<HighlightTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
		<CheckedTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Check"/>
		<DisabledCheckedTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
	</CheckButton>

	<!-- Appearance Templates -->
	<Frame name="TellMeWhen_BorderedFrame" virtual="true">
		<Backdrop edgeFile="Interface\DialogFrame\UI-DialogBox-Background-Dark" tile="true">
			<EdgeSize>
				<AbsValue val="0.5"/>
			</EdgeSize>
		</Backdrop>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" setAllPoints="true">
					<Color r="1" g="1" b="1" a="1"/>
					
					<Gradient orientation="VERTICAL">
						<MinColor r="1" g="1" b="1" a="0.05"/>
						<MaxColor r="1" g="1" b="1" a="0.10"/>
					</Gradient>
				</Texture>
			</Layer>
		</Layers>
	</Frame>

	<Texture name="TellMeWhen_InputBoxTemplateBorder" virtual="true">
		<Size x="1" y="1"/>
		<Color r="0.4" g="0.4" b="0.4" a="1"/>
	</Texture>
	<EditBox name="TellMeWhen_InputBoxTemplate" enableMouse="true" virtual="true" autoFocus="false">
		<Size y="15"/>
		
		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_EditBox"/>
		</Attributes>

		<HitRectInsets left="-1" right="-1" top="-1" bottom="-1" />
		<TextInsets>
			<AbsInset left="2" right="2" top="2" bottom="2"/>
		</TextInsets>
		<Layers>
			<Layer level="BACKGROUND">
				
				<Texture parentKey="borderTop">
					<Size x="1" y="1"/>
					<Color r="0.4" g="0.4" b="0.4" a="1"/>

					<Anchors>
						<Anchor point="TOPLEFT" x="-2"/>
						<Anchor point="TOPRIGHT"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderBottom">
					<Size x="1" y="1"/>
					<Color r="0.4" g="0.4" b="0.4" a="1"/>

					<Anchors>
						<Anchor point="BOTTOMLEFT" x="-2" y="-1"/>
						<Anchor point="BOTTOMRIGHT" y="-1"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderLeft">
					<Size x="1" y="1"/>
					<Color r="0.4" g="0.4" b="0.4" a="1"/>

					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.borderTop" relativePoint="BOTTOMLEFT"/>
						<Anchor point="BOTTOMLEFT" relativeKey="$parent.borderBottom" relativePoint="TOPLEFT"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderRight">
					<Size x="1" y="1"/>
					<Color r="0.4" g="0.4" b="0.4" a="1"/>

					<Anchors>
						<Anchor point="TOPRIGHT" relativeKey="$parent.borderTop" relativePoint="BOTTOMRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.borderBottom" relativePoint="TOPRIGHT"/>
					</Anchors>
				</Texture>
				
				<Texture parentKey="background">
					<Color r="0" g="0" b="0" a="1"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.borderLeft" relativePoint="TOPRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.borderRight" relativePoint="BOTTOMLEFT"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<FontString parentKey="BackgroundText" justifyH="CENTER" wordwrap="false" inherits="GameFontHighlightSmall">
					<Color r="0.5" g="0.5" b="0.5"/>
					<Anchors>
						<Anchor point="LEFT"/>
						<Anchor point="RIGHT"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEscapePressed>
				EditBox_ClearFocus(self)
				self:GetScript("OnTextChanged")(self)
			</OnEscapePressed>
			<OnEditFocusLost>
				EditBox_ClearHighlight(self)
				self:GetScript("OnTextChanged")(self)
			</OnEditFocusLost>
			<OnEditFocusGained>
				EditBox_HighlightText(self)
				self.BackgroundText:SetText(nil)
			</OnEditFocusGained>
			<OnEnterPressed>
				if self:IsMultiLine() and IsModifierKeyDown() then
					self:Insert("\r\n")
				else
					self:ClearFocus()
				end
			</OnEnterPressed>
			<OnTextChanged>
				local text = self:GetText()
				if text == "" then
					self.BackgroundText:SetText(self.label)
				else
					self.BackgroundText:SetText(nil)
				end
			</OnTextChanged>
		</Scripts>
		<FontString inherits="GameFontHighlight"/>
	</EditBox>
	
	<Button name="TellMeWhen_ButtonTemplate" virtual="true">
		<Size x="144" y="15"/>
		
		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_Button"/>
		</Attributes>

		<NormalFont style="GameFontNormal"/>
		<HighlightFont style="GameFontHighlight"/>
		<DisabledFont style="GameFontDisable"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="borderTop" inherits="TellMeWhen_InputBoxTemplateBorder">
					<Anchors>
						<Anchor point="TOPLEFT" x="0" y="1"/>
						<Anchor point="TOPRIGHT" y="1"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderBottom" inherits="TellMeWhen_InputBoxTemplateBorder">
					<Anchors>
						<Anchor point="BOTTOMLEFT" x="0" y="0"/>
						<Anchor point="BOTTOMRIGHT" y="0"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderLeft" inherits="TellMeWhen_InputBoxTemplateBorder">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.borderTop" relativePoint="BOTTOMLEFT"/>
						<Anchor point="BOTTOMLEFT" relativeKey="$parent.borderBottom" relativePoint="TOPLEFT"/>
					</Anchors>
				</Texture>
				<Texture parentKey="borderRight" inherits="TellMeWhen_InputBoxTemplateBorder">
					<Anchors>
						<Anchor point="TOPRIGHT" relativeKey="$parent.borderTop" relativePoint="BOTTOMRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.borderBottom" relativePoint="TOPRIGHT"/>
					</Anchors>
				</Texture>
				
				<Texture parentKey="Background">
					<Color r="0.15" g="0.15" b="0.15" a="0.5"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.borderLeft" relativePoint="TOPRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.borderRight" relativePoint="BOTTOMLEFT"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnable>
				self:SetAlpha(1)
			</OnEnable>
			<OnDisable>
				self:SetAlpha(0.7)
			</OnDisable>
		</Scripts>
	</Button>
	<EditBox name="TellMeWhen_TimeEditBoxTemplate" inherits="TellMeWhen_InputBoxTemplate" virtual="true">
		<Size x="60" y="15"/>
		<Layers>
			<Layer level="ARTWORK">
				<FontString parentKey="text" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Anchors>
						<Anchor point="BOTTOM" relativePoint="TOP" y="2"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEditFocusLost>
				EditBox_ClearHighlight(self)

				local t = TMW:CleanString(self)
				if strfind(t, ":") then
					t = TMW.toSeconds(t)
				end
				t = tonumber(t) or 0
				self:SetText(t)
				self:GetScript("OnTextChanged")(self)
			</OnEditFocusLost>
		</Scripts>
	</EditBox>

	<Slider name="TellMeWhen_SliderTemplate" orientation="HORIZONTAL" virtual="true" enableMouse="true">
		<Size y="17"/>

		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_Slider"/>
		</Attributes>

		<Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background" edgeFile="Interface\Buttons\UI-SliderBar-Border" tile="true">
			<EdgeSize>
				<AbsValue val="8"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="8"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="3" right="3" top="6" bottom="6"/>
			</BackgroundInsets>
		</Backdrop>
		<HitRectInsets left="0" right="0" top="-1" bottom="-4" />
		<Layers>
			<Layer level="ARTWORK">
				<FontString parentKey="text" inherits="GameFontHighlightSmall" justifyH="CENTER" justifyV="BOTTOM">
					<Anchors>
						<Anchor point="BOTTOM" relativePoint="TOP" y="-1"/>
						<Anchor point="LEFT" x="-5"/>
						<Anchor point="RIGHT" x="5"/>
					</Anchors>
				</FontString>
				<FontString inherits="GameFontHighlightSmall" parentKey="Low" text="LOW">
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="-4" y="3"/>
					</Anchors>
				</FontString>
				<FontString parentKey="Mid" inherits="GameFontHighlightSmall" text="">
					<Anchors>
						<Anchor point="TOP" relativePoint="BOTTOM" y="3"/>
					</Anchors>
				</FontString>
				<FontString inherits="GameFontHighlightSmall" parentKey="High" text="HIGH">
					<Anchors>
						<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="4" y="3"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<ThumbTexture file="Interface\Buttons\UI-SliderBar-Button-Horizontal">
			<Size x="32" y="32"/>
		</ThumbTexture>
	</Slider>

	<Slider name="TellMeWhen_SliderTemplate_Alpha" inherits="TellMeWhen_SliderTemplate" virtual="true">
		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_Slider_Alpha"/>
		</Attributes>
	</Slider>

	<Button name="TellMeWhen_DropdownMenuButtonTemplate" motionScriptsWhileDisabled="true" virtual="true">
		<Size x="22" y="22"/>
		<Scripts>
			<OnEnter>
				local parent = self:GetParent();
				local myscript = parent:GetScript("OnEnter");
				if(myscript ~= nil) then
					myscript(parent);
				end
			</OnEnter>
			<OnLeave>
				local parent = self:GetParent();
				local myscript = parent:GetScript("OnLeave");
				if(myscript ~= nil) then
					myscript(parent);
				end
			</OnLeave>
			<OnClick>
				ToggleDropDownMenu(nil, nil, self:GetParent());
				PlaySound("igMainMenuOptionCheckBoxOn");
			</OnClick>
		</Scripts>
		<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up">
			<Size x="24" y="24"/>
			<Anchors>
				<Anchor point="RIGHT"/>
			</Anchors>
		</NormalTexture>
		<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down">
			<Size x="24" y="24"/>
			<Anchors>
				<Anchor point="RIGHT"/>
			</Anchors>
		</PushedTexture>
		<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled">
			<Size x="24" y="24"/>
			<Anchors>
				<Anchor point="RIGHT"/>
			</Anchors>
		</DisabledTexture>
		<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
			<Size x="24" y="24"/>
			<Anchors>
				<Anchor point="RIGHT"/>
			</Anchors>
		</HighlightTexture>
	</Button>
	<Frame name="TMW_DropDownMenuTemplate" enableMouse="true" virtual="true">
		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_DropDownMenu"/>
		</Attributes>

		<Size x="40" y="32"/>

		<HitRectInsets left="0" right="0" top="1" bottom="7" />

		<Layers>
			<Layer level="ARTWORK">
				<Texture name="$parentLeft" parentKey="Left" file="Interface\AddOns\TellMeWhen\Textures\DropdownTexture">
					<Size x="25" y="61.5"/>
					<Anchors>
						<Anchor point="TOP" y="17"/>
						<Anchor point="LEFT" x="-17" />
					</Anchors>
					<TexCoords left="0" right="0.1953125" top="0" bottom="1"/>
				</Texture>
				<Texture name="$parentRight" parentKey="Right" file="Interface\AddOns\TellMeWhen\Textures\DropdownTexture">
					<Size x="25" y="61.5"/>
					<Anchors>
						<Anchor point="TOPRIGHT" x="17" y="17"/>
					</Anchors>
					<TexCoords left="0.8046875" right="1" top="0" bottom="1"/>
				</Texture>
				<Texture name="$parentMiddle" parentKey="Middle" file="Interface\AddOns\TellMeWhen\Textures\DropdownTexture">
					<Size y="61.5"/>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
						<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
					</Anchors>
					<TexCoords left="0.1953125" right="0.8046875" top="0" bottom="1"/>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<Texture name="$parentIcon" hidden="true">
					<Size x="16" y="16"/>
					<Anchors>
						<Anchor point="LEFT" x="30" y="2"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Button name="$parentButton" parentKey="Button" inherits="TellMeWhen_DropdownMenuButtonTemplate" >
				<Anchors>
					<Anchor point="RIGHT" relativeTo="$parentRight" x="-16.5" y="1"/>
				</Anchors>
			</Button>
		</Frames>
		
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentText" parentKey="Text" inherits="GameFontHighlightSmall" wordwrap="false" justifyH="LEFT" justifyV="CENTER">
					<Size y="10"/>
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentLeft" x="27" y="1"/>
						<Anchor point="RIGHT" relativeTo="$parentButton" relativePoint="LEFT" x="0" />
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnter>
				self.Button:LockHighlight()
			</OnEnter>
			<OnLeave>
				self.Button:UnlockHighlight()
			</OnLeave>
			<OnHide>
				CloseDropDownMenus()
			</OnHide>
			<OnMouseUp>				
				self.Button:Click()
			</OnMouseUp>
		</Scripts>
	</Frame>
	<Frame name="TMW_IconDropDownMenuTemplate" inherits="TMW_DropDownMenuTemplate" virtual="true">

		<Attributes>
			<Attribute name="tmw-class" type="string" value="Config_DropDownMenu_Icon"/>
		</Attributes>

		<Frames>
			<Button parentKey="IconPreview" enableMouse="true">
				<Size x="18" y="18"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT" x="0" y="3"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="texture" file="Interface\Icons\INV_Misc_QuestionMark" setAllPoints="true">
							<TexCoords left="0.07" right="0.93" top="0.07" bottom="0.93"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnMouseUp>
						if TMW.IE then
							if button == "RightButton" then
								TMW.IE:Load(nil, self.icon)
							end
							TMW.IE:ScheduleIconSetup(self.icon)
						end
					</OnMouseUp>
				</Scripts>

				<NormalTexture />
				<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
				<PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/>
			</Button>
		</Frames>
	</Frame>

	<EditBox name="TellMeWhen_ExportBoxTemplate" inherits="TellMeWhen_InputBoxTemplate" virtual="true">
		<Size y="15"/>
		<Frames>
		
			<Button parentKey="Button" inherits="TellMeWhen_ButtonTemplate" >
				<Size x="100" y="15"/>
				<Anchors>
					<Anchor point="RIGHT" x="0" y="-1"/>
				</Anchors>
				<Layers>
					<Layer level="OVERLAY">
						<Texture parentKey="Glow" alphaMode="ADD" setAllPoints="true">
							<Color r="0" g="0.7" b="0" a="0.3"/>
							<Animations>
								<AnimationGroup parentKey="Anim" looping="REPEAT">
									<Alpha change="1" duration="0.7" order="1"/>
									<Alpha startDelay="0.1" change="-1" duration="0.7" order="2"/>
								</AnimationGroup>
							</Animations>
						</Texture>
					</Layer>
				</Layers>
				<NormalFont style="GameFontNormalSmall"/>
				<HighlightFont style="GameFontHighlightSmall"/>
				<DisabledFont style="GameFontDisableSmall"/>
				<Scripts>
					<OnLoad>
						TMW:TT(self, "IMPORT_EXPORT", "IMPORT_EXPORT_BUTTON_DESC")
						self:SetText(TMW.L["IMPORT_EXPORT"])
						self:SetWidth(self:GetTextWidth() + 10)
						self:SetFrameLevel(self:GetFrameLevel() + 2)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						ToggleDropDownMenu(nil, nil, self:GetParent().DD, self, 0, 0)
					</OnClick>
				</Scripts>
			</Button>
			<Frame name="$parentDD" inherits="TMW_DropDownMenuTemplate" propagateKeyboardInput="true" parentKey="DD">
				<Anchors>
					<Anchor point="LEFT" relativePoint="RIGHT" x="-15" y="-4"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							func = TMW.IE.ImportExport_DropDown,
						})
						self:Hide()
					</OnLoad>
					<OnKeyDown>
						if key == "C" and (IsControlKeyDown()) then
							TMW.HELP:Hide("ICON_EXPORT_DOCOPY")
						end
					</OnKeyDown>
					<OnKeyUp>
						if key == "C" and (IsControlKeyDown()) then
							TMW.HELP:Hide("ICON_EXPORT_DOCOPY")
						end
					</OnKeyUp>
				</Scripts>
			</Frame>
			<StatusBar parentKey="Status" hidden="true">
				<Anchors>
					<Anchor point="TOPLEFT" x="-4"/>
					<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Button" relativePoint="BOTTOMLEFT" x="-2" />
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<Texture parentKey="texture" file="Interface\TargetingFrame\UI-StatusBar"/>
					</Layer>

					<Layer level="OVERLAY">
						<FontString parentKey="text" inherits="GameFontHighlight">
							<Anchors>
								<Anchor point="CENTER"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>

				<Animations>
					<AnimationGroup parentKey="FadeIn">
						<Alpha change="1" duration="1" order="1"/>
						<Scripts>
							<OnPlay>
								self:GetParent():SetAlpha(0)
								self:GetParent().FadeOut:Stop()
								self:GetParent():Show()
							</OnPlay>
							<OnFinished>
								self:GetParent():SetAlpha(1)
							</OnFinished>
						</Scripts>
					</AnimationGroup>
					<AnimationGroup parentKey="FadeOut">
						<Alpha change="-1" duration="1" order="1"/>
						<Scripts>
							<OnPlay>
								self:GetParent().FadeIn:Stop()
								self:GetParent():SetAlpha(1)
							</OnPlay>
							<OnFinished>
								self:GetParent():Hide()
								self:GetParent():SetAlpha(0)
							</OnFinished>
						</Scripts>
					</AnimationGroup>
				</Animations>
				<Scripts>
					<OnLoad>
						self:SetStatusBarTexture(self.texture)
						self.texture:SetVertexColor(1, .5, .2, 1)

						function self:Set(value, max, nAndMaxN)
							if not self:IsShown() then
								self.FadeIn:Play()
							end
							self:SetMinMaxValues(0, max)
							self:SetValue(value)

							if self:IsShown() then
								if nAndMaxN[2] > 1 then
									self.text:SetFormattedText("%.0f%% (%d/%d)", value/max*100, nAndMaxN[1], nAndMaxN[2])
								else
									self.text:SetFormattedText("%.0f%%", value/max*100)
								end
							end

							if value >= max and nAndMaxN[1] >= nAndMaxN[2] then
								self.FadeOut:Play()
							end
						end
						self:SetFrameLevel(self:GetParent():GetFrameLevel())
						self.realParent = self:GetParent()
						--self:SetParent(TellMeWhen_IconEditor)
					</OnLoad>
					<OnShow>
						self.texture:SetTexture(LibStub("LibSharedMedia-3.0"):Fetch("statusbar", TMW.db.profile.TextureName))
						self.realParent.BackgroundText:Hide()
					</OnShow>
					<OnHide>
						self.realParent.BackgroundText:Show()
					</OnHide>
				</Scripts>
			</StatusBar>
		</Frames>
		<Scripts>
			<OnLoad>
			--	self.label = TMW.L["IMPORT_EXPORT"]
				TMW:TT(self, "IMPORT_EXPORT", "IMPORT_EXPORT_DESC")
				self:SetTextInsets(0, self.Button:GetTextWidth()+5 + 2, 0, 0)

				function self.callback(nAndMaxN, soFar, total)
					self.Status:Set(soFar, total, nAndMaxN)
					if soFar == total then
						if nAndMaxN[2] > 1 then
							TMW:Printf("%s (%d/%d)", TMW.L["SENDSUCCESSFUL"], nAndMaxN[1], nAndMaxN[2])
						else
							TMW:Print(TMW.L["SENDSUCCESSFUL"])
						end
					end
				end
	
				local import, export = {}, {}
				function self:GetAvailableImportExportTypes()
					wipe(import)
					wipe(export)
					
					-- default enabled types:
					import.profile_new = true
					import.profile_overwrite = true
					export.profile = true
					
					import.group_new = true
					-- callbacks will insert into tables as desired
					TMW:Fire("TMW_CONFIG_REQUEST_AVAILABLE_IMPORT_EXPORT_TYPES", self, import, export)
					
					return import, export
				end
				
				self.Button.Glow:SetAlpha(0)
	
				self:SetFrameLevel(self:GetParent():GetFrameLevel() + 2)
			</OnLoad>
			<OnUpdate>
				if not self.Button.Glow.Anim:IsPlaying() then
					if TMW.DoPulseReceivedComm or self.DoPulseValidString then
						self.Button.Glow.Anim:Play()
					end
				elseif not self.DoPulseValidString then
					self.Button.Glow.Anim:Finish()
				end
			</OnUpdate>
			<OnEditFocusLost>
				EditBox_ClearHighlight(self)
				TMW:CleanString(self)
				self:GetScript("OnTextChanged")(self)
			</OnEditFocusLost>
			<OnEnterPressed>
				self:ClearFocus()
				ToggleDropDownMenu(1, nil, self.DD)
			</OnEnterPressed>
			<OnTextChanged>
				local text = self:GetText()
				if text == "" then
					self.BackgroundText:SetText(self.label)
				else
					self.BackgroundText:SetText(nil)
				end
				if userInput then
					CloseDropDownMenus()

					local editboxResults = TMW.LastExportedString ~= text and TMW:DeserializeData(text)
					if editboxResults then
						self.DoPulseValidString = 1
					else
						self.DoPulseValidString = nil
					end
				end
			</OnTextChanged>
		</Scripts>
	</EditBox>


	<Frame name="TellMeWhen_SimpleDialog" hidden="true" movable="true" toplevel="true" clampedToScreen="true" enableMouse="true" frameStrata="DIALOG" parent="UIParent" virtual="true">
		<Size x="330"/>

		<!-- Enables the whole frame for dragging -->
		<TitleRegion setAllPoints="true"/>

		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="background" texturesublevel="2">
					<Color r="0.05" g="0.05" b="0.05" a="0.995"/>
				</Texture>
			</Layer>

			<Layer level="ARTWORK">
				<Texture parentKey="HeaderBackground">
					<Color r="0.13" g="0.13" b="0.13" a="1"/>
					<Anchors>
						<Anchor point="TOPLEFT" y="-4"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" y="-24"/>
					</Anchors>
				</Texture>

				<FontString name="$parentTitle" parentKey="title" inherits="GameFontNormal" justifyH="CENTER">
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.HeaderBackground" y="0"/>
					</Anchors>
				</FontString>
				<FontString name="$parentDesc" parentKey="desc" inherits="GameFontHighlight" justifyH="CENTER" justifyV="TOP">
					<Anchors>
						<Anchor point="TOP" y="-32"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
			<Frame inherits="TellMeWhen_GenericBorder">
			</Frame>

			<Button name="$parentClose" parentKey="CloseButton" inherits="UIPanelCloseButton">
				<Anchors>
					<Anchor point="CENTER" relativePoint="TOPRIGHT" x="-14" y="-14"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetFrameLevel() + 2)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						self:GetParent():Hide()
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
	</Frame>

	
	<!-- END TEMPLATES -->

	<Frame name="TellMeWhen_ConfigWarning" inherits="TellMeWhen_SimpleDialog" >
		<Anchors>
			<Anchor point="TOP" relativeTo="UIParent" y="-60"/>
		</Anchors>

		<Frames>
			<Button name="$parentNeverAgain" parentKey="NeverAgain" inherits="TellMeWhen_ButtonTemplate">
				<Size x="155" y="15"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" x="-5" y="5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["CONFIGMODE_NEVERSHOW"])
					</OnLoad>
					<OnClick>
						TMW.IE.db.global.ConfigWarning = false
						self:GetParent():Hide()
					</OnClick>
					<OnShow>
						self:SetWidth(155)
					</OnShow>
					<OnHide>
						self:SetWidth(-10)
					</OnHide>
				</Scripts>
			</Button>
			<Button name="$parentExit" parentKey="Exit" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" x="5" y="5"/>
					<Anchor point="BOTTOMRIGHT" relativeKey="$parent.NeverAgain" relativePoint="BOTTOMLEFT" x="-10" />
				</Anchors>
				<Scripts>
					<OnLoad> self:SetText(TMW.L["CONFIGMODE_EXIT"]) </OnLoad>
					<OnClick>
						TMW:LockToggle()
						TMW:Print(TMW.L["CONFIGMODE_EXITED"])
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				self.title:SetText("TellMeWhen")
				self.desc:SetText(TMW.L["CONFIGMODE"])
				self:SetScale(0.85)
				self.desc:SetWidth(self:GetWidth() - 30)
				self:SetHeight(self.desc:GetHeight() + 65)
			</OnLoad>
			<OnShow>
				TMW.IE.db.global.ConfigWarningN = TMW.IE.db.global.ConfigWarningN + 1
				if TMW.IE.db.global.ConfigWarningN > 3 then
					self.NeverAgain:Show()
				else
					self.NeverAgain:Hide()
				end
			</OnShow>
		</Scripts>
	</Frame>

	<Frame name="TellMeWhen_DBRestoredNofication" inherits="TellMeWhen_SimpleDialog" >
		<Size x="400"/>
		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent" y="50"/>
		</Anchors>

		<Frames>
			<Button name="$parentExit" parentKey="Exit" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" x="5" y="5"/>
					<Anchor point="BOTTOMRIGHT" x="-5" y="5"/>
				</Anchors>
				<Scripts>
					<OnLoad> self:SetText(OKAY) </OnLoad>
					<OnClick>self:GetParent():Hide() </OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				function self:SetTime(time)
					self.desc:SetText(TMW.L["DBRESTORED_INFO"]:format(date("%B %d, %Y @ %I:%M %p", time)))
					self.desc:SetWidth(self:GetWidth() - 30)
					self:SetHeight(self.desc:GetHeight() + 65)
				end

				self.CloseButton:Hide()
				local alert = "|TInterface\\AddOns\\TellMeWhen\\Textures\\Alert:0:2|t"
				self.title:SetText(alert .. "  TellMeWhen  " .. alert)
				self:SetScale(0.95)
			</OnLoad>
		</Scripts>
	</Frame>


	<Frame name="TellMeWhen_NoGroupsWarning" inherits="TellMeWhen_SimpleDialog" >
		<Anchors>
			<Anchor point="TOP" relativeTo="UIParent" y="-180"/>
		</Anchors>

		<Frames>
			<Button name="$parentGroupOptions" inherits="TellMeWhen_ButtonTemplate">
				<Size x="260" y="15"/>
				<Anchors>
					<Anchor point="BOTTOM" y="13"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["MAINOPTIONS_SHOW"])
					</OnLoad>
					<OnClick>
						if TMW:AssertOptionsInitialized() then
							return
						end

						LibStub("AceConfigDialog-3.0"):Open("TMWStandalone")
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				self.border:SetColor(1, 0, 0)
				self.border:SetSize(2)

				self.CloseButton:Hide()

				self.title:SetText("TellMeWhen")
				self.desc:SetText(TMW.L["NOGROUPS_DIALOG_BODY"])
				self:SetScale(0.85)
				self.desc:SetWidth(self:GetWidth() - 20)
				self:SetHeight(self.desc:GetHeight() + 80)
			</OnLoad>
		</Scripts>
	</Frame>


	<Frame name="TellMeWhen_GUIDConflictResolveDialog" inherits="TellMeWhen_SimpleDialog" >
		<Size x="500"/>

		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent" y="50"/>
			<Anchor point="TOP" relativeTo="UIParent" y="-60"/>
		</Anchors>

		<Frames>
			<Button name="$parentFirst" parentKey="First" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15"/>
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentDesc" relativePoint="BOTTOM" y="-10"/>
					<Anchor point="LEFT" x="15" />
					<Anchor point="RIGHT" x="-15" />
				</Anchors>
				<Scripts>
					<OnClick>
						self.object:GetSettings().GUID = ""
						self.object:GetGUID(true)

						self:GetParent():Hide()

						TMW:Update()
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentSecond" parentKey="Second" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentFirst" relativePoint="BOTTOMLEFT" y="-10"/>
					<Anchor point="TOPRIGHT" relativeTo="$parentFirst" relativePoint="BOTTOMRIGHT" y="-10"/>
				</Anchors>
				<Scripts>
					<OnClick>
						self.object:GetSettings().GUID = ""
						self.object:GetGUID(true)

						self:GetParent():Hide()

						TMW:Update()
					</OnClick>
				</Scripts>
			</Button>
		</Frames>

		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentDesc2" parentKey="desc2" inherits="GameFontHighlight" justifyH="CENTER" justifyV="TOP">
					<Anchors>
						<Anchor point="TOP" relativeTo="$parentSecond" relativePoint="BOTTOM" y="-20"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
			<Button name="$parentIgnoreForSession" parentKey="IgnoreForSession" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15"/>
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentDesc2" relativePoint="BOTTOM" y="-10"/>
					<Anchor point="LEFT" x="15" />
					<Anchor point="RIGHT" x="-15" />
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["GUIDCONFLICT_IGNOREFORSESSION"])
						TMW:TT(self, "GUIDCONFLICT_IGNOREFORSESSION")
					</OnLoad>
					<OnClick>
						self:GetParent():Ignore(self:GetParent().GUID)
						self:GetParent():Hide()

						-- Update to load in another conflict if there is one.
						TMW:Update()
					</OnClick>
				</Scripts>
			</Button>
		</Frames>

		<Scripts>
			<OnLoad>
				self.CloseButton:Hide()

				self.border:SetColor(1, 0, 0)
				self.border:SetSize(5)

				local ignoredForSession = {}

				function self:Ignore(GUID)
					ignoredForSession[GUID] = true
				end
				function self:IsIgnored(GUID)
					return ignoredForSession[GUID]
				end



				self.title:SetText("TellMeWhen")

				self.desc:SetText(TMW.L["GUIDCONFLICT_DESC_PART1"])
				self.desc2:SetText(TMW.L["GUIDCONFLICT_DESC_PART2"])

				self.desc:SetWidth(self:GetWidth() - 30)
				self.desc2:SetWidth(self:GetWidth() - 30)

				self:SetScale(0.85)
				self:SetHeight(self.desc:GetHeight() + self.desc2:GetHeight() + 140)

				TMW:RegisterCallback("TMW_LOCK_TOGGLED", function(locked)
					wipe(ignoredForSession)
				end)

				TMW:RegisterCallback("TMW_GLOBAL_UPDATE", function()
					self:Hide()
				end)
			</OnLoad>
		</Scripts>
	</Frame>


	<Frame name="TellMeWhen_ConfirmImportedLuaDialog" inherits="TellMeWhen_SimpleDialog" toplevel="true" frameStrata="FULLSCREEN_DIALOG">
		<Size x="500" y="500"/>

		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent" />
			<Anchor point="TOP" relativeTo="UIParent" y="-60"/>
		</Anchors>

		<Frames>
			<Frame name="$parentScrollContainer" parentKey="ScrollContainer">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentDesc" relativePoint="BOTTOM" y="-15"/>
					<Anchor point="LEFT" x="15" />
					<Anchor point="BOTTOMRIGHT" x="-15" y="36"/>
				</Anchors>

				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentCode" parentKey="Code" inherits="GameFontHighlight" justifyH="LEFT" justifyV="TOP" >
							<Size x="1" y="0"/>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>

				<Scripts>
					<OnLoad>
						TMW:ConvertContainerToScrollFrame(self, false, 0, 10)
						self.ScrollFrame.scrollStep = 25
						self.Code:SetWidth(self:GetWidth()-15)
						self.Code:SetNonSpaceWrap(1)
						self.Code:SetSpacing(2)
					</OnLoad>
				</Scripts>
			</Frame>

			<!-- border dummy-->
			<Frame>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentScrollContainerScrollFrame" x="-5" y="5"/>
					<Anchor point="BOTTOMRIGHT" relativeTo="$parentScrollContainerScrollFrame" x="5" y="-5"/>
				</Anchors>

				<Scripts>
					<OnLoad>
						self:SetBackdrop({
							edgeFile = "Interface\\Tooltips\\UI-Tooltip-Background",
							tile = true,
							edgeSize = 3,
						})
						self:SetBackdropBorderColor(0, .82, 1, 1)
					</OnLoad>
				</Scripts>
			</Frame>

			<Button name="$parentDeny" parentKey="Deny" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15" x="215"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" x="10" y="10"/>
				</Anchors>
				<Scripts>
					<OnClick>
						self:GetParent():Hide()
						TMW:Print(TMW.L["IMPORT_FAILED"])
					</OnClick>
				</Scripts>
			</Button>

			<Button name="$parentConfirm" parentKey="Confirm" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15" x="215"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" x="-10" y="10"/>
				</Anchors>
				<Scripts>
					<OnClick>
						self:GetParent():LoadNext()
					</OnClick>
				</Scripts>
			</Button>
		</Frames>

		<Scripts>
			<OnLoad>
				self.border:SetColor(1, 1, 0)
				self.CloseButton:Hide()

				self.title:SetText("TellMeWhen")

				self.desc:SetText(TMW.L["IMPORT_LUA_DESC"])
				self.desc:SetWidth(self:GetWidth() - 30)

				self.Confirm:SetText(TMW.L["IMPORT_LUA_CONFIRM"])
				self.Deny:SetText(TMW.L["IMPORT_LUA_DENY"])

				self:SetScale(0.95)

				local flags = {
					"sendmail", "accepttrade", "guildcontrol", "guilddisband", "guildpromote",
					"money", "gold", "trade", "mail", "guild", "bank", "withdraw", "deposit",
				}

				local currentItem, currentDetections, completionOperation

				function self:StartConfirmations(settingsItem, luaDetections, callArgsAfterSuccess)
					self:Show()
					self.currentResult = 0
					currentItem, currentDetections, completionOperation = settingsItem, luaDetections, callArgsAfterSuccess
					self:LoadNext()
				end

				function self:LoadNext()
					if #currentDetections > self.currentResult then
						self.currentResult = self.currentResult + 1

						local code = currentDetections[self.currentResult].code
						local codeLower = code:lower()
						local flagged

						for k, flagWord in pairs(flags) do
							local start = 0
							repeat
								local replaced
								local left, right = strfind(codeLower, flagWord, start)
								if left then

									code = code:sub(0, left-1) .. "|cffff0000" .. code:sub(left, right) .. "|r" .. code:sub(right+1)
									codeLower = code:lower()
									replaced = true
									flagged = true
									start = right + 12
								end
							until not replaced
						end

						self.ScrollContainer.Code:SetText(code)

						local desc = TMW.L["IMPORT_LUA_DESC"]
						if flagged then
							desc = desc .. "\r\n\r\n|cFFFF3939" .. TMW.L["IMPORT_LUA_DESC2"] .. "|r"
						end

						desc = desc .. "\r\n\r\n" .. (currentDetections[self.currentResult].name or "")

						if currentItem.ImportSource.type == "Comm" then
							desc = desc .. " " .. FROM .. " " .. currentItem:GetExtra("SourcePlayer")
						elseif currentItem.ImportSource.type == "String" then
							desc = desc .. " " .. TMW.L["IMPORT_FROMSTRING"]
						end

						self.desc:SetText(desc)
					else
						self:Hide()
						TMW.safecall(unpack(completionOperation))
					end
				end

			</OnLoad>
		</Scripts>
	</Frame>


	<Frame name="TellMeWhen_ChangelogDialog" inherits="TellMeWhen_SimpleDialog" toplevel="true" frameStrata="FULLSCREEN_DIALOG" hidden="true">
		<Size x="600" y="650"/>

		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent" />
			<Anchor point="TOP" relativeTo="UIParent" y="-60"/>
		</Anchors>

		<Frames>

			<Button name="$parentOkay" parentKey="Okay" inherits="TellMeWhen_ButtonTemplate">
				<Size y="15" x="1"/>
				<Anchors>
					<Anchor point="LEFT" x="5"/>
					<Anchor point="RIGHT" x="-5"/>
					<Anchor point="BOTTOM" y="5"/>
				</Anchors>
				<Scripts>
					<OnClick>
						self:GetParent():Hide()
					</OnClick>
				</Scripts>
			</Button>

			<Frame name="$parentScrollContainer" parentKey="ScrollContainer">
				<Anchors>
					<Anchor point="TOP" relativeKey="$parent.HeaderBackground" relativePoint="BOTTOM" y="-5"/>
					<Anchor point="BOTTOM" relativeTo="$parentOkay" relativePoint="TOP" y="5"/>
					<Anchor point="LEFT" x="8" />
					<Anchor point="RIGHT" x="-5" />
				</Anchors>

				<Scripts>
					<OnLoad>
						TMW:ConvertContainerToScrollFrame(self, false, 0, 10)
						self.ScrollFrame.scrollStep = 25

						local s = ""

						local CHANGELOGS = {}

						if not TMW.CHANGELOG then
							TMW:Print("There was an error loading TMW's changelog data.")
						end


						-- Turns wikicreole bulletpoints (asterisks) into prettyness
						for k, v in pairs(TMW.CHANGELOG) do
							
							v = v:trim()
							
							while v:find("^ *%*") do
								v = v:gsub("%*", "   ", 1)
							end
							
							v = v:gsub("IMPORTANT", "|cffff0000IMPORTANT|r")
							
							if v:match("====(.*)====") then
								v = v:gsub("====(.*)====", "|cff00d1ff%1|r")

							elseif v:match("===(v.*)===") then
								tinsert(CHANGELOGS, s:trim("\r\n "))
								s = ""
								
								v = "|cFFF6682FTellMeWhen " .. v:match("===(v.*)===") .. "|r:"
							elseif v ~= "" then
								v = v:gsub("^    ", "", 1)
								
								local _, spaceCount = v:find("^( *)")
								local numIndents = ((spaceCount + 3) / 3) % 3
								
								local color, c2 = "", ""
								if numIndents == 1 then
									color, c2 = "4FD678", "acecbf"
								elseif numIndents == 2 then
									color, c2 = "4F69D6", "acb9ec"
								elseif numIndents == 0 then
									color, c2 = "D64FAD", "ecacd9"
								end
								
								c2 = "ffffff"
								v = v:gsub("^( *)(.*)", "%1 |cFF" .. color .. "> |cff" .. c2 .. "%2")
								
							end
							
							s = s .. v .. "\r\n"
						end

						-- The first one is nothing. Get rid of it.
						tremove(CHANGELOGS, 1)

						-- Put the last one in
						tinsert(CHANGELOGS, s:trim("\r\n "))
						tinsert(CHANGELOGS, "\r\n\r\nTo see the changelog for older versions, open CHANGELOG.txt in Interface/AddOns/TellMeWhen or visit TellMeWhen's AddOn page on Curse.com")

						-- Send this out to the garbage collector
						TMW.CHANGELOG = nil

						for k, v in pairs(CHANGELOGS) do
							local log = self:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
							
							log:SetJustifyH("LEFT")
							log:SetJustifyV("TOP")
							log:SetSpacing(2)
							log:SetText(v)
							
							--local font, size = log:GetFont()
							--log:SetFont(font, size, "THINOUTLINE")

							self[#self + 1] = log

							if #self == 1 then
								log:SetPoint("TOPLEFT", 0, -5)
							else
								log:SetPoint("TOPLEFT", self[#self - 1], "BOTTOMLEFT", 0, -15)
							end

							--log:SetSize(0, 1)
							log:SetWidth(self:GetWidth()-15)

							-- Don't set the height here. It will be set in the OnShow script.
							--log:SetHeight(log:GetStringHeight() + 20)
						end


					</OnLoad>
					<OnShow>
						if not self.FixedWrapping and not InCombatLockdown() then
							for k, log in ipairs(self) do

								-- Because of wrapping issues, we usually don't get the height that
								-- we want the first time that we set the height (when we change the height,
								-- the number of lines will probably change as more lines are given enough room to wrap).

								-- To get around this, we might keep trying until we get the right height.
								-- Unforunately, this is horribly slow (this used to be the way this was done)
								-- because log:GetHeight() and log:GetStringHeight() are stupidly slow.

								-- Fortunately, the stupid solution is also stupid fast: Make the FontString super tall
								-- and then shrink it down to the correct size. log:SetHeight() is stupidly fast, even though
								-- it has to actually re-render things. I don't really understand why it is so fast compared to
								-- :GetStringHeight() and :GetHeight(), but i'll take it.
								
								log:SetHeight(100000)
								log:SetHeight(log:GetStringHeight() + 20)
									
							end
							self.FixedWrapping = true
						end
					</OnShow>
					<OnSizeChanged>
						for k, log in ipairs(self) do

							-- Because of wrapping issues, we usually don't get the height that
							-- we want the first time that we set the height (when we change the height,
							-- the number of lines will probably change as more lines are given enough room to wrap).

							-- To get around this, we might keep trying until we get the right height.
							-- Unforunately, this is horribly slow (this used to be the way this was done)
							-- because log:GetHeight() and log:GetStringHeight() are stupidly slow.

							-- Fortunately, the stupid solution is also stupid fast: Make the FontString super tall
							-- and then shrink it down to the correct size. log:SetHeight() is stupidly fast, even though
							-- it has to actually re-render things. I don't really understand why it is so fast compared to
							-- :GetStringHeight() and :GetHeight(), but i'll take it.

							log:SetWidth(self:GetWidth()-15)
							log:SetHeight(100000)
							log:SetHeight(log:GetStringHeight() + 20)
								
						end
					</OnSizeChanged>
				</Scripts>
			</Frame>
		</Frames>

		<Scripts>

			<OnLoad>
				self.title:SetText(TMW.L["DIALOG_HEADER_CHANGELOG"])

				self:SetScale(1)

				TMW:RegisterCallback("TMW_OPTIONS_LOADED", function()
					self.resizer = TMW.Classes.Resizer_Generic:New(self)
					self.resizer:Show()

					self.resizer:SetModes(self.resizer.MODE_SIZE, self.resizer.MODE_SIZE)
					self.resizer.scale_min = 0.4
					self.resizer.x_min = 280
					self.resizer.x_max = function() return UIParent:GetWidth()*0.8 end
					self.resizer.y_min = 200
					self.resizer.y_max = function() return UIParent:GetHeight()*0.9 end
				end)

				self.background:SetAlpha(0.95)


				tinsert(UISpecialFrames, self:GetName())

			</OnLoad>
			<OnShow>
				if self.showIEOnClose then
					self.Okay:SetText(TMW.L["CHANGELOG_OKAY_OPENIE"])
				else
					self.Okay:SetText(OKAY)
				end
			</OnShow>
			<OnHide>
				TMW.HELP:Hide("CHANGELOG_INFO")

				if self.showIEOnClose then
					self.showIEOnClose = false
					TMW.IE:Load()
				end
			</OnHide>
		</Scripts>
	</Frame>


	<Frame name="TellMeWhen_IconEditor" hidden="true" movable="true" clampedToScreen="true" enableMouse="true" enableKeyboard="true" propagateKeyboardInput="true" frameStrata="DIALOG" inherits="TellMeWhen_SimpleDialog">
		<Size x="585" y="380"/>
		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent"/>
			<Anchor point="TOP" relativeTo="UIParent" y="-60"/>
		</Anchors>
		
		<Layers>
			<Layer level="OVERLAY">
				<Texture name="$parentIconTexture" parentKey="icontexture">
					<TexCoords left="0.07" right="0.93" top="0.07" bottom="0.93"/>
					<Size x="18" y="18"/>
					<Anchors>
						<Anchor point="TOPLEFT" x="5" y="-5"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		
		<Frames>
			
			<Frame name="$parentMain" parentKey="Main" hidden="true">
				<Anchors>
					<Anchor point="TOPLEFT" y="-23"/>
					<Anchor point="BOTTOMRIGHT" y="26"/>
				</Anchors>
				
				<Frames>
					
					<Frame name="$parentPanelsLeft" parentKey="PanelsLeft">
						<Anchors>
							<Anchor point="LEFT" x="7"/>
							<Anchor point="TOP" y="-35"/>
							<Anchor point="BOTTOM" y="3"/>
							<Anchor point="RIGHT" relativePoint="TOP" x="-6"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								TMW:ConvertContainerToScrollFrame(self, true, 1, 5)
								self.ScrollFrame.scrollPercentage = 1/3
							</OnLoad>
						</Scripts>
					</Frame>
					
					<Frame name="$parentPanelsRight" parentKey="PanelsRight">
						<Anchors>
							<Anchor point="LEFT" relativePoint="TOP" x="5"/>
							<Anchor point="TOP" y="-35"/>
							<Anchor point="BOTTOM" y="3"/>
							<Anchor point="RIGHT" x="-9"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								TMW:ConvertContainerToScrollFrame(self, true, 1, 5)
								self.ScrollFrame.scrollPercentage = 1/3
							</OnLoad>
						</Scripts>
					</Frame>
				
					<Frame name="$parentType" inherits="TMW_DropDownMenuTemplate" parentKey="Type">
						<Anchors>
							<Anchor point="TOP" y="-6"/>
							<Anchor point="LEFT" relativeTo="$parentPanelsLeft" x="7" />
							<Anchor point="RIGHT" relativeTo="$parentPanelsLeft" x="-7" />
						</Anchors>
						<Scripts>
							<OnLoad>
								TMW:CInit(self, {
									title = function()
										return TMW.Types[TMW.CI.ics.Type].name
									end,
									tooltip = function()
										return TMW.Types[TMW.CI.ics.Type].desc
									end,
									func = TMW.IE.Type_DropDown,
								})

								self.Button:HookScript("OnClick", function(self)
									TMW.IE:SaveSettings()
								end)
							</OnLoad>
						</Scripts>
					</Frame>
					
					<CheckButton name="$parentEnabled" inherits="TellMeWhen_CheckTemplate" parentKey="Enabled">
						<Anchors>
							<Anchor point="TOP" relativeKey="$parent.$parent.HeaderBackground" relativePoint="BOTTOM" x="0" y="-3"/>
							<Anchor point="LEFT" relativeKey="$parent.PanelsRight" relativePoint="LEFT" />
						</Anchors>
						<Scripts>
							<OnLoad>
								TMW:CInit(self, {
									setting = "Enabled",
									title = TMW.L["ICONMENU_ENABLE"],
									tooltip = TMW.L["ICONMENU_ENABLE_DESC"],
								})
							</OnLoad>
						</Scripts>
					</CheckButton>

					<CheckButton name="$parentGroupController" inherits="TellMeWhen_CheckTemplate" parentKey="GroupController">
						<Anchors>
							<Anchor point="TOP" relativeKey="$parent.Enabled" relativePoint="TOP"/>
							<Anchor point="LEFT" relativeKey="$parent.PanelsRight" relativePoint="CENTER" x="-15" />
						</Anchors>
						<Scripts>
							<OnLoad>
								TMW:CInit(self, {
									setting = "Controlled",
									title = TMW.L["ICONMENU_CTRLGROUP"],
									tooltip = TMW.L["ICONMENU_CTRLGROUP_DESC"],
									disabledtooltip = TMW.L["ICONMENU_CTRLGROUP_UNAVAILABLE_DESC"],
									disabled = function(self)
										return not TMW.CI.icon.typeData.canControlGroup
									end,
									hidden = function(self)
										return TMW.CI.icon.ID ~= 1
									end,
									OnClick = function(self)
										TMW.CI.group:Setup()
										TMW.IE:Load(1)
									end,
								})
								function self:GetSettingTable()
									return TMW.CI.group and TMW.CI.group:GetSettings()
								end

								self:ConstrainLabel(self:GetParent(), "RIGHT")
							</OnLoad>
						</Scripts>
					</CheckButton>
					
				</Frames>
				<Scripts>
					<OnLoad>
						self:RegisterForDrag("LeftButton")
					</OnLoad>
					<OnReceiveDrag>
						TMW.IE:SpellItemToIcon(TMW.CI.icon)
					</OnReceiveDrag>
					<OnMouseUp>
						TMW.IE:SpellItemToIcon(TMW.CI.icon)
					</OnMouseUp>
					<OnDragStart>
						TMW.IE:StartMoving()
					</OnDragStart>
					<OnDragStop>
						TMW.IE:StopMovingOrSizing()
					</OnDragStop>
				</Scripts>
			</Frame>

			<Frame name="$parentNotLoadedMessage" parentKey="NotLoadedMessage" hidden="true">
				<Anchors>
					<Anchor point="TOPLEFT" y="-23"/>
					<Anchor point="BOTTOMRIGHT" y="26"/>
				</Anchors>
				
				<Frames>
					<Frame name="$parentMessage" inherits="TellMeWhen_BorderedFrame" parentKey="Message">
						<Size y="1"/>
						<Anchors>
							<Anchor point="TOP" y="-35"/>
							<Anchor point="LEFT" x="15" />
							<Anchor point="RIGHT" x="-15" />

						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<FontString name="$parentText" parentKey="text" wordwrap="true" inherits="GameFontHighlight">
									<Anchors>
										<Anchor point="TOP" y="-10"/>
									</Anchors>
								</FontString>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								self.text:SetText(TMW.L["IE_NOLOADED"])
								
								self.text:SetWidth(self:GetWidth() - 25)
								self:SetHeight(self.text:GetStringHeight() + 22)
							</OnLoad>
							<OnSizeChanged>
								self:SetHeight(self.text:GetStringHeight() + 22)
							</OnSizeChanged>
						</Scripts>
					</Frame>
				</Frames>

				<Scripts>
					<OnLoad>
						self:RegisterForDrag("LeftButton")
					</OnLoad>
					<OnDragStart>
						TMW.IE:StartMoving()
					</OnDragStart>
					<OnDragStop>
						TMW.IE:StopMovingOrSizing()
					</OnDragStop>
				</Scripts>
			</Frame>
			
			<Frame name="$parentMainOptions" hidden="true" setAllPoints="true" parentKey="MainOptions" >
				<Frames>
					<Frame parentKey="content">
						<Anchors>
							<Anchor point="TOPLEFT" x="6" y="-34"/>
							<Anchor point="BOTTOMRIGHT" x="-6" y="34"/>
						</Anchors>
					</Frame>
					<CheckButton parentKey="SimpleGSTab" inherits="TellMeWhen_CheckTemplate" parent="TellMeWhen_IconEditor" hidden="true">
						<!-- parented to the icon editor so that the scale of this frame doesn't screw it up. -->
						<Anchors>
							<Anchor point="TOPLEFT" x="0"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								TMW:CInit(self, {
									setting = "SimpleGSTab",
									invert = true,
									title = TMW.L["IE_SIMPLEGS"],
									tooltip = TMW.L["IE_SIMPLEGS_DESC"],
									OnClick = function()
										TMW.HELP:Hide("SIMPLEGSTAB")
										TMW.IE.MainOptionsTab:ClickHandler()
										TMW.IE.MainOptionsTab:OnClick()
									end,
								})

								function self:GetSettingTable()
									return TMW.IE.db.global
								end
							</OnLoad>
							<OnShow>
								TMW.HELP:Show{
									code = "SIMPLEGSTAB",
									codeOrder = 1,
									codeOnlyOnce = true,
									icon = nil,
									relativeTo = self,
									x = 0,
									y = 0,
									text = format(TMW.L["HELP_SIMPLEGSTAB"])
								}
							</OnShow>
							<OnHide>
								TMW.HELP:Hide("SIMPLEGSTAB")
							</OnHide>
						</Scripts>
					</CheckButton>
				</Frames>
				<Scripts>
					<OnLoad>
						local AceGUI = LibStub("AceGUI-3.0", true)
						local Type, Version = "TMWIEGroupOptions", 1

						local widget = {
							localstatus = {},
							content		= self.content,
							frame		= self,
							type		= Type,

							OnAcquire = function(self)
								TMW.IE.MainOptionsWidget = self
								self.frame:SetParent(TMW.IE)
								self.frame:SetAllPoints()
								self.frame:Show()
							end,
							OnRelease = function(self)
								TMW.IE.MainOptionsWidget = nil
								self.status = nil
								wipe(self.localstatus)
							end,
							Hide = function(self)
								self.frame:Hide()
							end,
							Show = function(self)
								self.frame:Show()
							end,
							ApplyStatus = function() end,
							SetTitle = function() end,
							SetStatusTable = function(self, status)
								assert(type(status) == "table")
								self.status = status
							end,
						}
						
						widget.content.obj = widget
						self.obj = widget

						local constructed
						local function Constructor()
							if constructed then
								error("TellMeWhen: Second construction for options container widget occurred! Why did this happen, ahhhh!")
							end
							constructed = 1
							return AceGUI:RegisterAsContainer(widget)
						end
						AceGUI:RegisterWidgetType(Type, Constructor, Version)
					</OnLoad>
					<OnShow>
						if not TMW.IE.MainOptionsWidget then
							LibStub("AceGUI-3.0", true):Create("TMWIEGroupOptions")
						end
					</OnShow>
					<OnHide>
						--[[if TMW.IE.MainOptionsWidget then -- WARNING WARNING WARNING - CAUSES ERROR 132 CRASHES
							LibStub("AceGUI-3.0", true):Release(TMW.IE.MainOptionsWidget)
						end]]

						TMW.IE.MainOptionsWidget:ReleaseChildren() -- safer
					</OnHide>
				</Scripts>
			</Frame>

			<Button name="$parentOkay" parentKey="OkayButton" inherits="TellMeWhen_ButtonTemplate" text="OKAY">
				<Size x="60" y="15"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" x="-7" y="6"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent():GetFrameLevel()+4)
						self:SetWidth(self:GetTextWidth()+15)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						self:GetParent():Hide()
					</OnClick>
				</Scripts>
			</Button>

			<Button name="$parentReset" parentKey="ResetButton" inherits="TellMeWhen_ButtonTemplate" text="RESET">
				<Size x="100" y="15"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" x="7" y="6"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["RESET_ICON"])
						TMW:TT(self, "RESET_ICON", "RESET_ICON_DESC")

						self:SetWidth(self:GetTextWidth()+15)

						self:SetFrameLevel(self:GetFrameLevel()+2)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						TMW.IE:Reset()
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentUndo" parentKey="UndoButton" inherits="TellMeWhen_ButtonTemplate" >
				<Size x="100" y="15"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentReset" relativePoint="RIGHT" x="5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["UNDO_ICON"])

						local textfunc = function()
							local ret = TMW.L["UNDO_ICON_DESC"]
							local binding = GetBindingKey("TELLMEWHEN_ICONEDITOR_UNDO")
							if binding then
								ret = ret .. "\r\n\r\n(|cff7fffff" .. binding .. "|r)"
							end
							return ret
						end
						TMW:TT(self, "UNDO_ICON", textfunc, nil, 1)

						self:SetWidth(self:GetTextWidth()+15)
						self:SetFrameLevel(self:GetFrameLevel()+2)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						TMW.IE:DoUndoRedo(-1)
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentRedo" parentKey="RedoButton" inherits="TellMeWhen_ButtonTemplate" >
				<Size x="100" y="15"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentUndo" relativePoint="RIGHT" x="2"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["REDO_ICON"])

						local textfunc = function()
							local ret = TMW.L["REDO_ICON_DESC"]
							local binding = GetBindingKey("TELLMEWHEN_ICONEDITOR_REDO")
							if binding then
								ret = ret .. "\r\n\r\n(|cff7fffff" .. binding .. "|r)"
							end
							return ret
						end
						TMW:TT(self, "REDO_ICON", textfunc, nil, 1)

						self:SetWidth(self:GetTextWidth()+15)
						self:SetFrameLevel(self:GetFrameLevel()+2)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						TMW.IE:DoUndoRedo(1)
					</OnClick>
				</Scripts>
			</Button>

			<Button name="$parentBackButton" parentKey="BackButton" >
				<Size x="18" y="18"/>
				<Anchors>
					<Anchor point="TOP" y="-10"/>
					<Anchor point="LEFT" relativeKey="$parent.icontexture" relativePoint="RIGHT" x="10" />
				</Anchors>
				<HitRectInsets left="-2" right="-2" top="-2" bottom="-2" />
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["BACK_IE"])
						local desc = function()
							local icon = TMW.IE.history[TMW.IE.historyState - 1]

							return TMW.L["BACK_IE_DESC"]:format(icon:GetIconName(), icon.attributes.texture)
						end
						TMW:TT(self, "BACK_IE", desc, nil, 1)

						self:SetFrameLevel(self:GetFrameLevel()+2)
						self:GetNormalTexture():SetTexCoord(0.6875, 0.34375, 0.21875, 0.34375, 0.6875, 0.65625, 0.21875, 0.65625)
						self:GetHighlightTexture():SetTexCoord(0.6875, 0.34375, 0.21875, 0.34375, 0.6875, 0.65625, 0.21875, 0.65625)
						self:GetDisabledTexture():SetTexCoord(0.6875, 0.34375, 0.21875, 0.34375, 0.6875, 0.65625, 0.21875, 0.65625)
						self:SetScale(0.8)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						TMW.IE:DoBackForwards(-1)
						TMW:TT_Update(self)
					</OnClick>
					<OnEnable>
						self:SetAlpha(1)
					</OnEnable>
					<OnDisable>
						self:SetAlpha(0.3)
					</OnDisable>
				</Scripts>

				<NormalTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up" alphaMode="ADD">
					<Color r=".7" g=".7" b=".7" a="1"/>
				</NormalTexture>
				<HighlightTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up" alphaMode="ADD"/>
				<DisabledTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Disabled" alphaMode="ADD"/>
			</Button>
			<Button name="$parentForwardsButton" parentKey="ForwardsButton" >
				<Size x="18" y="18"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentBackButton" relativePoint="RIGHT" x="5"/>
				</Anchors>
				<HitRectInsets left="-2" right="-2" top="-2" bottom="-2" />
				<Scripts>
					<OnLoad>
						self:SetText(TMW.L["FORWARDS_IE"])
						local desc = function()
							local icon = TMW.IE.history[TMW.IE.historyState + 1]
							
							return TMW.L["FORWARDS_IE_DESC"]:format(icon:GetIconName(), icon.attributes.texture)
						end
						TMW:TT(self, "FORWARDS_IE", desc, nil, 1)

						self:SetFrameLevel(self:GetFrameLevel()+2)

						self:GetNormalTexture():SetTexCoord(0.6875, 0.65625, 0.21875, 0.65625, 0.6875, 0.34375, 0.21875, 0.34375)
						self:GetHighlightTexture():SetTexCoord(0.6875, 0.65625, 0.21875, 0.65625, 0.6875, 0.34375, 0.21875, 0.34375)
						self:GetDisabledTexture():SetTexCoord(0.6875, 0.65625, 0.21875, 0.65625, 0.6875, 0.34375, 0.21875, 0.34375)
						self:SetScale(0.8)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						TMW.IE:DoBackForwards(1)
						TMW:TT_Update(self)
					</OnClick>
					<OnEnable>
						self:SetAlpha(1)
					</OnEnable>
					<OnDisable>
						self:SetAlpha(0.3)
					</OnDisable>
				</Scripts>

				<NormalTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up" alphaMode="ADD">
					<Color r=".7" g=".7" b=".7" a="1"/>
				</NormalTexture>
				<HighlightTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up" alphaMode="ADD"/>
				<DisabledTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Disabled" alphaMode="ADD"/>
			</Button>


			<EditBox name="$parentExportBox" inherits="TellMeWhen_ExportBoxTemplate" parentKey="ExportBox">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentRedo" relativePoint="RIGHT" x="10" y="1"/>
					<Anchor point="RIGHT" relativeTo="$parentOkay" relativePoint="LEFT" x="-10" y="1"/>
				</Anchors>
			</EditBox>

		</Frames>
		<Layers>
			<Layer level="OVERLAY">
				<FontString name="$parentHeader" parentKey="Header" inherits="GameFontNormal" justifyH="CENTER">
					<Anchors>
						<Anchor point="TOP" y="-8"/>
						<Anchor point="LEFT" relativeTo="$parentForwardsButton" relativePoint="RIGHT" x="4"/>
						<Anchor point="RIGHT" relativeTo="$parentClose" relativePoint="LEFT"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self:SetFrameLevel(20)
				
				for k, v in pairs(self) do
					TMW.IE[k] = v
				end
				
				-- Needs to go before TellMeWhen_ChangelogDialog or else it will get hidden immediately after the changelog hides.
				tinsert(UISpecialFrames, 1, self:GetName())
			</OnLoad>
			<OnSizeChanged>
				--self.Help:SetHeight(self.Help.text:GetHeight() + 38)
			</OnSizeChanged>
			<OnDragStart>
				TMW.IE:StartMoving()
			</OnDragStart>
			<OnDragStop>
				TMW.IE:StopMovingOrSizing()
			</OnDragStop>
		</Scripts>
	</Frame>

</Ui>




