<Ui>

	<Frame name="TellMeWhen_OptionsModuleContainer" virtual="true" hidden="true">
		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_Panel"/>
		</KeyValues>

		<Anchors>
			<Anchor point="LEFT" x="0"/>
			<Anchor point="RIGHT" />
		</Anchors>

		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" setAllPoints="true"/>
			</Layer>
			<Layer level="OVERLAY">
				<FontString parentKey="Header" wordwrap="false" inherits="GameFontNormal" 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_IE_PageTemplate" parent="TellMeWhen_IconEditorPages" enableMouse="false" virtual="true" hidden="true" setAllPoints="true">
		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_Page"/>
		</KeyValues>
		<Scripts>
			<OnLoad>
				TMW:CInit(self)
			</OnLoad>
		</Scripts>
	</Frame>


	<!-- TEMPLATES -->

	<ScrollFrame name="TellMeWhen_ScrollFrameTemplate" virtual="true">
		<Frames>
			<Frame parentKey="ScrollBar" hidden="true">
				<Size x="10"/>
				<Anchors>
					<Anchor point="TOP"/>
					<Anchor point="BOTTOM"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="Backdrop" setAllPoints="true" >
							<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 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>
							<OnHide>
								self:GetScript("OnDragStop")(self)
							</OnHide>
							<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>


	<Button name="TellMeWhen_ClickInterceptor" virtual="true" 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>

	<CheckButton name="TellMeWhen_CheckTemplate" virtual="true">
		<Size x="30" y="30"/>

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_CheckButton"/>
		</KeyValues>

        <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 inherits="TellMeWhen_ClickInterceptor"/>
		</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_GradientFrame" virtual="true">
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" setAllPoints="true">
					<Color r="0.9" g="0.9" b="0.9" 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>

	<CheckButton name="TellMeWhen_FlatFrame" virtual="true">
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" setAllPoints="true">
					<Color r="0.66" g="0.66" b="0.66" a="0.09"/>
				</Texture>
			</Layer>
		</Layers>

		<HighlightTexture alphaMode="ADD" alpha="0.09" setAllPoints="true">
			<Color r="1" g="1" b="1"/>
		</HighlightTexture>
		<CheckedTexture alphaMode="ADD" alpha="0.18" setAllPoints="true">
			<Color r="1" g="1" b="1"/>
		</CheckedTexture>
	</CheckButton>

	
	<EditBox name="TellMeWhen_InputBoxTemplate" enableMouse="true" virtual="true" autoFocus="false">
		<Size y="15"/>

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_EditBox"/>
		</KeyValues>

		<HitRectInsets left="-1" right="-1" top="-1" bottom="-1" />
		<TextInsets>
			<AbsInset left="4" right="2" top="2" bottom="2"/>
		</TextInsets>
		<Frames>
			<Frame inherits="TellMeWhen_GenericBorder" >
				<Scripts>
					<OnLoad inherit="prepend">
						self:SetBorderSize(-1)
						self:SetColor(.4, .4, .4, 1)
					</OnLoad>
				</Scripts>
			</Frame>
		</Frames>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="background" setAllPoints="true">
					<Color r="0" g="0" b="0" a="1"/>
				</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>
		<FontString inherits="GameFontHighlight"/>
	</EditBox>

	<Button name="TellMeWhen_ButtonTemplate" virtual="true">
		<Size x="144" y="15"/>

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_Button"/>
		</KeyValues>

		<NormalFont style="GameFontNormal"/>
		<HighlightFont style="GameFontHighlight"/>
		<DisabledFont style="GameFontDisable"/>

		<Frames>
			<Frame inherits="TellMeWhen_GenericBorder" >
				<Scripts>
					<OnLoad inherit="prepend">
						self:SetBorderSize(-1)
						self:SetColor(.4, .4, .4, 1)
					</OnLoad>
				</Scripts>
			</Frame>
		</Frames>

		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" setAllPoints="true">
					<Color r="0.15" g="0.15" b="0.15" a="0.5"/>
				</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"/>

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_TimeEditBox"/>
		</KeyValues>

		<Layers>
			<Layer level="ARTWORK">
				<FontString parentKey="text" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Anchors>
						<Anchor point="BOTTOM" relativePoint="TOP" y="2"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
	</EditBox>

	<Frame name="TellMeWhen_EditBoxWithCheckTemplateBase" virtual="true">
		<Size x="80" y="33"/>
		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_EditBoxWithCheck"/>
		</KeyValues>

		<Layers>
			<Layer level="ARTWORK">
				<FontString parentKey="text" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Anchors>
						<Anchor point="TOPLEFT" X="4" />
						<Anchor point="RIGHT" />
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
			<CheckButton parentKey="EnableCheck" inherits="TellMeWhen_CheckTemplate">
				<Size x="26" y="26"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
					</OnLoad>
				</Scripts>
			</CheckButton>
		</Frames>
	</Frame>

	<Frame name="TellMeWhen_EditBoxWithCheckTemplate" inherits="TellMeWhen_EditBoxWithCheckTemplateBase" virtual="true">
		<Frames>
			<EditBox parentKey="Duration" inherits="TellMeWhen_InputBoxTemplate">
				<Size y="16"/>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.EnableCheck" relativePoint="RIGHT" x="0"/>
					<Anchor point="RIGHT" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)

						self:CScriptAdd("ModifyValueForSave", function(self, value)
							return tonumber(value) or 0
						end)
					</OnLoad>
				</Scripts>

			</EditBox>
		</Frames>
	</Frame>

	<Frame name="TellMeWhen_TimeEditBoxWithCheckTemplate" inherits="TellMeWhen_EditBoxWithCheckTemplateBase" virtual="true">
		<Frames>
			<EditBox parentKey="Duration" inherits="TellMeWhen_TimeEditBoxTemplate">
				<Size y="16"/>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.EnableCheck" relativePoint="RIGHT" x="0"/>
					<Anchor point="RIGHT" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
					</OnLoad>
				</Scripts>

			</EditBox>
		</Frames>
	</Frame>

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

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_Slider"/>
		</KeyValues>

		<HitRectInsets left="0" right="0" top="-2" bottom="-3" />

		<ThumbTexture parentKey="thumb">
			<Size x="14" y="20"/>
		</ThumbTexture>

		<Layers>
			<Layer level="ARTWORK">
				<Texture parentKey="Background" >
					<Size y="10"/>
					<Anchors>
						<Anchor point="BOTTOMLEFT" />
						<Anchor point="BOTTOMRIGHT" />
					</Anchors>
					<Color r="0.03" g="0.03" b="0.03" a="0.95"/>
				</Texture>
			</Layer>

			<Layer level="OVERLAY">
				<Texture parentKey="ThumbTexture">
					<Size x="5" y="14"/>
					<Color r="0.45" g="0.45" b="0.45" a="1"/>
					<Anchors>
						<!-- This anchor has to be set again in Config_Slider because it doesn't actually work here. -->
						<Anchor point="BOTTOM" relativeKey="$parent.thumb" y="-2"/>
					</Anchors>
				</Texture>



				<FontString parentKey="Center" inherits="GameFontHighlightSmall" justifyH="CENTER" justifyV="BOTTOM">
					<Anchors>
						<Anchor point="BOTTOM" relativeKey="$parent.Background" relativePoint="TOP" y="2"/>
					</Anchors>
				</FontString>

				<FontString parentKey="Right" inherits="GameFontHighlightSmall" justifyH="RIGHT" justifyV="BOTTOM">
					<Anchors>
						<Anchor point="BOTTOM"  relativeKey="$parent.Center"/>
						<Anchor point="RIGHT" x="-3" />
					</Anchors>
				</FontString>

				<FontString parentKey="Left" inherits="GameFontHighlightSmall" justifyH="LEFT" justifyV="BOTTOM" >
					<Size y="30" />
					<Anchors>
						<Anchor point="BOTTOM"  relativeKey="$parent.Center"/>
						<Anchor point="LEFT" x="3" />
						<Anchor point="RIGHT" relativeKey="$parent.Right" relativePoint="LEFT" x="-5"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
	</Slider>

	<Slider name="TellMeWhen_SliderTemplate_Alpha" inherits="TellMeWhen_SliderTemplate" virtual="true">
		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_Slider_Alpha"/>
		</KeyValues>
	</Slider>


	<Button name="TellMeWhen_ColorButtonTemplate" virtual="true">
		<Size x="20" y="20"/>

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_ColorButton"/>
		</KeyValues>

		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="background1">
					<Anchors>
						<Anchor point="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="CENTER"/>
					</Anchors>
					<Color r="0.65" g="0.65" b="0.65"/>
				</Texture>
				<Texture parentKey="background2">
					<Anchors>
						<Anchor point="TOPRIGHT"/>
						<Anchor point="BOTTOMLEFT" relativePoint="CENTER"/>
					</Anchors>
					<Color r="0.35" g="0.35" b="0.35"/>
				</Texture>
				<Texture parentKey="background3">
					<Anchors>
						<Anchor point="BOTTOMLEFT"/>
						<Anchor point="TOPRIGHT" relativePoint="CENTER"/>
					</Anchors>
					<Color r="0.35" g="0.35" b="0.35"/>
				</Texture>
				<Texture parentKey="background4">
					<Anchors>
						<Anchor point="BOTTOMRIGHT"/>
						<Anchor point="TOPLEFT" relativePoint="CENTER"/>
					</Anchors>
					<Color r="0.65" g="0.65" b="0.65"/>
				</Texture>

				<FontString parentKey="text" justifyH="LEFT" inherits="GameFontHighlightSmall">
					<Anchors>
						<Anchor point="LEFT" relativePoint="RIGHT" x="3"/>
					</Anchors>
				</FontString>
			</Layer>
			<Layer level="OVERLAY">
				<Texture parentKey="swatch">
					<Anchors>
						<Anchor point="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Button inherits="TellMeWhen_ClickInterceptor"/>
		</Frames>

		<HighlightTexture alphaMode="ADD" alpha="0.15" setAllPoints="true">
			<Color r="1" g="1" b="1"/>
		</HighlightTexture>
	</Button>

	<Button name="TellMeWhen_DeleteButtonTemplate" virtual="true">
		<Size x="18" y="18"/>
		<NormalTexture urgency="5" file="Interface\AddOns\TellMeWhen\Textures\RedX"/>
		<PushedTexture file="Interface\AddOns\TellMeWhen\Textures\RedX">
			<Anchors>
				<Anchor point="TOPLEFT" x="-1" y="-1"/>
				<Anchor point="BOTTOMRIGHT" x="-1" y="-1"/>
			</Anchors>
		</PushedTexture>
		<HighlightTexture urgency="5" file="Interface\AddOns\TellMeWhen\Textures\RedX" alphaMode="ADD"/>
		<Scripts>
			<OnEnable>
				self:GetNormalTexture():SetDesaturated(false)
			</OnEnable>
			<OnDisable>
				self:GetNormalTexture():SetDesaturated(true)
			</OnDisable>
		</Scripts>
	</Button>


	<CheckButton name="TellMeWhen_PointTemplate" virtual="true">
		<Layers>
			<Layer level="OVERLAY">
				<Texture parentKey="selectedTexture" hidden="true">
					<Color r="1.0" g="0.82" b="0" a="0.8"/>
					<Anchors>
						<Anchor point="TOPLEFT" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" x="-1" y="1"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>

		<NormalTexture >
			<Color r="0.02" g="0.02" b="0.02"/>
			<Anchors>
				<Anchor point="TOPLEFT" x="1" y="-1"/>
				<Anchor point="BOTTOMRIGHT" x="-1" y="1"/>
			</Anchors>
		</NormalTexture>

		<HighlightTexture alphaMode="ADD">
			<Color r="1" g="1" b="1" a="0.03"/>
			<Anchors>
				<Anchor point="TOPLEFT" x="1" y="-1"/>
				<Anchor point="BOTTOMRIGHT" x="-1" y="1"/>
			</Anchors>
		</HighlightTexture>

		<CheckedTexture>
			<Color r="1.0" g="0.82" b="0" a="0.8"/>
			<Anchors>
				<Anchor point="TOPLEFT" x="1" y="-1"/>
				<Anchor point="BOTTOMRIGHT" x="-1" y="1"/>
			</Anchors>
		</CheckedTexture>

		<Scripts>
			<OnClick>
				self:GetParent():SelectChild(self)
			</OnClick>
		</Scripts>
	</CheckButton>

	<Frame name="TellMeWhen_PointSelectTemplate" virtual="true">
		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_PointSelect"/>
		</KeyValues>

		<Layers>
			<Layer level="OVERLAY">
				<FontString parentKey="Header" inherits="GameFontHighlightSmall" justifyH="CENTER" alpha="1">
					<Anchors>
						<Anchor point="BOTTOM" relativePoint="TOP" y="1"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
			<CheckButton parentKey="CENTER" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="CENTER"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="TOPLEFT" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="TOPLEFT"/>
					<Anchor point="BOTTOMRIGHT" relativeKey="$parent.CENTER" relativePoint="TOPLEFT"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="TOPRIGHT" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="TOPRIGHT"/>
					<Anchor point="BOTTOMLEFT" relativeKey="$parent.CENTER" relativePoint="TOPRIGHT"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="BOTTOMLEFT" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="BOTTOMLEFT"/>
					<Anchor point="TOPRIGHT" relativeKey="$parent.CENTER" relativePoint="BOTTOMLEFT"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="BOTTOMRIGHT" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="BOTTOMRIGHT"/>
					<Anchor point="TOPLEFT" relativeKey="$parent.CENTER" relativePoint="BOTTOMRIGHT"/>
				</Anchors>
			</CheckButton>


			<CheckButton parentKey="LEFT" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="LEFT"/>
					<Anchor point="TOPRIGHT" relativeKey="$parent.CENTER" relativePoint="TOPLEFT"/>
					<Anchor point="RIGHT" relativeKey="$parent.CENTER" relativePoint="BOTTOMLEFT"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="RIGHT" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="RIGHT"/>
					<Anchor point="TOPLEFT" relativeKey="$parent.CENTER" relativePoint="TOPRIGHT"/>
					<Anchor point="BOTTOMLEFT" relativeKey="$parent.CENTER" relativePoint="BOTTOMRIGHT"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="BOTTOM" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="BOTTOM"/>
					<Anchor point="TOPLEFT" relativeKey="$parent.CENTER" relativePoint="BOTTOMLEFT"/>
					<Anchor point="TOPRIGHT" relativeKey="$parent.CENTER" relativePoint="BOTTOMRIGHT"/>
				</Anchors>
			</CheckButton>

			<CheckButton parentKey="TOP" inherits="TellMeWhen_PointTemplate">
				<Anchors>
					<Anchor point="TOP"/>
					<Anchor point="BOTTOMLEFT" relativeKey="$parent.CENTER" relativePoint="TOPLEFT"/>
					<Anchor point="BOTTOMRIGHT" relativeKey="$parent.CENTER" relativePoint="TOPRIGHT"/>
				</Anchors>
			</CheckButton>
		</Frames>
	</Frame>


	<EditBox name="TellMeWhen_ExportBoxTemplate" inherits="TellMeWhen_InputBoxTemplate" virtual="true">
		<Size y="15"/>
		<Frames>

			<Button parentKey="Button" inherits="TellMeWhen_ButtonTemplate" >
				<Anchors>
					<Anchor point="TOP" y="0"/>
					<Anchor point="BOTTOM" y="0"/>
					<Anchor point="RIGHT" x="0" />
				</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>
						TMW:ClickSound()

						self:GetParent().DD:Toggle(nil, nil, self, 0, 0)
					</OnClick>
				</Scripts>
			</Button>
			<Frame parentKey="DD" name="$parentDD" inherits="TMW_DropDownMenuTemplate" propagateKeyboardInput="true">
				<Anchors>
					<Anchor point="LEFT" relativePoint="RIGHT" x="-15" y="-4"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)

						self:SetFunction(TMW.IE.ImportExport_DropDown)
						self:SetDropdownAnchor("BOTTOMRIGHT", nil, "TOPRIGHT", -2, 1)

						self:SetScrollable(true)
						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>
				TMW:CInit(self)
				self:SetLabel("")
				self:SetTexts(TMW.L["IMPORT_EXPORT"], TMW.L["IMPORT_EXPORT_DESC"])

				self:SetTextInsets(3, self.Button:GetWidth() + 5, 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
					export.globalgroups = 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>

			<OnEnterPressed>
				self:ClearFocus()
				self.DD:Toggle(1)
			</OnEnterPressed>
			<OnTextChanged>
				local text = self:GetText()

				if userInput then
					TMW.DD:CloseDropDownMenus()

					local editboxResults = TMW.LastExportedString ~= text and TMW:DeserializeData(text, true)
					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"/>

		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="background">
					<Color r="0.05" g="0.05" b="0.05" a="1"/>
				</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 parentKey="title" name="$parentTitle" inherits="GameFontNormal" justifyH="CENTER">
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.HeaderBackground" y="0"/>
					</Anchors>
				</FontString>
				<FontString parentKey="desc" name="$parentDesc" inherits="GameFontHighlight" justifyH="CENTER" justifyV="TOP">
					<Anchors>
						<Anchor point="TOP" y="-32"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

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

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

						self:GetParent():Hide()
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnShow>
				self:RegisterForDrag("LeftButton")
			</OnShow>
			<OnDragStart>
				self:StartMoving()
			</OnDragStart>
			<OnDragStop>
				self:StopMovingOrSizing()
			</OnDragStop>
		</Scripts>
	</Frame>


	<Frame name="TellMeWhen_ColorPickerTemplate" hidden="false" virtual="true" inherits="TellMeWhen_SimpleDialog">
		<Size x="320" y="214"/>

		<KeyValues>
			<KeyValue key="tmwClass" type="string" value="Config_ColorPicker"/>
		</KeyValues>

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

			<Slider parentKey="HueSlider" inherits="TellMeWhen_SliderTemplate">
				<Size x="210" y="20"/>
				<Anchors>
					<Anchor point="TOPLEFT" x="10" y="-10" relativeKey="$parent.HeaderBackground" relativePoint="BOTTOMLEFT"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self:SetTexts(TMW.L["COLORPICKER_HUE"], TMW.L["COLORPICKER_HUE_DESC"])
						self:SetTextFormatter(TMW.C.Formatter:New(function(value)
							return ("%.1f"):format(value*360)
						end))
						self:SetValueStep(0.0005)
						self:SetMinMaxValues(0, 0.9995)

						self.Background:Hide()

						self.NUM_SEGMENTS = 6

						self.textures = {}

						for i = 1, self.NUM_SEGMENTS do
							local tex = self:CreateTexture()
							self.textures[i] = tex
							tex:SetPoint("TOP", self.Background, "TOP", 0, 0)
							tex:SetPoint("BOTTOM", self.Background, "BOTTOM", 0, 0)
							tex:SetColorTexture(1, 1, 1)
							tex:SetWidth(self:GetWidth()/self.NUM_SEGMENTS)
							if i > 1 then
								tex:SetPoint("LEFT", self.textures[i-1], "RIGHT", 0, 0)
							else
								tex:SetPoint("LEFT")
							end
						end
					</OnLoad>
				</Scripts>
			</Slider>

			<Slider parentKey="SaturationSlider" inherits="TellMeWhen_SliderTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.HueSlider" relativePoint="BOTTOMLEFT" y="-10"/>
					<Anchor point="RIGHT" relativeKey="$parent.HueSlider" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self:SetTexts(TMW.L["COLORPICKER_SATURATION"], TMW.L["COLORPICKER_SATURATION_DESC"])
						self:SetTextFormatter(TMW.C.Formatter.PERCENT100)
						self:SetMinMaxValues(0, 1)
						self:SetValueStep(0.001)
						self.Background:SetColorTexture(1, 1, 1)
					</OnLoad>
				</Scripts>
			</Slider>

			<Slider parentKey="ValueSlider" inherits="TellMeWhen_SliderTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.SaturationSlider" relativePoint="BOTTOMLEFT" y="-10"/>
					<Anchor point="RIGHT" relativeKey="$parent.SaturationSlider" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self:SetTexts(TMW.L["COLORPICKER_BRIGHTNESS"], TMW.L["COLORPICKER_BRIGHTNESS_DESC"])
						self:SetTextFormatter(TMW.C.Formatter.PERCENT100)
						self:SetMinMaxValues(0, 1)
						self:SetValueStep(0.001)
						self.Background:SetColorTexture(1, 1, 1)
					</OnLoad>
				</Scripts>
			</Slider>

			<Slider parentKey="AlphaSlider" inherits="TellMeWhen_SliderTemplate">
				<Size x="210" y="20"/>
				<Anchors>
					<Anchor point="TOP" relativeKey="$parent.ValueSlider" relativePoint="BOTTOM" y="-10"/>
					<Anchor point="LEFT" relativeKey="$parent.ValueSlider"/>
					<Anchor point="RIGHT" relativeKey="$parent.ValueSlider" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self:SetTexts(TMW.L["COLORPICKER_OPACITY"], TMW.L["COLORPICKER_OPACITY_DESC"])
						self:SetTextFormatter(TMW.C.Formatter.PERCENT100)
						self:SetMinMaxValues(0, 1)
						self:SetValueStep(0.001)
						self.Background:SetColorTexture(1, 1, 1)

						local w = self:GetWidth()
						local h = self.Background:GetHeight()

						local squareSize = 5

						for x = 1, ceil(w/squareSize) do
							for y = 1, h/squareSize do
								local tex = self:CreateTexture(nil, "BACKGROUND")
								tex:SetPoint("TOPLEFT", self.Background, "TOPLEFT", (x-1)*squareSize, -(y-1)*squareSize)
								tex:SetSize(squareSize, squareSize)
								local c = (x+y)%2 == 0 and 0.35 or 0.65
								tex:SetColorTexture(c, c, c)
							end
						end
					</OnLoad>
					<OnShow>
						self:GetParent():SetHeight(self:GetParent():GetHeight() + self:GetHeight() + 10)
					</OnShow>
					<OnHide>
						self:GetParent():SetHeight(self:GetParent():GetHeight() - self:GetHeight() - 10)
					</OnHide>
				</Scripts>
			</Slider>

			<EditBox parentKey="Texture" inherits="TellMeWhen_InputBoxTemplate">
				<Size x="95" y="16"/>
				<Anchors>
					<Anchor point="TOP" relativeKey="$parent.AlphaSlider" relativePoint="BOTTOM" y="-10"/>
					<Anchor point="LEFT" relativeKey="$parent.AlphaSlider"/>
					<Anchor point="RIGHT" relativeKey="$parent.AlphaSlider" />
				</Anchors>
				<Layers>
					<Layer level="OVERLAY">
						<FontString parentKey="Left" inherits="GameFontHighlightSmall" justifyH="LEFT" justifyV="BOTTOM" >
							<Size y="30" />
							<Anchors>
								<Anchor point="BOTTOM" relativePoint="TOP"/>
								<Anchor point="LEFT" x="3" />
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self.__ttMinWidth = 300

						self:SetSetting("textureValue")


						self.Left:SetText(TMW.L["ICONMENU_CUSTOMTEX"])
						self:SetTexts(TMW.L["ICONMENU_CUSTOMTEX"], TMW.L["ICONMENU_CUSTOMTEX_DESC"])
					</OnLoad>
					<OnShow>
						self:GetParent():SetHeight(self:GetParent():GetHeight() + self:GetHeight() + 10)
						if self:GetParent().AlphaSlider:IsShown() then
							self:SetPoint("TOP", self:GetParent().AlphaSlider, "BOTTOM", 0, -17)
						else
							self:SetPoint("TOP", self:GetParent().ValueSlider, "BOTTOM", 0, -17)
						end
					</OnShow>
					<OnHide>
						self:GetParent():SetHeight(self:GetParent():GetHeight() - self:GetHeight() - 10)
					</OnHide>
				</Scripts>
			</EditBox>

			<Button parentKey="Okay" inherits="TellMeWhen_ButtonTemplate">
				<Anchors>
					<Anchor point="RIGHT" relativeKey="$parent.HueSlider" />
					<Anchor point="BOTTOM" y="5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(OKAY)
						self:SetWidth(self:GetTextWidth()+15)
					</OnLoad>
					<OnClick>
						self:GetParent():CScriptTunnel("ClearFocus")
						self:GetParent():SaveSetting()
					</OnClick>
				</Scripts>
			</Button>

			<Button parentKey="Cancel" inherits="TellMeWhen_ButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.HueSlider" />
					<Anchor point="BOTTOM" y="5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetText(CANCEL)
						self:SetWidth(self:GetTextWidth()+15)
					</OnLoad>
					<OnClick>
						self:GetParent():Hide()
					</OnClick>
				</Scripts>
			</Button>

			<Frame parentKey="swatch" inherits="TellMeWhen_ColorButtonTemplate">
				<Size x="33" y="33"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativeKey="$parent.Cancel" relativePoint="TOPLEFT" x="0" y="10"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent():GetFrameLevel() + 5)
					</OnLoad>
				</Scripts>
			</Frame>

			<Frame parentKey="swatchPrevious" inherits="TellMeWhen_ColorButtonTemplate">
				<Size x="33" y="33"/>
				<Anchors>
					<Anchor point="TOPRIGHT" relativeKey="$parent.swatch" x="7" y="7"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent().swatch:GetFrameLevel() - 2)
					</OnLoad>
				</Scripts>
			</Frame>


			<Frame parentKey="RecentColorFrame" >
				<Size x="85"/>
				<Anchors>
					<Anchor point="TOP" y="-20" relativeKey="$parent.HeaderBackground" relativePoint="BOTTOM"/>
					<Anchor point="LEFT" relativeKey="$parent.HueSlider" relativePoint="RIGHT" x="15"/>
					<Anchor point="BOTTOM" y="10"/>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						TMW:ConvertContainerToScrollFrame(self, false, -2, 5)
					</OnLoad>
				</Scripts>
			</Frame>
		</Frames>

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

			<Layer level="OVERLAY">
				<Texture parentKey="iconTexture">
					<Size x="40" y="40"/>
					<TexCoords left="0.07" right="0.93" top="0.07" bottom="0.93"/>
					<Anchors>
						<Anchor point="BOTTOM" relativeKey="$parent.swatch"/>
						<Anchor point="LEFT" relativePoint="RIGHT" relativeKey="$parent.swatchPrevious" x="20"/>
					</Anchors>
				</Texture>
			</Layer>

			<Layer level="OVERLAY">
				<FontString parentKey="swatchLabel" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent.swatch" />
						<Anchor point="BOTTOM" relativePoint="TOP" relativeKey="$parent.swatchPrevious" y="2"/>
					</Anchors>
				</FontString>
			</Layer>

			<Layer level="OVERLAY">
				<FontString parentKey="iconLabel" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent.iconTexture" />
						<Anchor point="BOTTOM" relativePoint="TOP" relativeKey="$parent.iconTexture" y="2"/>
					</Anchors>
				</FontString>

				<FontString parentKey="recentHeader" inherits="GameFontHighlightSmall" justifyH="CENTER">
					<Anchors>
						<Anchor relativeKey="$parent.RecentColorFrame.ScrollFrame" point="BOTTOM" relativePoint="TOP" y="2"/>
						<Anchor relativeKey="$parent.RecentColorFrame.ScrollFrame" point="LEFT" />
						<Anchor relativeKey="$parent.RecentColorFrame.ScrollFrame" point="RIGHT"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
			<EditBox parentKey="StringEditbox" inherits="TellMeWhen_InputBoxTemplate">
				<Size x="95" y="16"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.iconTexture" relativePoint="TOPRIGHT" x="15"/>
					<Anchor point="RIGHT" relativeKey="$parent.AlphaSlider" />
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self:SetTexts(TMW.L["COLORPICKER_STRING"], TMW.L["COLORPICKER_STRING_DESC"])
						function self:SaveSetting()
							local value = self:GetText()
							if value and value ~= "" then
								self:GetParent():SetColorString(value)
							else
								self:RequestReload()
							end
						end

						self:CScriptAdd("ReloadRequested", function()
							self:SetText(self:GetParent():GetColorString())
						end)

					</OnLoad>
				</Scripts>
			</EditBox>

			<CheckButton parentKey="Desaturate" inherits="TellMeWhen_CheckTemplate">
				<Size x="26" y="26"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.StringEditbox" relativePoint="BOTTOMLEFT" x="-5" y="-2"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self)
						self:SetTexts(TMW.L["COLORPICKER_DESATURATE"], TMW.L["COLORPICKER_DESATURATE_DESC"])
						self:SetSetting("desaturate")
					</OnLoad>
				</Scripts>
			</CheckButton>
		</Frames>

	</Frame>


	<!-- END TEMPLATES -->

	<Frame name="TellMeWhen_ColorPicker" inherits="TellMeWhen_ColorPickerTemplate" hidden="true">
		<Anchors>
			<Anchor point="CENTER" />
		</Anchors>
		<Scripts>
			<OnLoad>
				TMW:CInit(self)
				self.title:SetText("TellMeWhen")
				self.CloseButton:Hide()

				TMW:RegisterCallback("TMW_OPTIONS_LOADED", function()
					-- Create resizer
					self.resizer = TMW.Classes.Resizer_Generic:New(self)
					self.resizer:Show()
					self.resizer.scale_min = 0.8
					self.resizer:SetModes(self.resizer.MODE_SCALE, self.resizer.MODE_SCALE)
				end)
			</OnLoad>
		</Scripts>
	</Frame>

	<Frame name="TellMeWhen_GroupImportFlash" frameStrata="FULLSCREEN" parent="UIParent" hidden="true">
		<Layers>
			<Layer level="OVERLAY">
				<FontString parentKey="text" inherits="GameFontNormalLargeOutline" justifyH="CENTER" justifyV="CENTER" setAllPoints="true">
					<Anchors>
						<Anchor point="CENTER" />
					</Anchors>
				</FontString>

				<Texture parentKey="glow" setAllPoints="true" alpha="0">
					<Color r="0" g="0.4" b="0"/>
					<Animations>
						<AnimationGroup parentKey="anim">
							<Alpha startDelay="0" change="0.9" duration="0.8" order="1"/>
							<Alpha startDelay="0.6" change="-0.9" duration="1" order="2"/>
							<Scripts>
								<OnFinished>
									self:GetParent():GetParent():Hide()
								</OnFinished>
							</Scripts>
						</AnimationGroup>
					</Animations>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self.text:SetText(TMW.L["IMPORT_GROUPIMPORTED"])
				function self:Play(group)
					self:SetAllPoints(group)
					self:Show()
					self.glow.anim:Play()
				end
			</OnLoad>
		</Scripts>
	</Frame>

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

		<Frames>
			<Button 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()
						TMW.wIE:Load(1)
					</OnClick>
				</Scripts>
			</Button>
			<Button 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"])
						TMW.IE:Load(1)
					</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 inherit="prepend">

				TMW.IE.db.global.ConfigWarningN = TMW.IE.db.global.ConfigWarningN + 1
				if TMW.IE.db.global.ConfigWarningN > 3 then
					self.NeverAgain:Show()
					self.Exit:SetPoint("BOTTOMRIGHT", self.NeverAgain, "BOTTOMLEFT", -10, 0)
				else
					self.NeverAgain:Hide()
					self.Exit:SetPoint("BOTTOMRIGHT", -5, 5)
				end
			</OnShow>
		</Scripts>
	</Frame>

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

		<Frames>
			<Button parentKey="Exit" name="$parentExit" 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)))
					TMW:Print(self.desc:GetText())
					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)
			</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 parentKey="First" name="$parentFirst" 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 parentKey="Second" name="$parentSecond" 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 parentKey="desc2" name="$parentDesc2" inherits="GameFontHighlight" justifyH="CENTER" justifyV="TOP">
					<Anchors>
						<Anchor point="TOP" relativeTo="$parentSecond" relativePoint="BOTTOM" y="-20"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>

		<Frames>
			<Button parentKey="IgnoreForSession" name="$parentIgnoreForSession" 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:SetBorderSize(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: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 parentKey="ScrollContainer" name="$parentScrollContainer">
				<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 parentKey="Code" name="$parentCode" 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:SetWheelStepAmount(25)
						self.Code:SetWidth(self:GetWidth()-15)
						self.Code:SetNonSpaceWrap(1)
					  	-- Cursor location displays incorrectly with non-zero spacing in WoW 8.0.
					  	-- We used to use a value of 2 here, but can't anymore.
						self.Code:SetSpacing(0)
					</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 parentKey="Deny" name="$parentDeny" 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 parentKey="Confirm" name="$parentConfirm" 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"])

				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

						-- Code will have raw, unescaped pipes. 
						-- We need to escape them because we're about to display the code as text.
						local code = currentDetections[self.currentResult].code:gsub("|", "||")
						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>



	<Button name="TellMeWhen_IE_Tab" virtual="true">
		<Size x="50" y="25"/>
		<HitRectInsets left="0" right="0" top="-5" bottom="0" />
		<Anchors>
			<Anchor point="BOTTOM"/>
		</Anchors>
		<ButtonText parentKey="text" justifyH="CENTER">
			<Anchors>
				<Anchor point="CENTER" />
			</Anchors>
		</ButtonText>
		<NormalFont style="GameFontNormal"/>
		<HighlightFont style="GameFontHighlight"/>
		<DisabledFont style="GameFontDisable"/>
	</Button>

	<Texture name="TellMeWhen_IE_Tab_PrimaryBorder" virtual="true">
		<Size x="1" y="1" />
		<Color r="0.150" g="0.150" b="0.150" a="1"/>
	</Texture>

	<Texture name="TellMeWhen_IE_Tab_SecondaryBorder" virtual="true">
		<Size x="1" y="1" />
		<Color r="0.353" g="0.353" b="0.353" a="1"/>
	</Texture>

	<Frame name="TellMeWhen_IE_PanelColumn" virtual="true">
		<KeyValues>
			<KeyValue key="scrollbarOffset" type="number" value="1" />
			<KeyValue key="scrollbarWidth" type="number" value="7" />
		</KeyValues>
		
		<Anchors>
			<Anchor point="TOP" y="-35"/>
			<Anchor point="BOTTOM" y="0"/>
		</Anchors>
		<Scripts>
			<OnLoad>
				TMW:CInit(self, "Config_Frame")

				local parent = self:GetParent()
				parent.panelColumns = parent.panelColumns or {}
				self.currentPanels = {}
				tinsert(parent.panelColumns, self)

				TMW:ConvertContainerToScrollFrame(self, true, self.scrollbarOffset, self.scrollbarWidth)
				self.ScrollFrame.scrollPercentage = 1/3
			</OnLoad>
		</Scripts>
	</Frame>



	<Frame name="TellMeWhen_IconEditor" hidden="true" enableKeyboard="true" propagateKeyboardInput="true" frameStrata="DIALOG" inherits="TellMeWhen_SimpleDialog">
		<Size x="586" y="380"/>
		<Anchors>
			<Anchor point="CENTER" relativeTo="UIParent"/>
			<Anchor point="TOP" relativeTo="UIParent" y="-60"/>
		</Anchors>

		<Layers>
			<Layer level="OVERLAY">
				<Texture parentKey="icontexture" name="$parentIconTexture">
					<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>

			<Button 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>
						TMW:ClickSound()

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

			<Button 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>
						TMW:ClickSound()

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

						local textfunc = function()
							local ret = TMW.L["UNDO_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", textfunc, nil, 1)

						self:SetWidth(self:GetTextWidth()+15)
						self:SetFrameLevel(self:GetFrameLevel()+2)
					</OnLoad>
					<OnClick>
						TMW:ClickSound()

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

						local textfunc = function()
							local ret = TMW.L["REDO_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", textfunc, nil, 1)

						self:SetWidth(self:GetTextWidth()+15)
						self:SetFrameLevel(self:GetFrameLevel()+2)
					</OnLoad>
					<OnClick>
						TMW:ClickSound()

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


			<EditBox parentKey="ExportBox" inherits="TellMeWhen_ExportBoxTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.RedoButton" relativePoint="RIGHT" x="10" y="0"/>
					<Anchor point="RIGHT" relativeKey="$parent.OkayButton" relativePoint="LEFT" x="-10" y="0"/>
				</Anchors>
			</EditBox>

			<Frame parentKey="Tabs">
				<Size y="33" />
				<Anchors>
					<Anchor point="LEFT" />
					<Anchor point="RIGHT" />
					<Anchor point="BOTTOM" relativeKey="$parent.ResetButton" relativePoint="TOP" y="9"/>
				</Anchors>
				<Frames>
					<Frame parentKey="primary">
						<Size x="130" />
						<Anchors>
							<Anchor point="TOPRIGHT" y="-8" x="-10"/>
							<Anchor point="BOTTOM" />
						</Anchors>

						<Layers>
							<Layer level="OVERLAY">
							</Layer>
						</Layers>
					</Frame>
					<Frame parentKey="secondary">
						<Size x="200" />
						<Anchors>
							<Anchor point="TOPLEFT" y="-8" x="10"/>
							<Anchor point="BOTTOM" />
						</Anchors>

						<Layers>
							<Layer level="OVERLAY">

							</Layer>
						</Layers>
					</Frame>
					<Frame parentKey="art" setAllPoints="true">
						<Layers>
							<!-- Base background -->
							<Layer level="ARTWORK" textureSubLevel="0">
								<Texture >
									<Color r="0.015686" g="0.015686" b="0.015686" a="1"/>
									<Anchors>
										<Anchor point="TOPLEFT" />
										<Anchor point="BOTTOMRIGHT" />
									</Anchors>
								</Texture>
							</Layer>

							<!-- PRIMARY TABS -->
							<Layer level="ARTWORK" textureSubLevel="2">

								<!-- Primary Selected horizontal -->
								<Texture parentKey="pSelectedHorizontal" inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<!-- Anchors will be set when a tab is selected. -->
								</Texture>

								<!-- Primary Left riser to selected tab -->
								<Texture parentKey="pLeftRiser" inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="TOPRIGHT" relativeKey="$parent.pSelectedHorizontal" relativePoint="TOPLEFT" />
										<Anchor point="BOTTOM"/>
									</Anchors>
								</Texture>

								<!-- Primary Right riser to selected tab -->
								<Texture parentKey="pRightRiser" inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="TOPLEFT" relativeKey="$parent.pSelectedHorizontal" relativePoint="TOPRIGHT" />
										<Anchor point="BOTTOM"/>
									</Anchors>
								</Texture>

								<!-- Primary RIGHT horizontal to end -->
								<Texture inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.pRightRiser" relativePoint="BOTTOMRIGHT" />
										<Anchor point="RIGHT" />
									</Anchors>
								</Texture>

								<!-- Primary center horizontal -->
								<Texture inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.$parent.secondary" relativePoint="BOTTOMRIGHT" />
										<Anchor point="BOTTOMRIGHT" relativeKey="$parent.pLeftRiser" relativePoint="BOTTOMLEFT" />
									</Anchors>
								</Texture>


								<!-- Primary Left riser to secondary tabs -->
								<Texture parentKey="pLeftRiser2" inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="TOPLEFT" relativeKey="$parent.$parent.secondary" />
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.$parent.secondary"/>
									</Anchors>
								</Texture>

								<!-- Primary secondary tabs horizontal -->
								<Texture parentKey="pHorizontal2" inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="TOPLEFT" relativeKey="$parent.$parent.secondary" />
										<Anchor point="TOPRIGHT" relativeKey="$parent.$parent.secondary" />
									</Anchors>
								</Texture>

								<!-- Primary Right riser to secondary tabs -->
								<Texture parentKey="pRightRiser2" inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="TOPRIGHT" relativeKey="$parent.$parent.secondary" />
										<Anchor point="BOTTOMRIGHT" relativeKey="$parent.$parent.secondary" />
									</Anchors>
								</Texture>

								<!-- Primary Left horizontal -->
								<Texture  inherits="TellMeWhen_IE_Tab_PrimaryBorder">
									<Anchors>
										<Anchor point="LEFT"/>
										<Anchor point="BOTTOMRIGHT" relativeKey="$parent.pLeftRiser2" relativePoint="BOTTOMLEFT" />
									</Anchors>
								</Texture>

								<!-- Selected primary tab -->
								<Texture>
									<Color r="0.03529" g="0.03529" b="0.03529" a="1"/>
									<Anchors>
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.pLeftRiser" relativePoint="BOTTOMRIGHT" />
										<Anchor point="RIGHT" relativeKey="$parent.pRightRiser" relativePoint="LEFT" />
										<Anchor point="TOP" relativeKey="$parent.pSelectedHorizontal" relativePoint="BOTTOM" />
									</Anchors>
								</Texture>

							</Layer>

							<!-- Secondary tabs background -->
							<Layer level="ARTWORK" textureSubLevel="3">
								<Texture>
									<Color r="0.03529" g="0.03529" b="0.03529" a="1"/>
									<Anchors>
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.pLeftRiser2" relativePoint="BOTTOMRIGHT" />
										<Anchor point="RIGHT" relativeKey="$parent.pRightRiser2" relativePoint="LEFT" />
										<Anchor point="TOP" relativeKey="$parent.pHorizontal2" relativePoint="BOTTOM" />
									</Anchors>
								</Texture>
							</Layer>

							<!-- SECONDARY TABS -->
							<Layer level="ARTWORK" textureSubLevel="4">

								<!-- Secondary Selected horizontal -->
								<Texture parentKey="sSelectedHorizontal" inherits="TellMeWhen_IE_Tab_SecondaryBorder">
									<!-- Anchors will be set when a tab is selected. -->
								</Texture>

								<!-- Secondary Left riser to selected tab -->
								<Texture parentKey="sLeftRiser" inherits="TellMeWhen_IE_Tab_SecondaryBorder">
									<Anchors>
										<Anchor point="BOTTOMRIGHT" relativeKey="$parent.sSelectedHorizontal" relativePoint="BOTTOMLEFT" />
										<Anchor point="TOP"/>
									</Anchors>
								</Texture>

								<!-- Secondary Left horizontal -->
								<Texture  inherits="TellMeWhen_IE_Tab_SecondaryBorder">
									<Anchors>
										<Anchor point="LEFT"/>
										<Anchor point="TOPRIGHT" relativeKey="$parent.sLeftRiser" relativePoint="TOPLEFT" />
									</Anchors>
								</Texture>

								<!-- Secondary Right riser to selected tab -->
								<Texture parentKey="sRightRiser" inherits="TellMeWhen_IE_Tab_SecondaryBorder">
									<Anchors>
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.sSelectedHorizontal" relativePoint="BOTTOMRIGHT" />
										<Anchor point="TOP"/>
									</Anchors>
								</Texture>

								<!-- Secondary Right horizontal -->
								<Texture  inherits="TellMeWhen_IE_Tab_SecondaryBorder">
									<Anchors>
										<Anchor point="RIGHT"/>
										<Anchor point="TOPLEFT" relativeKey="$parent.sRightRiser" relativePoint="TOPRIGHT" />
									</Anchors>
								</Texture>

								<!-- Selected secondary tab -->
								<Texture>
									<Color r="0.05" g="0.05" b="0.05" a="0.995"/>
									<Anchors>
										<Anchor point="TOPLEFT" relativeKey="$parent.sLeftRiser" relativePoint="TOPRIGHT" />
										<Anchor point="RIGHT" relativeKey="$parent.sRightRiser" relativePoint="LEFT" />
										<Anchor point="BOTTOM" relativeKey="$parent.sSelectedHorizontal" relativePoint="TOP" />
									</Anchors>
								</Texture>

								<!-- IE background to bottom -->
								<Texture>
									<Color r="0.03529" g="0.03529" b="0.03529" a="1"/>
									<Anchors>
										<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT"/>
										<Anchor point="BOTTOMRIGHT" relativeKey="$parent.$parent.$parent" />
									</Anchors>
								</Texture>
							</Layer>
						</Layers>

						<Scripts>
							<OnSizeChanged>
								self:SetFrameLevel(self:GetParent():GetFrameLevel() - 1)
								self:SetScale(1/self:GetParent():GetEffectiveScale())
							</OnSizeChanged>
						</Scripts>
					</Frame>
				</Frames>
			</Frame>

			<Frame parentKey="Pages" name="$parentPages" >
				<Anchors>
					<Anchor point="LEFT" />
					<Anchor point="TOP" relativeKey="$parent.HeaderBackground" relativePoint="BOTTOM"/>
					<Anchor point="RIGHT" />
					<Anchor point="BOTTOM" relativeKey="$parent.Tabs" relativePoint="TOP" y="1"/>
				</Anchors>

				<Frames>

					<Frame parentKey="Confirm" inherits="TellMeWhen_IE_PageTemplate">

						<Frames>
							<Frame parentKey="MiddleBand" inherits="TellMeWhen_FlatFrame">
								<Size y="170"/>
								<Anchors>
									<Anchor point="LEFT" x="15" />
									<Anchor point="RIGHT" x="-15" />
									<Anchor point="TOP" y="-50" />
								</Anchors>

								<Layers>
									<Layer level="ARTWORK">
										<FontString parentKey="Header" inherits="GameFontNormalHuge3" justifyH="LEFT" >
											<Anchors>
												<Anchor point="TOPLEFT" relativeKey="$parent.MiddleBand" x="100" y="-15"/>
												<Anchor point="RIGHT" x="-100" />
											</Anchors>
										</FontString>

										<FontString parentKey="Description" inherits="GameFontHighlightLarge" justifyH="LEFT" justifyV="MIDDLE">
											<Anchors>
												<Anchor point="TOPLEFT" relativeKey="$parent.Header" relativePoint="BOTTOMLEFT" y="-10"/>
												<Anchor point="RIGHT" relativeKey="$parent.Header" />
											</Anchors>
										</FontString>
									</Layer>
								</Layers>

								<Frames>
									<Button parentKey="RejectButton" inherits="TellMeWhen_ButtonTemplate">
										<Size y="15"/>
										<Anchors>
											<Anchor point="TOP" relativeKey="$parent.Description" relativePoint="BOTTOM" x="0" y="-15"/>
											<Anchor point="RIGHT" relativeKey="$parent.Header" x="0" y="0"/>
										</Anchors>
										<Layers>
											<Layer level="ARTWORK">
											</Layer>
										</Layers>
										<Frames>
										</Frames>
										<Scripts>
											<OnLoad>
												self:SetScale(1.3)
												self:SetText(CANCEL)
												self:SetWidth(self:GetTextWidth() + 20)
											</OnLoad>
											<OnClick>
												self:GetParent():GetParent():Hide()
											</OnClick>
										</Scripts>
									</Button>

									<Button parentKey="AcceptButton" inherits="TellMeWhen_ButtonTemplate">
										<Size y="15"/>
										<Anchors>
											<Anchor point="RIGHT" relativeKey="$parent.RejectButton" relativePoint="LEFT" x="-15" y="0"/>
										</Anchors>
										<Layers>
											<Layer level="ARTWORK">
											</Layer>
										</Layers>

										<HighlightFont style="GameFontRed"/>

										<Frames>
										</Frames>
										<Scripts>
											<OnLoad>
												self:SetScale(1.3)
												self:SetText(OKAY)
												self:SetWidth(self:GetTextWidth() + 20)
											</OnLoad>
											<OnClick>
												TMW.safecall(self.Action)
												self:GetParent():GetParent():Hide()
											</OnClick>
										</Scripts>
									</Button>

									<Frame>
										<Size x="1" y="10"/>
										<Anchors>
											<Anchor point="TOP" relativeKey="$parent.AcceptButton" relativePoint="BOTTOM"/>
										</Anchors>
									</Frame>
								</Frames>
							</Frame>

							<!-- Dummy frame so that the scrolling goes below the bottom and looks nice -->
							<Frame>
								<Size x="1" y="50"/>
								<Anchors>
									<Anchor point="TOP" relativeKey="$parent.MiddleBand" relativePoint="BOTTOM"/>
								</Anchors>
							</Frame>
						</Frames>


						<Scripts>
							<OnLoad>
								TMW:CInit(self.MiddleBand, "Config_Frame")
								self.MiddleBand.Header:SetText(TMW.L["CONFIRM_HEADER"])
								TMW:ConvertContainerToScrollFrame(self)
							</OnLoad>
							<OnUpdate>
								local h = self.MiddleBand.Description:GetStringHeight() + 50
								self.MiddleBand.Description:SetHeight(h)
								self.MiddleBand:AdjustHeight()
							</OnUpdate>
							<OnHide>
								TMW.IE:RefreshTabs()
							</OnHide>
						</Scripts>
					</Frame>

					

				</Frames>
			</Frame>

		</Frames>
		<Layers>
			<Layer level="OVERLAY">
				<FontString parentKey="Header" inherits="GameFontNormal" wordwrap="false" justifyH="CENTER">
					<Anchors>
						<Anchor point="TOP" y="-8"/>
						<Anchor point="LEFT" relativeKey="$parent.ForwardsButton" relativePoint="RIGHT" x="4"/>
						<Anchor point="RIGHT" relativeKey="$parent.CloseButton" relativePoint="LEFT"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				TMW:CInit(self, "Config_Frame")

				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())

				self:RegisterForDrag("LeftButton")
			</OnLoad>
			<OnSizeChanged>
				TMW.IE:ResizeTabs()
			</OnSizeChanged>
			<OnDragStart>
				-- We use our own StartMoving for the icon editor because
				-- the one Bliizard provides bugs out a lot and makes the frame jump around.
				-- We only do this for the IE because all other frames are very seldom used.
				TMW.IE:StartMoving()
			</OnDragStart>
			<OnDragStop>
				TMW.IE:StopMovingOrSizing()
			</OnDragStop>
		</Scripts>
	</Frame>

</Ui>




