<Ui>

	<CheckButton name="ClassicQuestLogCheckButtonTemplate" inherits="UICheckButtonTemplate" virtual="true">
		<Size x="24" y="24"/>
		<Scripts>
			<OnEnter>
				ClassicQuestLog.OptionOnEnter(self)
			</OnEnter>
			<OnLeave function="GameTooltip_Hide"/>
			<OnClick>
				ClassicQuestLog.OptionOnClick(self)
			</OnClick>
		</Scripts>
	</CheckButton>

	<Button name="ClassicQuestLogListTemplate" virtual="true" text="Quest Title Example">
		<Size x="299" y="16"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="selected" file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD"/>
			</Layer>
			<Layer level="ARTWORK">
				<!-- number to left of quest indicating how many in group are on same quest -->
				<FontString parentKey="groupMates" inherits="GameFontNormalSmall" justifyH="RIGHT">
					<Size x="0" y="16"/>
					<Anchors>
						<Anchor point="LEFT" x="8" y="0"/>
					</Anchors>
				</FontString>
				<!-- icon for the "tag" (Daily) (Account) (Raid) (Complete) etc -->
				<Texture parentKey="tag" file="Interface\QuestFrame\QuestTypeIcons">
					<Size x="18" y="18"/>
					<Anchors>
						<Anchor point="RIGHT" x="-2" y="0"/>
					</Anchors>
				</Texture>
				<!-- checkmark to note tracked quests appears to right of normalText (anchored in the UpdateLogList) -->
				<Texture parentKey="check" file="Interface\Buttons\UI-CheckBox-Check">
					<Size x="16" y="16"/>
					<Anchors>
						<Anchor point="LEFT"/>
					</Anchors> 
				</Texture>
			</Layer>
		</Layers>
		<!-- quest title/header normalText is shifted to right 20 -->
		<ButtonText parentKey="normalText" nonspacewrap="true">
			<Size x="0" y="10"/>
			<Anchors>
				<Anchor point="LEFT" x="20" y="0"/>
			</Anchors> 
		</ButtonText>
		<NormalTexture file="Interface\Buttons\UI-MinusButton-UP">
			<Size x="16" y="16"/>
			<Anchors>
				<Anchor point="LEFT" x="3" y="0"/>
			</Anchors>
		</NormalTexture>
		<HighlightTexture file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD">
			<Size x="16" y="16"/>
			<Anchors>
				<Anchor point="LEFT" x="3" y="0"/>
			</Anchors>
		</HighlightTexture>
		<NormalFont style="GameFontNormalLeft"/>
		<HighlightFont style="GameFontHighlightLeft"/>
		<DisabledFont style="GameFontHighlightLeft"/>
		<Scripts>
			<OnLoad>
				self.check:SetPoint("LEFT",self.normalText,"RIGHT")
			</OnLoad>
			<OnClick>
				ClassicQuestLog.ListEntryOnClick(self)
			</OnClick>
			<OnEnter>
				ClassicQuestLog.ListEntryOnEnter(self)
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide()
			</OnLeave>
		</Scripts>
	</Button>

	<Frame name="ClassicQuestLog" parent="UIParent" toplevel="true" clampedToScreen="true" enableMouse="true" movable="true" resizable="true" inherits="ButtonFrameTemplate" hidden="true">
		<Size x="667" y="496"/>
		<Anchors>
			<Anchor point="CENTER"/>
		</Anchors>
		<Layers>
			<Layer level="OVERLAY" textureSubLevel="-1">
				<Texture parentKey="portraitIcon" file="Interface\QuestFrame\UI-QuestLog-BookIcon">
					<Size x="64" y="64"/>
					<Anchors>
						<Anchor point="TOPLEFT" x="-9" y="9"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND">
				<!-- temporary fix for lua error in QuestInfo.lua:45 (questFrame.SealMaterialBG is nil) -->
				<Texture parentKey="SealMaterialBG" hidden="true"/>
				<FontString parentKey="title" inherits="GameFontNormal" text="Classic Quest Log">
					<Anchors>
						<Anchor point="TOP" x="0" y="-5"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Frames>
			<!-- this is for a one-frame OnUpdate to run UpdateLog (so the function doesn't run multiple times in a frame -->
			<Frame parentKey="update" hidden="true">
				<Scripts>
					<OnUpdate>
						self:GetParent():UpdateLog()
					</OnUpdate>
				</Scripts>
			</Frame>
			<!-- close button in bottomright -->
			<Button parentKey="close" inherits="MagicButtonTemplate" text="CLOSE">
				<Size x="110" y="22"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT" x="-6" y="4"/>
				</Anchors>
				<Scripts>
					<OnClick>
						ClassicQuestLog:ToggleWindow()
					</OnClick>
				</Scripts>
			</Button>
			<!-- abandon button in bottomleft -->
			<Button parentKey="abandon" inherits="MagicButtonTemplate" text="ABANDON_QUEST_ABBREV">
				<Size x="110" y="22"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" x="4" y="4"/>
				</Anchors>
				<Scripts>
					<OnClick>
						SetAbandonQuest();
						local items = GetAbandonQuestItems();
						if ( items ) then
							StaticPopup_Hide("ABANDON_QUEST");
							StaticPopup_Show("ABANDON_QUEST_WITH_ITEMS", GetAbandonQuestName(), items);
						else
							StaticPopup_Hide("ABANDON_QUEST_WITH_ITEMS");
							StaticPopup_Show("ABANDON_QUEST", GetAbandonQuestName());
						end
					</OnClick>
					<OnEnter>
						GameTooltip_AddNewbieTip(self, ABANDON_QUEST, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_ABANDONQUEST, 1);
					</OnEnter>
					<OnLeave function="GameTooltip_Hide"/>
				</Scripts>
			</Button>
			<Button parentKey="push" inherits="MagicButtonTemplate" text="SHARE_QUEST_ABBREV">
				<Size x="110" y="22"/>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.abandon" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnClick>
						QuestLogPushQuest()
						PlaySound(PlaySoundKitID and "igQuestLogOpen" or SOUNDKIT.IG_QUEST_LOG_OPEN)
					</OnClick>
					<OnEnter>
						GameTooltip_AddNewbieTip(self, SHARE_QUEST, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_SHAREQUEST, 1)
					</OnEnter>
					<OnLeave function="GameTooltip_Hide"/>
				</Scripts>
			</Button>
			<Button parentKey="track" inherits="MagicButtonTemplate" text="TRACK_QUEST_ABBREV">
				<Size x="110" y="22"/>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.push" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnClick>
						ClassicQuestLog:ToggleWatch()
					</OnClick>
					<OnEnter>
						GameTooltip_AddNewbieTip(self, TRACK_QUEST, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_TRACKQUEST, 1)
					</OnEnter>
					<OnLeave function="GameTooltip_Hide"/>
				</Scripts>
			</Button>
			<Button parentKey="options" inherits="MagicButtonTemplate" text="OPTIONS">
				<Size x="110" y="22"/>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.track" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnClick>
						ClassicQuestLog:ToggleOptions()
					</OnClick>
				</Scripts>
			</Button>

			<!-- frame with spiderwebs over left page, to show when quest log is empty -->
			<Frame parentKey="emptyLog" hidden="true">
				<Size x="305" y="340"/>
				<Anchors>
					<Anchor point="LEFT" x="32" y="-16"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture file="Interface\QuestFrame\UI-QuestLog-Empty-TopLeft">
							<Size x="256" y="256"/>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
						</Texture>
						<Texture file="Interface\QuestFrame\UI-QuestLog-Empty-BotLeft">
							<Size x="256" y="84"/>
							<Anchors>
								<Anchor point="BOTTOMLEFT"/>
							</Anchors>
							<TexCoords left="0" right="1" top="0" bottom="0.65625"/>
						</Texture>
						<Texture file="Interface\QuestFrame\UI-QuestLog-Empty-TopRight">
							<Size x="49" y="256"/>
							<Anchors>
								<Anchor point="TOPRIGHT"/>
							</Anchors>
							<TexCoords left="0" right="0.765625" top="0" bottom="1"/>
						</Texture>
						<Texture file="Interface\QuestFrame\UI-QuestLog-Empty-BotRight">
							<Size x="49" y="84"/>
							<Anchors>
								<Anchor point="BOTTOMRIGHT"/>
							</Anchors>
							<TexCoords left="0" right="0.765625" top="0" bottom="0.65625"/>
						</Texture>
					</Layer>
					<Layer level="ARTWORK">
						<FontString name="QuestLogNoQuestsText" inherits="GameFontHighlight" text="QUESTLOG_NO_QUESTS_TEXT">
							<Size x="200" y="0"/>
							<Anchors>
								<Anchor point="CENTER" x="-6" y="16"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
			</Frame>
			<Frame parentKey="count" inherits="InsetFrameTemplate3">
				<Size x="120" y="20"/>
				<Anchors>
					<Anchor point="TOPLEFT" x="132" y="-33"/>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString parentKey="text" inherits="GameFontNormalSmall" text="Quests: 0/25">
							<Anchors>
								<Anchor point="CENTER"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
			</Frame>
			<Button parentKey="mapButton">
				<Size x="48" y="32"/>
				<Anchors>
					<Anchor point="TOPRIGHT" x="-24" y="-27"/>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentText" inherits="GameFontNormal" text="SHOW_MAP" parentKey="text">
							<Anchors>
								<Anchor point="RIGHT" relativePoint="LEFT" x="0" y="0"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<NormalTexture file="Interface\QuestFrame\UI-QuestMap_Button">
					<TexCoords left="0.125" right="0.875" top="0" bottom="0.5"/>
				</NormalTexture>
				<PushedTexture file="Interface\QuestFrame\UI-QuestMap_Button">
					<TexCoords left="0.125" right="0.875" top="0.5" bottom="1.0"/>
				</PushedTexture>
				<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD">
					<Size x="36" y="25"/>
					<Anchors>
						<Anchor point="RIGHT" x="-7" y="0"/>
					</Anchors>
				</HighlightTexture>
				<Scripts>
					<OnClick>
						ClassicQuestLog:ShowMap()
					</OnClick>
				</Scripts>
			</Button>
			<!-- the actual log scrollFrame in left panel -->
			<ScrollFrame parentKey="scrollFrame" name="ClassicQuestLogScrollFrame" inherits="HybridScrollFrameTemplate">
				<Size x="305" y="700"/> <!-- 403 is standard height; 700 is initial height to allow enough buttons created -->
				<Anchors>
					<Anchor point="TOPLEFT" x="6" y="-64"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="top" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
							<Size x="29" y="102"/>
							<Anchors>
								<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="-6" y="5"/>
							</Anchors>
							<TexCoords left="0" right="0.445" top="0" bottom="0.4"/>
						</Texture>
						<Texture parentKey="bottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
							<Size x="29" y="106"/>
							<Anchors>
								<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" x="-6" y="-2"/>
							</Anchors>
							<TexCoords left="0.515625" right="0.960625" top="0" bottom="0.4140625"/>
						</Texture>
						<Texture parentKey="middle" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
							<Size x="29" y="1"/>
							<Anchors>
								<Anchor point="TOP" relativeKey="$parent.top" relativePoint="BOTTOM"/>
								<Anchor point="BOTTOM" relativeKey="$parent.bottom" relativePoint="TOP"/>
							</Anchors>
							<TexCoords left="0" right="0.445" top=".75" bottom="1.0"/>
						</Texture>
					</Layer>
					<Layer level="BORDER">
						<Texture parentKey="BG" file="Interface\QuestFrame\QuestBookBG">
							<Anchors>
								<Anchor point="TOPLEFT" x="0" y="1"/>
								<Anchor point="BOTTOMRIGHT" x="-2" y="-2"/>
							</Anchors>
							<TexCoords left="0" right="0.5859375" top="0" bottom="0.65625"/>
						</Texture>
					</Layer>
				</Layers>
				<Frames>
					<!-- expand/collapse all button -->
					<Button parentKey="expandAll">
						<Size x="64" y="32"/>
						<Anchors>
							<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="48" y="0"/>
						</Anchors>
						<Layers>
							<Layer level="BACKGROUND">
								<Texture file="Interface\QuestFrame\UI-QuestLogSortTab-Left">
									<Size x="8" y="32"/>
									<Anchors>
										<Anchor point="LEFT"/>
									</Anchors>
								</Texture>
								<Texture file="Interface\QuestFrame\UI-QuestLogSortTab-Right">
									<Size x="8" y="32"/>
									<Anchors>
										<Anchor point="RIGHT"/>
									</Anchors>
								</Texture>
								<Texture file="Interface\QuestFrame\UI-QuestLogSortTab-Middle">
									<Size x="0" y="32"/>
									<Anchors>
										<Anchor point="LEFT" x="8" y="0"/>
										<Anchor point="RIGHT" x="-8" y="0"/>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<!-- quest title/header normalText is shifted to right 20 -->
						<ButtonText parentKey="normalText" text="ALL">
							<Size x="0" y="10"/>
								<Anchors>
								<Anchor point="LEFT" x="28" y="-4"/>
							</Anchors> 
						</ButtonText>
						<NormalTexture file="Interface\Buttons\UI-MinusButton-UP">
							<Size x="16" y="16"/>
							<Anchors>
								<Anchor point="LEFT" x="11" y="-4"/>
							</Anchors>
						</NormalTexture>
						<HighlightTexture file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD">
							<Size x="16" y="16"/>
							<Anchors>
								<Anchor point="LEFT" x="11" y="-4"/>
							</Anchors>
						</HighlightTexture>
						<NormalFont style="GameFontNormalLeft"/>
						<HighlightFont style="GameFontHighlightLeft"/>
						<DisabledFont style="GameFontHighlightLeft"/>
						<Scripts>
							<OnClick>
								ClassicQuestLog:ExpandAllOnClick()
							</OnClick>
						</Scripts>
					</Button>
					<Slider name="$parentScrollBar" inherits="HybridScrollBarTemplate" parentKey="scrollBar">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="0" y="-13"/>
							<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" x="0" y="14"/>
						</Anchors>
						<Scripts>
							<OnLoad>
								local name = self:GetName();
								_G[name.."BG"]:Hide();
								_G[name.."Top"]:Hide();
								_G[name.."Bottom"]:Hide();
								_G[name.."Middle"]:Hide();
								self.doNotHide = true;
							</OnLoad>
						</Scripts>
					</Slider>
					<Frame parentKey="highlightFrame" hidden="true">
						<Anchors>
							<Anchor point="TOPLEFT"/>
							<Anchor point="BOTTOMRIGHT"/>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<Texture parentKey="texture" file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD"/>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad>
								self:SetParent(nil);
							</OnLoad>
						</Scripts>
					</Frame>
				</Frames>
			</ScrollFrame>
			<ScrollFrame parentKey="detail" name="ClassicQuestLogDetailScrollFrame" inherits="QuestScrollFrameTemplate">
				<Size x="298" y="403"/> <!-- was 403 -->
				<Anchors>
					<Anchor point="TOPRIGHT" x="-32" y="-63"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="DetailBG" file="Interface\QuestFrame\QuestBG">
							<Anchors>
								<Anchor point="TOPLEFT" x="-2" y="1"/>
								<Anchor point="BOTTOMRIGHT" x="1" y="-1"/>
							</Anchors>
							<TexCoords left="0" right="0.5859375" top="0" bottom="0.65625"/>
						</Texture>
					</Layer>
				</Layers>
				<ScrollChild>
					<Frame name="ClassicQuestLogDetailScrollChildFrame">
						<Size x="298" y="403"/>
					</Frame>
				</ScrollChild>
			</ScrollFrame>
			<Button parentKey="resizeGrip">
				<Size x="0" y="12"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="4" y="-1"/>
					<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="-4" y="-1"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture file="Interface\Buttons\UI-Silver-Button-Up">
							<Size x="12" y="12"/>
							<Anchors>
								<Anchor point="LEFT"/>
							</Anchors>
							<TexCoords left="0" right="0.09375" top="0.4375" bottom="0.8125"/>
						</Texture>
						<Texture file="Interface\Buttons\UI-Silver-Button-Up">
							<Size x="12" y="12"/>
							<Anchors>
								<Anchor point="RIGHT"/>
							</Anchors>
							<TexCoords left="0.53125" right="0.625" top="0.4375" bottom="0.8125"/>
						</Texture>
						<Texture file="Interface\Buttons\UI-Silver-Button-Up">
							<Size x="0" y="12"/>
							<Anchors>
								<Anchor point="LEFT" x="12" y="0"/>
								<Anchor point="RIGHT" x="-12" y="0"/>
							</Anchors>
							<TexCoords left="0.09375" right="0.53125" top="0.4375" bottom="0.8125"/>
						</Texture>
					</Layer>
				</Layers>
				<NormalTexture>
					<Size x="0" y="2"/>
					<Anchors>
						<Anchor point="LEFT" x="6" y="2"/>
						<Anchor point="RIGHT" x="-6" y="2"/>
					</Anchors>
					<Color r="0.25" g="0.25" b="0.25"/>
				</NormalTexture>
				<HighlightTexture alphaMode="ADD">
					<Size x="0" y="2"/>
					<Anchors>
						<Anchor point="LEFT" x="6" y="2"/>
						<Anchor point="RIGHT" x="-6" y="2"/>
					</Anchors>
					<Color r="0.25" g="0.25" b="0.25"/>
				</HighlightTexture>
				<PushedTexture>
					<Size x="0" y="2"/>
					<Anchors>
						<Anchor point="LEFT" x="6" y="2"/>
						<Anchor point="RIGHT" x="-6" y="2"/>
					</Anchors>
					<Color r="0.5" g="0.5" b="0.5"/>
				</PushedTexture>
				<Scripts>
					<OnMouseDown>
						self:GetParent():StartSizing()
					</OnMouseDown>
					<OnMouseUp>
						self:GetParent():StopMovingOrSizing()
						self:GetParent():SetUserPlaced(true)
					</OnMouseUp>
				</Scripts>
			</Button>

			<Frame parentKey="optionsFrame" enableMouse="true" inherits="BasicFrameTemplateWithInset" hidden="true">
				<Size x="220" y="208"/>
				<Anchors>
					<Anchor point="BOTTOM" relativeKey="$parent.options" relativePoint="TOP" x="0" y="0"/>
				</Anchors>
				<Frames>
					<CheckButton parentKey="UndockWindow" inherits="ClassicQuestLogCheckButtonTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" x="16" y="-32"/>
						</Anchors>
					</CheckButton>
					<CheckButton parentKey="LockWindow" inherits="ClassicQuestLogCheckButtonTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.UndockWindow" relativePoint="BOTTOMLEFT" x="16" y="-4"/>
						</Anchors>
					</CheckButton>
					<CheckButton parentKey="ShowResizeGrip" inherits="ClassicQuestLogCheckButtonTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.LockWindow" relativePoint="BOTTOMLEFT" x="-16" y="-4"/>
						</Anchors>
					</CheckButton>
					<CheckButton parentKey="ShowLevels" inherits="ClassicQuestLogCheckButtonTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.ShowResizeGrip" relativePoint="BOTTOMLEFT" x="0" y="-4"/>
						</Anchors>
					</CheckButton>
					<CheckButton parentKey="ShowTooltips" inherits="ClassicQuestLogCheckButtonTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.ShowLevels" relativePoint="BOTTOMLEFT" x="0" y="-4"/>
						</Anchors>
					</CheckButton>
					<CheckButton parentKey="SolidBackground" inherits="ClassicQuestLogCheckButtonTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.ShowTooltips" relativePoint="BOTTOMLEFT" x="0" y="-4"/>
						</Anchors>
					</CheckButton>
					<CheckButton parentKey="UseClassicSkin" inherits="ClassicQuestLogCheckButtonTemplate" hidden="true">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.SolidBackground" relativePoint="BOTTOMLEFT" x="0" y="-4"/>
						</Anchors>
					</CheckButton>
				</Frames>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad>
				if select(4,GetBuildInfo())>80000 then
					self:RegisterEvent("PLAYER_LOGIN")
				end
			</OnLoad>
			<OnEvent>
				self.OnEvent(self,event)
			</OnEvent>
			<OnShow>
				self.OnShow(self)
			</OnShow>
			<OnHide>
				self.OnHide(self)
			</OnHide>
			<OnMouseDown>
				if ClassicQuestLogSettings.UndockWindow and (not ClassicQuestLogSettings.LockWindow or IsShiftKeyDown()) then
					self:StartMoving()
				end
			</OnMouseDown>
			<OnMouseUp>
				if ClassicQuestLogSettings.UndockWindow and (not ClassicQuestLogSettings.LockWindow or IsShiftKeyDown()) then
					self:StopMovingOrSizing()
				end
			</OnMouseUp>
		</Scripts>
	</Frame>
</Ui>
