<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">

	<!-- MacaroonProfiles, a World of WarcraftÂ® user interface addon. -->
	<!-- CopyrightÂ© 2006-2012 Connor H. Chenoweth, aka Maul - All rights reserved. -->
	
	<Frame name="$parentProfiles" parent="MacaroonProfileManager">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset x="10" y="-100"/>
			</Anchor>
			<Anchor point="BOTTOMRIGHT">
				<Offset x="-10" y="90"/>
			</Anchor>
		</Anchors>
		<Backdrop bgFile="Interface\ItemTextFrame\ItemText-Stone-TopLeft" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
			<EdgeSize>
				<AbsValue val="16"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="16"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="5" right="5" top="5" bottom="5"/>
			</BackgroundInsets>
		</Backdrop>
		<Frames>
			<ScrollFrame name="$parentScrollFrame" inherits="MacaroonScrollFrameTemplate1">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="5" y="-5"/>
					</Anchor>
					<Anchor point="BOTTOMRIGHT">
						<Offset x="-27" y="5"/>
					</Anchor>
				</Anchors>
				<ScrollChild>
					<Frame name="$parentScrollChildFrame">
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset x="5" y="-5"/>
							</Anchor>
							<Anchor point="BOTTOMRIGHT">
								<Offset x="-5" y="5"/>
							</Anchor>
						</Anchors>
					</Frame>
					<Scripts>
						<OnShow>
							--self:SetValue(0)
						</OnShow>
					</Scripts>
				</ScrollChild>
				<Scripts>
					<OnLoad>
						Macaroon.ProfilesScrollFrame_OnLoad(self)
					</OnLoad>
					<OnVerticalScroll>
						FauxScrollFrame_OnVerticalScroll(self, offset, 1, Macaroon.ProfilesScrollFrameUpdate)
					</OnVerticalScroll>
				</Scripts>
			</ScrollFrame>
		</Frames>
		<Scripts>
			<OnLoad>
				self:SetBackdropBorderColor(0.5, 0.5, 0.5)
				self:SetBackdropColor(0,0,0,0.7)
				self:SetFrameLevel(self:GetParent():GetFrameLevel())
				self.elapsed = 0
			</OnLoad>
			<OnShow>
				self.elapsed = 0
				Macaroon.ProfilesScrollFrameUpdate()						
			</OnShow>
			<OnUpdate>
				self.elapsed = self.elapsed + elapsed
				
				if (self.elapsed &gt; 0.25) then
					Macaroon.ProfilesScrollFrameUpdate()
					self.elapsed = 0
					self:SetScript("OnUpdate", nil)
				end
			</OnUpdate>
		</Scripts>
	</Frame>

	<Frame name="$parentOptions" parent="MacaroonProfileManager">
		<Anchors>
			<Anchor point="TOPLEFT">
				<Offset x="10" y="-10"/>
			</Anchor>
			<Anchor point="BOTTOMRIGHT" relativeTo="$parentProfiles" relativePoint="TOPRIGHT">
				<Offset x="0" y="5"/>
			</Anchor>
		</Anchors>
		<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
			<EdgeSize>
				<AbsValue val="16"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="16"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="5" right="5" top="5" bottom="5"/>
			</BackgroundInsets>
		</Backdrop>
		<Frames>
			<Frame name="$parentTop" parentKey="top">
				<Size x="195" y="22"/>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="5" y="-7"/>
					</Anchor>
					<Anchor point="TOPRIGHT">
						<Offset x="-5" y="-29"/>
					</Anchor>					
				</Anchors>			
				<Frames>
					<EditBox name="$parentNameEdit" parentKey="nameedit" inherits="MacaroonEditBoxTemplate2">
						<Size x="195" y="22"/>
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset x="0" y="0"/>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnShow>
								self.text:ClearAllPoints()
								self.text:SetPoint("CENTER")								
								self.text:SetText(Macaroon.Strings.P_NAME_EDIT)
								self.parent = self:GetParent()
								
								self:SetJustifyH("CENTER")
							</OnShow>
							<OnHide>
								self:SetText("")
							</OnHide>
							<OnEditFocusGained>
								self.text:SetText("")
							</OnEditFocusGained>
							<OnEditFocusLost>
								if (strlen(self:GetText()) &lt; 1) then
									self.text:SetText(Macaroon.Strings.P_NAME_EDIT)
								end
							</OnEditFocusLost>
							<OnTextChanged>
								if (strlen(self:GetText()) &lt; 1) then
									self.parent.save:Disable()
									self.parent.load:Disable()
									self.parent.delete:Disable()
								else
									self.parent.save:Enable()
									self.parent.load:Enable()
									self.parent.delete:Enable()								
								end							
							</OnTextChanged>
						</Scripts>
					</EditBox>
					<Button name="$parentSave" parentKey="save" inherits="MacaroonButtonTemplate1">
						<Size x="55" y="22"/>
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentNameEdit" relativePoint="RIGHT">
								<Offset x="7" y="0"/>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								self.text:SetText(Macaroon.Strings.P_SAVE)
								self.confirm = Macaroon.Strings.P_SAVE_CONFIRM
								self.namedit = self:GetParent().nameedit
								self.func = Macaroon.SaveProfile
								self.save = true
							</OnLoad>
							<OnClick>
								Macaroon.Profiles_ConfirmAction(self)
								--Macaroon.SaveProfile(self.namedit:GetText())
							</OnClick>
							<OnDisable>
								self.text:SetTextColor(0.5,0.5,0.5)
							</OnDisable>
							<OnEnable>
								self.text:SetTextColor(1,0.82,0)
							</OnEnable>							
						</Scripts>
					</Button>
					<Button name="$parentLoad" parentKey="load" inherits="MacaroonButtonTemplate1">
						<Size x="55" y="22"/>
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentSave" relativePoint="RIGHT">
								<Offset x="7" y="0"/>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								self.text:SetText(Macaroon.Strings.P_LOAD)
								self.confirm = Macaroon.Strings.P_LOAD_CONFIRM
								self.namedit = self:GetParent().nameedit
								self.func = Macaroon.LoadProfile
								self.load = true
							</OnLoad>
							<OnClick>
								Macaroon.Profiles_ConfirmAction(self)
								--Macaroon.LoadProfile(self.namedit:GetText())
							</OnClick>
							<OnDisable>
								self.text:SetTextColor(0.5,0.5,0.5)
							</OnDisable>
							<OnEnable>
								self.text:SetTextColor(1,0.82,0)
							</OnEnable>														
						</Scripts>
					</Button>
					<Button name="$parentDelete" parentKey="delete" inherits="MacaroonButtonTemplate1">
						<Size x="55" y="22"/>
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentLoad" relativePoint="RIGHT">
								<Offset x="7" y="0"/>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								self.text:SetText(Macaroon.Strings.P_DELETE)
								self.confirm = Macaroon.Strings.P_DELETE_CONFIRM
								self.namedit = self:GetParent().nameedit
								self.func = Macaroon.DeleteProfile
								self.delete = true
							</OnLoad>
							<OnClick>
								Macaroon.Profiles_ConfirmAction(self)
								--Macaroon.DeleteProfile(self.namedit:GetText())
							</OnClick>
							<OnDisable>
								self.text:SetTextColor(0.5,0.5,0.5)
							</OnDisable>
							<OnEnable>
								self.text:SetTextColor(1,0.82,0)
							</OnEnable>														
						</Scripts>
					</Button>
				</Frames>
				<Scripts>
					<OnShow>
						Macaroon.ProfilesScrollFrameUpdate()
					</OnShow>
				</Scripts>
			</Frame>
			<Frame name="$parentConfirm" parentKey="confirm" hidden="true">
				<Size x="195" y="22"/>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="5" y="-7"/>
					</Anchor>
					<Anchor point="TOPRIGHT">
						<Offset x="-5" y="-29"/>
					</Anchor>					
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentTitle" parentKey="title" inherits="GameFontNormal" justifyH="CENTER">
							<Anchors>
								<Anchor point="CENTER">
									<Offset x="0" y="0"/>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>														
				<Frames>
					<Button name="$parentConfirmYes" parentKey="yes" inherits="MacaroonButtonTemplate1">
						<Size x="60" y="22"/>
						<Anchors>
							<Anchor point="RIGHT" relativeTo="$parentTitle" relativePoint="LEFT">
								<Offset x="-15" y="0"/>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								self.parent = self:GetParent()
								self.type = "yes"
								self.text:SetText(Macaroon.Strings.CONFIRM_YES)
							</OnLoad>
							<OnClick>
								Macaroon.Profiles_ConfirmYes(self)
							</OnClick>
						</Scripts>
					</Button>
					<Button name="$parentConfirmNo" parentKey="no" inherits="MacaroonButtonTemplate1">
						<Size x="60" y="22"/>
						<Anchors>
							<Anchor point="LEFT" relativeTo="$parentTitle" relativePoint="RIGHT">
								<Offset x="15" y="0"/>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								self.parent = self:GetParent()
								self.type = "no"
								self.text:SetText(Macaroon.Strings.CONFIRM_NO)
							</OnLoad>
							<OnClick>
								Macaroon.Profiles_ConfirmNo(self)
							</OnClick>
						</Scripts>
					</Button>
				</Frames>
				<Scripts>
					<OnLoad>						
						self.parent = self:GetParent()
						self.title:SetText(Macaroon.Strings.CONFIRM)
					</OnLoad>
				</Scripts>				
			</Frame>			
			<Frame name="$parentNote" parentKey="note">
				<Size x="195" y="48"/>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="5" y="-30"/>
					</Anchor>
				</Anchors>
				<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
					<EdgeSize>
						<AbsValue val="16"/>
					</EdgeSize>
					<TileSize>
						<AbsValue val="16"/>
					</TileSize>
					<BackgroundInsets>
						<AbsInset left="5" right="5" top="5" bottom="5"/>
					</BackgroundInsets>
				</Backdrop>
				<Frames>
					<EditBox name="$parentEdit" parentKey="edit" multiLine="true" letters="70" historyLines="0" numeric="false" autoFocus="false" nonspacewrap="true">
						<Size x="195" y="48"/>
						<Anchors>
							<Anchor point="TOPLEFT">
								<Offset x="5" y="-5"/>
							</Anchor>
							<Anchor point="BOTTOMRIGHT">
								<Offset x="-5" y="5"/>
							</Anchor>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<FontString name="$parentText" parentKey="text" inherits="GameFontNormalSmall" nonspacewrap="true">
									<Anchors>
										<Anchor point="CENTER"/>
									</Anchors>
								</FontString>
							</Layer>
						</Layers>
						<Scripts>
							<OnShow>
								self.text:SetText(Macaroon.Strings.P_NOTE_EDIT)
							</OnShow>
							<OnHide>
								self:SetText("")
							</OnHide>
							<OnTabPressed>
								self:ClearFocus()
							</OnTabPressed>
							<OnEscapePressed>
								self:ClearFocus()
							</OnEscapePressed>
							<OnEditFocusGained>
								self.text:SetText("")
							</OnEditFocusGained>
							<OnEditFocusLost>
								if (strlen(self:GetText()) &lt; 1) then
									self.text:SetText(Macaroon.Strings.P_NOTE_EDIT)
								end
							</OnEditFocusLost>
						</Scripts>
						<FontString name="$parentFont" justifyH="LEFT" inherits="GameFontHighlightSmall"/>
					</EditBox>
				</Frames>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.5, 0.5, 0.5)
						self:SetBackdropColor(0,0,0,0.5)
						self:SetFrameLevel(self:GetParent():GetFrameLevel())
					</OnLoad>
				</Scripts>
			</Frame>
			<CheckButton name="$parentLayout" parentKey="layout" inherits="MacaroonOptionCBTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentNote" relativePoint="TOPRIGHT">
						<Offset x="5" y="-5"/>
					</Anchor>
				</Anchors>	
				<Scripts>
					<OnLoad>
						self.text:SetText(Macaroon.Strings.P_LAYOUT)
					</OnLoad>
					<OnClick>
						
					</OnClick>
					<OnShow>
						
					</OnShow>
				</Scripts>				
			</CheckButton>
			<CheckButton name="$parentSettings" parentKey="settings" inherits="MacaroonOptionCBTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentLayout" relativePoint="RIGHT">
						<Offset x="78" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetText(Macaroon.Strings.P_SETTINGS)
					</OnLoad>
					<OnClick>
						
					</OnClick>
					<OnShow>
						
					</OnShow>
				</Scripts>								
			</CheckButton>						
			<CheckButton name="$parentButtons" parentKey="buttons" inherits="MacaroonOptionCBTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentLayout" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-3"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetText(Macaroon.Strings.P_BUTTONS)
					</OnLoad>
					<OnClick>
						
					</OnClick>
					<OnShow>
						
					</OnShow>
				</Scripts>								
			</CheckButton>			
			<CheckButton name="$parentButtonData" parentKey="buttondata" inherits="MacaroonOptionCBTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentButtons" relativePoint="RIGHT">
						<Offset x="78" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetText(Macaroon.Strings.P_BUTTONDATA)
					</OnLoad>
					<OnClick>
						
					</OnClick>
					<OnShow>
						
					</OnShow>
				</Scripts>								
			</CheckButton>						
		</Frames>
		<Scripts>
			<OnLoad>
				self:SetBackdropBorderColor(0.5, 0.5, 0.5)
				self:SetBackdropColor(0,0,0,0.5)
				self:SetFrameLevel(self:GetParent():GetFrameLevel())
			</OnLoad>
			<OnShow>
				self.top:Show()
				self.confirm:Hide()
			</OnShow>
		</Scripts>
	</Frame>
		
	<Frame name="$parentSpecs" parent="MacaroonProfileManager">
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="$parentProfiles" relativePoint="BOTTOMLEFT">
				<Offset x="0" y="-5"/>
			</Anchor>
			<Anchor point="BOTTOMRIGHT">
				<Offset x="-10" y="10"/>
			</Anchor>			
		</Anchors>
		<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
			<EdgeSize>
				<AbsValue val="16"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="16"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="5" right="5" top="5" bottom="5"/>
			</BackgroundInsets>
		</Backdrop>
		<Frames>
			<CheckButton name="$parentUseProfiles" inherits="MacaroonOptionCBTemplate">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="7" y="-7"/>
					</Anchor>
				</Anchors>	
				<Scripts>
					<OnLoad>
						self.text:SetText(Macaroon.Strings.P_USEPROFILES)
					</OnLoad>
					<OnClick>
						if (self:GetChecked()) then
							MacaroonSpecProfiles.enabled = true
						else
							MacaroonSpecProfiles.enabled = false
						end
					</OnClick>
					<OnShow>
						self:SetChecked(MacaroonSpecProfiles.enabled)
						
						if (not GetNumTalentGroups) then
							self:Disable()
							self.text:SetTextColor(0.5,0.5,0.5)
						elseif (GetNumTalentGroups and GetNumTalentGroups() &lt; 2) then
							self:Disable()
							self.text:SetTextColor(0.5,0.5,0.5)
						else
							self:Enable()
							self.text:SetTextColor(1,0.82,0)
						end						
					</OnShow>
				</Scripts>				
			</CheckButton>		
			<EditBox name="$parentPrimary" inherits="MacaroonEditBoxTemplate2">
				<Size x="190" y="22"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT">
						<Offset x="5" y="7"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnShow>
						self.text:ClearAllPoints()
						self.text:SetPoint("BOTTOM", self, "TOP", 0, 2)
						self.text:SetText(Macaroon.Strings.P_SPEC1_EDIT)						
						
						self:SetJustifyH("CENTER")
						self:SetText(MacaroonSpecProfiles[1])
						self:SetCursorPosition(0)
					</OnShow>
					<OnTextChanged>					
						local name = self:GetText()
						
						self:SetTextColor(1,1,1)
						
						if (MacaroonProfiles[name]) then
							MacaroonSpecProfiles[1] = name
						else
							self:SetTextColor(1,0,0)
						end							
					</OnTextChanged>
					<OnEditFocusLost>
						self:HighlightText(0, 0)
						self:GetParent().currFocus = nil
					</OnEditFocusLost>
					<OnEditFocusGained>
						self:HighlightText()
						self:GetParent().currFocus = self
					</OnEditFocusGained>
				</Scripts>
			</EditBox>
			<EditBox name="$parentSecondary" inherits="MacaroonEditBoxTemplate2">
				<Size x="190" y="22"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT">
						<Offset x="-5" y="7"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnShow>
						self.text:ClearAllPoints()
						self.text:SetPoint("BOTTOM", self, "TOP", 0, 2)						
						self.text:SetText(Macaroon.Strings.P_SPEC2_EDIT)						
						
						self:SetJustifyH("CENTER")
						self:SetText(MacaroonSpecProfiles[2])
						self:SetCursorPosition(0)
					</OnShow>
					<OnTextChanged>					
						local name = self:GetText()
						
						self:SetTextColor(1,1,1)
						
						if (MacaroonProfiles[name]) then
							MacaroonSpecProfiles[2] = name
						else
							self:SetTextColor(1,0,0)
						end							
					</OnTextChanged>
					<OnEditFocusLost>
						self:HighlightText(0, 0)
						self:GetParent().currFocus = nil
					</OnEditFocusLost>
					<OnEditFocusGained>
						self:HighlightText()
						self:GetParent().currFocus = self
					</OnEditFocusGained>					
				</Scripts>
			</EditBox>
		
		</Frames>
		<Scripts>
			<OnLoad>
				self:SetBackdropBorderColor(0.5, 0.5, 0.5)
				self:SetBackdropColor(0,0,0,0.5)
				self:SetFrameLevel(self:GetParent():GetFrameLevel())
			</OnLoad>
		</Scripts>
	</Frame>
</Ui>
