<Ui>

	<Button name="TellMeWhen_ConditionEditorRuneCheckTemplate" virtual="true">
		<Size x="33" y="29"/>
		<Layers>
			<Layer level="OVERLAY">
				<Texture name="$parentCheck" parentKey="Check" file="">
					<Size x="27" y="27"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture parentKey="texture">
					<Size x="26" y="26"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnClick>
				PlaySound("igMainMenuOptionCheckBoxOn")

				if self.checked then
					self.checked = false
					self.Check:SetTexture("Interface\\RAIDFRAME\\ReadyCheck-NotReady")
				elseif self.checked == false then
					self.checked = nil
					self.Check:SetTexture(nil)
				elseif self.checked == nil then
					self.checked = true
					self.Check:SetTexture("Interface\\RAIDFRAME\\ReadyCheck-Ready")
				end
				TMW.CNDT:RuneHandler(self)

				local CndtGroup = self:GetParent():GetParent()
				local condition = CndtGroup:GetConditionSettings()
				for k, rune in pairs(self:GetParent()) do
					if type(rune) == "table" then
						condition.Runes[rune:GetID()] = rune:GetChecked()
					end
				end
				CndtGroup:LoadAndDraw()
			</OnClick>
			<OnLoad>
				self.GetChecked = TMW.CNDT.Rune_GetChecked
				self.SetChecked = TMW.CNDT.Rune_SetChecked


				-- detect what texture should be used
				local runeName = gsub(self:GetName(), self:GetParent():GetName(), "")
				local runeType, death = runeName:match("(.*)%d(.*)")

				if death and death ~= "" then
					self.texture:SetTexture("Interface\\AddOns\\TellMeWhen\\Textures\\" .. runeType)
				else
					self.texture:SetTexture("Interface\\PlayerFrame\\UI-PlayerFrame-Deathknight-" .. runeType)
				end

			</OnLoad>
		</Scripts>
	</Button>
	<CheckButton name="TellMeWhen_ConditionEditorParenthesisTemplate" hidden="true" virtual="true">
		<Size x="20" y="20"/>
		<HitRectInsets>
			<AbsInset left="4" right="4" top="0" bottom="0"/>
		</HitRectInsets>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentText" parentKey="text" justifyH="LEFT" inherits="GameFontHighlight">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self.text:SetFont(self.text:GetFont(), 14, "THINOUTLINE")

				if strfind(self:GetParent():GetName(), "Close") then
					self.type = ")"
				else
					self.type = "("
				end
				self.text:SetText(self.type)
				function self:SetChecked(checked)
					self:Show()
					local oldstate = self.checked
					self.checked = checked
					if checked then
						local next = self:GetParent()[self:GetID() + 1]
						if next then
							next:Show()
						elseif self:GetID() &lt; 13 then
							next = CreateFrame("CheckButton", self:GetParent():GetName() .. self:GetID() + 1, self:GetParent(), "TellMeWhen_ConditionEditorParenthesisTemplate", self:GetID() + 1)
							self:GetParent()[self:GetID() + 1] = next
							local a, _, c, d, e = self:GetPoint()
							next:SetPoint(a, self, c, d, e)
							next:Show()
							next:SetChecked(nil)
						end
					else
						local last = self:GetParent()[self:GetID() - 1]
						if type(last) == "table" and not last.checked then
							self:Hide()
						end
						for i = self:GetID() + 1, #self:GetParent() do
							self:GetParent()[i]:SetChecked(nil)
							self:GetParent()[i]:Hide()
						end
					end

					if oldstate ~= checked then
					--	TMW.CNDT:ColorizeParentheses()
					end
				end

				function self:GetChecked()
					return self.checked
				end
				self:GetParent()[self:GetID()] = self
			</OnLoad>
			<OnClick>
				PlaySound("igMainMenuOptionCheckBoxOn")

				TMW.HELP:Hide("CNDT_PARENTHESES_FIRSTSEE")
			
				self:SetChecked(not self.checked)
				
				local n = 0
				if self:GetParent():IsShown() then
					for k, frame in pairs(self:GetParent()) do
						if type(frame) == "table" and frame:GetChecked() then
							n = n + 1
						end
					end
				end
				
				local CndtGroup = self:GetParent():GetParent()
				if self.type == "(" then
					CndtGroup:GetConditionSettings().PrtsBefore = n
				else
					CndtGroup:GetConditionSettings().PrtsAfter = n
				end
				CndtGroup:LoadAndDraw()
	
				TMW.CNDT:ColorizeParentheses()
			</OnClick>
			<OnEnter>
				self.text:SetText(gsub(self.text:GetText(), "|cff%x%x%x%x%x%x", "|cffffffff"))
			</OnEnter>
			<OnLeave>
				TMW.CNDT:ColorizeParentheses()
			</OnLeave>
		</Scripts>
	<!-- 	<HighlightTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/> -->
	</CheckButton>
	
	
	<Frame name="TellMeWhen_ConditionGroup" inherits="TellMeWhen_BorderedFrame" virtual="true">
		<Size x="563" y="69"/>
		<Anchors>
			<Anchor point="TOPLEFT"/>
		</Anchors>
		<Frames>
			<Frame name="$parentType" parentKey="Type" inherits="TMW_DropDownMenuTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" x="26" y="-14.5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							--title = TMW.L[""],
							--tooltip = TMW.L[""],
							func = TMW.CNDT.TypeMenu_DropDown,
						})

						self:SetWidth(176)
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentIcon" parentKey="Icon" inherits="TMW_IconDropDownMenuTemplate" hidden="true">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentType" relativePoint="RIGHT" x="6"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							title = TMW.L["CHOOSEICON"],
							func = TMW.CNDT.IconMenu_DropDown,
						})

						-- Width is set in the TMW_CNDT_GROUP_DRAWGROUP handler for this frame.
					</OnLoad>
				</Scripts>
			</Frame>
			<EditBox name="$parentUnit" inherits="TellMeWhen_InputBoxTemplate" parentKey="Unit" autoFocus="false">
				<Size x="120" y="15"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentType" relativePoint="RIGHT" x="12" y="3"/>
				</Anchors>
				
				<Scripts>
					<OnEditFocusLost>
						EditBox_ClearHighlight(self)
						TMW:CleanString(self)
						
						local CndtGroup = self:GetParent()
						local unit = strtrim(self:GetText()) or "player"

						CndtGroup:GetConditionSettings().Unit = unit
						CndtGroup:LoadAndDraw()

						local unitTable = TMW.UNITS:GetOriginalUnitTable(unit)
						if #unitTable > 1 then
							TMW.HELP:Show{
								code = "CNDT_UNIT_ONLYONE",
								icon = TMW.CI.icon,
								relativeTo = self,
								x = 0,
								y = 0,
								text = format(TMW.L["HELP_ONLYONEUNIT"], #unitTable)
							}
						end
						
						if self:GetText() == "" then
							TMW.HELP:Show{
								code = "CNDT_UNIT_MISSING",
								icon = TMW.CI.icon,
								relativeTo = self,
								x = 0,
								y = 0,
								text = format(TMW.L["HELP_NOUNIT"])
							}
						end
					</OnEditFocusLost>
				</Scripts>
			</EditBox>
			<Frame name="$parentOperator" parentKey="Operator" inherits="TMW_DropDownMenuTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentUnit" relativePoint="RIGHT" x="6" y="-3"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							--title = TMW.L[""],
							--tooltip = TMW.L[""],
							func = TMW.CNDT.OperatorMenu_DropDown,
						})

						self.Text:SetFontObject(GameFontHighlightLarge)
						self:SetWidth(66)
					</OnLoad>
				</Scripts>
			</Frame>
			
			<Slider name="$parentSlider" parentKey="Slider" inherits="TellMeWhen_SliderTemplate" hidden="true" minvalue="0" maxvalue="100" valuestep="1" defaultvalue="100">
				<Size x="522" y="17"/>
				<Anchors>
					<Anchor point="TOPRIGHT" x="-5" y="-39"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.__noWrapTooltipText = true

						TMW:CInit(self, {
							setting = "Level",
							OnValueChanged = function(self)
								local CndtGroup = self:GetParent()
								
								local conditionData = CndtGroup:GetConditionData()

								local value = self:GetValue()
								conditionData.formatter:SetFormattedText(CndtGroup.ValText, value)
							end,
						})

						self.GetSettingTable = function(self)
							return self:GetParent():GetConditionSettings()
						end
						self.CheckInteractionStates = TMW.NULLFUNC
						


					</OnLoad>
				</Scripts>
			</Slider>
			
			
			
			<EditBox name="$parentEditBox" inherits="TellMeWhen_InputBoxTemplate" parentKey="EditBox" autoFocus="false">
				<Size x="302" y="15"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentType" relativePoint="BOTTOMLEFT" x="6" y="2"/>
				</Anchors>
				<Scripts>
					<OnEditFocusLost>
						EditBox_ClearHighlight(self)
						TMW:CleanString(self)
						
						local CndtGroup = self:GetParent()
						CndtGroup:GetConditionSettings().Name = strtrim(self:GetText()) or ""
						CndtGroup:LoadAndDraw()
					</OnEditFocusLost>
				</Scripts>
			</EditBox>
			<EditBox name="$parentEditBox2" inherits="TellMeWhen_InputBoxTemplate" parentKey="EditBox2" autoFocus="false">
				<Size x="302" y="15"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentEditBox" relativePoint="RIGHT" x="15"/>
				</Anchors>
				<Scripts>
					<OnEditFocusLost>
						EditBox_ClearHighlight(self)
						TMW:CleanString(self)
						
						local CndtGroup = self:GetParent()
						CndtGroup:GetConditionSettings().Name2 = strtrim(self:GetText()) or ""
						CndtGroup:LoadAndDraw()
					</OnEditFocusLost>
				</Scripts>
			</EditBox>
			<CheckButton name="$parentCheck" inherits="TellMeWhen_CheckTemplate" parentKey="Check">
				<Size x="26" y="26"/>
				<Anchors>
					<Anchor point="RIGHT" relativeTo="$parentEditBox" x="5" y="-1"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent().EditBox:GetFrameLevel() + 1)
						self:GetNormalTexture():SetVertexColor(1, 0, 0, 1)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						local CndtGroup = self:GetParent()
						CndtGroup:GetConditionSettings().Checked = not not self:GetChecked()
						CndtGroup:LoadAndDraw()
					</OnClick>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentCheck2" inherits="TellMeWhen_CheckTemplate" parentKey="Check2">
				<Size x="26" y="26"/>
				<Anchors>
					<Anchor point="RIGHT" relativeTo="$parentEditBox2" x="5" y="-1"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent().EditBox:GetFrameLevel() + 1)
						self:GetNormalTexture():SetVertexColor(1, 0, 0, 1)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						local CndtGroup = self:GetParent()
						CndtGroup:GetConditionSettings().Checked2 = not not self:GetChecked()
						CndtGroup:LoadAndDraw()
					</OnClick>
				</Scripts>
			</CheckButton>

			<Frame name="$parentRunes" parentKey="Runes" hidden="true">
				<Size x="1" y="1"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentType" relativePoint="TOPRIGHT" x="8" y="8"/>
				</Anchors>
				<Frames>
					<Button name="$parentBlood1" parentKey="blood1" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="1">
						<Anchors>
							<Anchor point="TOPLEFT"/>
						</Anchors>
					</Button>
					<Button name="$parentBlood2" parentKey="blood2" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="2">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentBlood1" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
		 			<Button name="$parentFrost1" parentKey="frost1" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="5">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentBlood2" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentFrost2" parentKey="frost2" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="6">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentFrost1" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentUnholy1" parentKey="unholy1" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="3">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentFrost2" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentUnholy2" parentKey="unholy2" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="4">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentUnholy1" relativePoint="RIGHT"/>
						</Anchors>
					</Button>


					<Button name="$parentBlood1Death" parentKey="blood1death" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="7">
						<Anchors>
							<Anchor point="TOP" relativeTo="$parentBlood1" relativePoint="BOTTOM"/>
						</Anchors>
					</Button>
					<Button name="$parentBlood2Death" parentKey="blood2death" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="8">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentBlood1Death" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentFrost1Death" parentKey="frost1death" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="11">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentBlood2Death" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentFrost2Death" parentKey="frost2death" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="12">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentFrost1Death" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentUnholy1Death" parentKey="unholy1death" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="9">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentFrost2Death" relativePoint="RIGHT"/>
						</Anchors>
					</Button>
					<Button name="$parentUnholy2Death" parentKey="unholy2death" inherits="TellMeWhen_ConditionEditorRuneCheckTemplate" id="10">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentUnholy1Death" relativePoint="RIGHT"/>
						</Anchors>
					</Button>


				</Frames>
			</Frame>
			<CheckButton name="$parentRunesCheck" inherits="TellMeWhen_CheckTemplate" parentKey="RunesCheck">
				<Size x="26" y="26"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentRunesUnholy2" relativePoint="RIGHT" x="5"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetText(TMW.L["CONDITIONPANEL_RUNES_CHECK"])
						self.text:SetPoint("TOP", 0, -4)
						self.text:SetPoint("RIGHT", self:GetParent(), "RIGHT")
						self.text:SetHeight(40)
						self.text:SetMaxLines(5)
						self.text:SetJustifyV("TOP")
						
						TMW:TT(self, "CONDITIONPANEL_RUNES_CHECK", "CONDITIONPANEL_RUNES_CHECK_DESC")
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						local CndtGroup = self:GetParent()
						CndtGroup:GetConditionSettings().Checked = not not self:GetChecked()
						CndtGroup:LoadAndDraw()
					</OnClick>
				</Scripts>
			</CheckButton>
			
			<Button name="$parentAndOr" parentKey="AndOr">
				<Size x="40" y="20"/>
				<Anchors>
					<Anchor point="BOTTOM" relativePoint="TOP" x="1" y="-2"/>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentText" parentKey="text" justifyH="CENTER" inherits="GameFontHighlight">
							<Anchors>
								<Anchor point="CENTER"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						local AND, OR = TMW.L["CONDITIONPANEL_AND"], TMW.L["CONDITIONPANEL_OR"]
						local GRAY = "|cff222222"
						local SLASH = "/"
						local WHITE = "|r"
						local AND_t = WHITE .. AND .. GRAY .. SLASH .. OR
						local OR_t = GRAY .. AND .. SLASH .. WHITE .. OR

						function self:SetValue(value)
							local text

							if value == "AND" then
								text = AND_t
							elseif value == "OR" then
								text = OR_t
							end

							self.text:SetText(text)
							self.value = value
							self:SetWidth(self.text:GetWidth())
						end
						function self:GetValue()
							return self.value
						end
						
						TMW:TT(self, "CONDITIONPANEL_ANDOR", "CONDITIONPANEL_ANDOR_DESC")
						self:SetValue("AND")
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						TMW.HELP:Hide("CNDT_ANDOR_FIRSTSEE")
						
						if self.value == "AND" then
							self:SetValue("OR")
						elseif self.value == "OR" then
							self:SetValue("AND")
						end
						
						local CndtGroup = self:GetParent()
						CndtGroup:GetConditionSettings().AndOr = self:GetValue()
						CndtGroup:LoadAndDraw()
					</OnClick>
				</Scripts>
			</Button>

			<Frame name="$parentOpenParenthesis" parentKey="OpenParenthesis">
				<Size x="100" y="20"/>
				<Anchors>
					<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentAndOr" x="5" y="0"/>
				</Anchors>
				<Frames>
					<CheckButton name="$parent1" inherits="TellMeWhen_ConditionEditorParenthesisTemplate" id="1">
						<Anchors>
							<Anchor point="LEFT"/>
						</Anchors>
					</CheckButton>
					<CheckButton name="$parent2" inherits="TellMeWhen_ConditionEditorParenthesisTemplate" id="2">
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parent1" relativePoint="RIGHT" x="-8"/>
						</Anchors>
					</CheckButton>
				</Frames>
			</Frame>

			<Frame name="$parentCloseParenthesis" parentKey="CloseParenthesis">
				<Size x="100" y="20"/>
				<Anchors>
					<Anchor point="RIGHT" relativeTo="$parentAndOr" relativePoint="LEFT" x="-5" y="0"/>
					<Anchor point="TOP" relativeTo="$parent" relativePoint="BOTTOM" x="0" y="2"/>
				</Anchors>
				<Frames>
					<CheckButton name="$parent1" inherits="TellMeWhen_ConditionEditorParenthesisTemplate" id="1">
						<Anchors>
							<Anchor point="RIGHT"/>
						</Anchors>
					</CheckButton>
					<CheckButton name="$parent2" inherits="TellMeWhen_ConditionEditorParenthesisTemplate" id="2">
						<Anchors>
							<Anchor point="RIGHT" relativeTo="$parent1" relativePoint="LEFT" x="8"/>
						</Anchors>
					</CheckButton>
				</Frames>
			</Frame>

			<Button name="$parentUp" parentKey="Up">
				<Size x="15" y="15"/>
				<Anchors>
					<Anchor point="TOPLEFT" x="4" y="-32"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent():GetFrameLevel() + 2)
						TMW:TT(self, "METAPANEL_UP")
						self:SetScale(0.8)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						self:GetParent():UpOrDown(-1)
					</OnClick>
				</Scripts>
				<NormalTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up" alphaMode="ADD">
					<TexCoords left="0.21875" right="0.6875" top="0.34375" bottom="0.65625"/>
					<Color r=".7" g=".7" b=".7" a="1"/>
				</NormalTexture>
				<HighlightTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up" alphaMode="ADD">
					<TexCoords left="0.21875" right="0.6875" top="0.34375" bottom="0.65625"/>
				</HighlightTexture>
			</Button>
			<Button name="$parentDown" parentKey="Down">
				<Size x="15" y="15"/>
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentUp" relativePoint="BOTTOM" y="-3"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetFrameLevel(self:GetParent():GetFrameLevel() + 2)
						TMW:TT(self, "METAPANEL_DOWN")
						self:SetScale(0.8)
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						self:GetParent():UpOrDown(1)
					</OnClick>
				</Scripts>
				<NormalTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up" alphaMode="ADD">
					<TexCoords left="0.21875" right="0.6875" top="0.34375" bottom="0.65625"/>
					<Color r=".7" g=".7" b=".7" a="1"/>
				</NormalTexture>
				<HighlightTexture urgency="5" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up" alphaMode="ADD">
					<TexCoords left="0.21875" right="0.6875" top="0.34375" bottom="0.65625"/>
				</HighlightTexture>
			</Button>
			<Button name="$parentAddDelete" parentKey="AddDelete">
				<Size x="30" y="30"/>
				<Anchors>
					<Anchor point="TOPLEFT" x="-4" y="4"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:TT(self, "CONDITIONPANEL_REMOVE")
					</OnLoad>
					<OnClick>
						PlaySound("igMainMenuOptionCheckBoxOn")

						self:GetParent():DeleteHandler()
					</OnClick>
				</Scripts>
				<NormalTexture urgency="5" file="Interface\Buttons\UI-Panel-MinimizeButton-Up"/>
				<PushedTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Down"/>
				<HighlightTexture urgency="5" file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/>
			</Button>
		</Frames>
		<Layers>
			<Layer level="OVERLAY">
				<FontString name="$parentTextType" parentKey="TextType" inherits="GameFontNormalSmall" justifyH="CENTER">
					<Anchors>
						<Anchor point="BOTTOM" relativeto="$parentType" relativePoint="TOP" y="-0.5"/>
					</Anchors>
				</FontString>
				<FontString name="$parentTextUnit" parentKey="TextUnit" inherits="GameFontNormalSmall" justifyH="CENTER">
					<Anchors>
						<Anchor point="BOTTOM" relativeto="$parentUnit" relativePoint="TOP" y="5"/>
					</Anchors>
				</FontString>
				<FontString name="$parentTextIcon" parentKey="TextIcon" inherits="GameFontNormalSmall" justifyH="CENTER">
					<Anchors>
						<Anchor point="BOTTOM" relativeto="$parentIcon" relativePoint="TOP" y="-0.5"/>
					</Anchors>
				</FontString>
				<FontString name="$parentTextOperator" parentKey="TextOperator" inherits="GameFontNormalSmall" justifyH="CENTER">
					<Anchors>
						<Anchor point="BOTTOM" relativeto="$parentOperator" relativePoint="TOP" y="-0.5"/>
					</Anchors>
				</FontString>
				<FontString name="$parentTextValue" parentKey="TextValue" inherits="GameFontNormalSmall" justifyH="CENTER">
					<Anchors>
						<Anchor point="BOTTOMLEFT" relativeto="$parentOperator" relativePoint="TOPRIGHT" x="9" y="-0.5"/>
					</Anchors>
				</FontString>
				<FontString name="$parentValText" parentKey="ValText" inherits="GameFontNormalLarge" justifyH="LEFT">
					<Anchors>
						<Anchor point="LEFT" relativeto="$parentOperator" relativePoint="RIGHT" x="7" y="3"/>
					</Anchors>
				</FontString>
				<FontString name="$parentTextUnitDef" parentKey="TextUnitDef" inherits="GameFontNormalLarge" justifyH="CENTER">
					<Anchors>
						<Anchor point="CENTER" relativeto="$parentUnit" y="-0"/>
					</Anchors>
				</FontString>
				<FontString name="$parentSliderMid" parentKey="SliderMid" inherits="GameFontHighlightSmall">
					<Anchors>
						<Anchor point="TOP" relativeto="$parentSlider" relativePoint="BOTTOM" y="3"/>
					</Anchors>
				</FontString>

				<FontString name="$parentDeprecated" parentKey="Deprecated" inherits="GameFontNormal" hidden="true">
					<Size x="400"/>
					<Anchors>
						<Anchor point="BOTTOMLEFT" x="30" y="3"/>
						<Anchor point="BOTTOMRIGHT" x="-30" y="3"/>
					</Anchors>
				</FontString>
				<FontString name="$parentUnknown" parentKey="Unknown" inherits="GameFontNormal" >
					<Anchors>
						<Anchor point="LEFT" relativeTo="$parentType" relativePoint="RIGHT" x="12"/>
						<Anchor point="RIGHT" x="-5" />
						<Anchor point="TOP" y="-5"/>
						<Anchor point="BOTTOM" y="5"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
	</Frame>
	
	
	<Frame name="$parentConditions" parent="TellMeWhen_IconEditor" hidden="true" setAllPoints="true" parentKey="Conditions">
		<Frames>			
			<Frame name="$parentGroups" parentKey="Groups" >
				<Anchors>
					<Anchor point="TOPLEFT" y="-29" x="-5"/>
					<Anchor point="BOTTOMRIGHT" y="26"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:ConvertContainerToScrollFrame(self, false, -2)
						self.ScrollFrame.scrollStep = 40
						
						TMW.CNDT:CreateGroups(1)
						TMW.CNDT[1].AndOr:Hide()
						TMW.CNDT[1].CloseParenthesis:Hide()
						TMW.CNDT[1]:SetPoint("TOPLEFT", 12, -16)
					</OnLoad>
				</Scripts>
				<Frames>
					<Button name="$parentAddCondition" inherits="TellMeWhen_BorderedFrame" parentKey="AddCondition">
						<Size y="30"/>
						<Layers>
							<Layer level="OVERLAY">
								<FontString name="$parentText" parentKey="text" inherits="GameFontNormalSmall" justifyH="LEFT">
									<Anchors>
										<Anchor point="CENTER"/>
									</Anchors>
								</FontString>
								<Texture parentKey="Plus" file="Interface\PaperDollInfoFrame\Character-Plus">
									<Size x="20" y="20"/>
								</Texture>
								<Texture parentKey="Plus2" file="Interface\PaperDollInfoFrame\Character-Plus">
									<Size x="20" y="20"/>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								self.text:SetText(TMW.L["CONDITIONPANEL_ADD2"])
								TMW:TT(self, "CONDITIONPANEL_ADD")
								self.Plus:ClearAllPoints()
								self.Plus:SetPoint("RIGHT", self.text, "LEFT", -10, 0)
								self.Plus2:ClearAllPoints()
								self.Plus2:SetPoint("LEFT", self.text, "RIGHT", 10, 0)
							</OnLoad>
							<OnClick>
								PlaySound("igMainMenuOptionCheckBoxOn")
								
								TMW.CNDT:AddCondition(TMW.CNDT.settings)
								TMW.CNDT:LoadConfig()
							</OnClick>
						</Scripts>
						<HighlightTexture alphaMode="ADD" alpha="0.06">
							<Color r="1" g="1" b="1"/>
							<Anchors>
								<Anchor point="TOPLEFT" x="0.5" y="-0.5"/>
								<Anchor point="BOTTOMRIGHT" x="-0.5" y="0.5"/>
							</Anchors>
						</HighlightTexture>
					</Button>
				</Frames>
			</Frame>

		</Frames>
	</Frame>

</Ui>