<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
	<Script file="Objectives.lua"/>
	<Frame name="DugisObjectiveBlockTemplate" inherits="ObjectiveTrackerAnimBlockTemplate" mixin="ObjectiveTrackerAnimBlockMixin" hidden="true" virtual="true">
		<Frames>
			<Button parentKey="Icon">
				<Size x="22" y="22"/>
				<NormalTexture file="Interface\AddOns\DugisGuideViewerZ\Artwork\iconbutton.tga" setAllPoints ="true"/>
				<Anchors>
					<Anchor point="RIGHT" relativeKey="$parent.HeaderText" relativePoint = "LEFT" x="-3" />
				</Anchors>
				<Scripts>
					<OnEnter function="DugiIcon_OnEnter"/>
					<OnLeave function="DugiIcon_OnLeave"/>
					<OnMouseUp function="DugiIcon_OnMouseUp"/>
					<OnMouseDown function="DugiIcon_OnMouseDown"/>
					<OnClick function="DugiIcon_OnClick"/>
				</Scripts>
			</Button>
			<Button parentKey="WorldQuestPOI" hidden="true">
				<Size x="24" y="24"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.Icon" x="-10" y="0" />
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND" textureSubLevel="-2">
						<Texture parentKey="Glow" alphaMode="ADD" file="Interface/WorldMap/UI-QuestPoi-IconGlow">
							<Size x="50" y="50" />
							<Anchors>
								<Anchor point="CENTER" />
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="BACKGROUND" textureSubLevel="-1">
						<Texture parentKey="Underlay">
							<Size x="34" y="34" />
							<Anchors>
								<Anchor point="CENTER" y="-2" />
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="OVERLAY">
						<Texture parentKey="Texture">
							<Anchors>
								<Anchor point="CENTER" />
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="OVERLAY" textureSubLevel="2">
						<Texture parentKey="SelectedGlow" alphaMode="ADD" />
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
					</OnLoad>
					<OnClick>
						PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON);
						if C_SuperTrack.GetSuperTrackedQuestID() ~= self.questID then
							C_SuperTrack.SetSuperTrackedQuestID(self.questID);
						end

						WorldMapPing_StartPingQuest(self.questID);
					</OnClick>
				</Scripts>
			</Button>
			<Button parentKey="Waypoint">
				<Size x="22" y="22"/>
				<NormalTexture file ="Interface\AddOns\DugisGuideViewerZ\Artwork\waypoint.tga"/>
				<Disabledtexture file="Interface\AddOns\DugisGuideViewerZ\Artwork\blank.tga"/>
				<HighlightTexture alphaMode ="ADD" file ="Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight"/>
				<pushedtexture file = "Interface\AddOns\DugisGuideViewerZ\Artwork\waypoint_pressed.tga"/>
				<Anchors>
					<Anchor point="RIGHT" relativeKey="$parent.Icon" relativePoint = "LEFT" x="3" />
				</Anchors>
				<Scripts> <OnClick>
					DugisGuideViewer:WayPoint_OnClick(self)
				</OnClick></Scripts>
			</Button>
			<CheckButton inherits ="UICheckButtonTemplate" parentKey="Chk" >
				<Size x="15" y="15"/>
				<Anchors>
					<Anchor point="RIGHT" relativeKey="$parent.Icon" relativePoint="LEFT" x="-14" />
				</Anchors>
				<Scripts>
				<OnClick>
					if DugisGuideViewer.Modules.SmallFrame then
						DugisGuideViewer.Modules.SmallFrame:CheckButton_OnEvent(self, event)
					end
				</OnClick>
				</Scripts>
			</CheckButton>
			<Button parentKey="ModelButton">
				<Size x="22" y="22"/>
				<NormalTexture file ="Interface\AddOns\DugisGuideViewerZ\Artwork\y_waypoint.tga"/>
				<Disabledtexture file="Interface\AddOns\DugisGuideViewerZ\Artwork\blank.tga"/>
				<HighlightTexture alphaMode ="ADD" file ="Interface\BUTTONS\UI-Panel-MinimizeButton-Highlight"/>
				<pushedtexture file = "Interface\AddOns\DugisGuideViewerZ\Artwork\y_waypoint_pressed.tga"/>
				<Anchors>
					<Anchor point="RIGHT" relativeTo="$parent">
						<Offset>
							<AbsDimension x="-9" y="0"/>
						</Offset>
					</Anchor>
					<Anchor point="TOP" relativeKey="$parent.WayPoint"/>
				</Anchors>
				<Scripts>
				<OnClick> DugisGuideViewer.Modules.ModelViewer:ModelButton_OnClick(self, button, down); </OnClick>
					<OnEnter>
						GameTooltip:SetOwner( self, "ANCHOR_TOPLEFT")
						GameTooltip:AddLine("Show / Hide Model Viewer", 1, 1, 1, 1, true)
						GameTooltip:Show()
					</OnEnter>
					<OnLeave>
						 GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Button>
			<SimpleHTML parentKey="Desc" hyperlinksEnabled="true">
				<Size x="245"/>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.Chk" relativePoint="LEFT"/>
					<Anchor point="TOP" relativeKey="$parent.HeaderText" relativePoint="BOTTOM" x="0" y="-8"/>
					<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT" x="-16" y="0"/>
				</Anchors>
				<FontString inherits="GameFontHighlightSmall" wordwrap="true" justifyH="LEFT" justifyV="TOP"/>
				<Scripts>
					<OnHyperlinkEnter function="DugiDesc_OnHyperlinkEnter"/>
					<OnHyperlinkLeave function="DugiDesc_OnHyperlinkLeave"/>
					<OnHyperlinkClick function="DugiDesc_OnHyperlinkClick"/>
					<OnMouseUp function="DugiDesc_OnMouseUp"/>
				</Scripts>
			</SimpleHTML>
		</Frames>
	</Frame>
	<Frame name="DugisNoGuideBlockTemplate" inherits="ObjectiveTrackerAnimBlockTemplate" mixin="ObjectiveTrackerAnimBlockMixin" hidden="true" virtual="true">
		<Frames>
			<Button parentKey="Icon">
				<Size x="28" y="28"/>
				<NormalTexture file="Interface\AddOns\DugisGuideViewerZ\Artwork\iconbutton.tga" setAllPoints ="true"/>
				<Anchors>
					<Anchor point="RIGHT" relativeKey="$parent.HeaderText" relativePoint = "LEFT" x="-1" y="-8" />
				</Anchors>
				<Scripts>
					<OnEnter function="DugiIcon_OnEnter"/>
					<OnLeave function="DugiIcon_OnLeave"/>
					<OnMouseUp function="DugiIcon_OnMouseUp"/>
					<OnMouseDown function="DugiIcon_OnMouseDown"/>
				</Scripts>
			</Button>
			<SimpleHTML parentKey="Desc" hyperlinksEnabled="true">
				<Size x="245"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.HeaderText" relativePoint="BOTTOMLEFT" x="0" y="-8"/>
					<Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT" x="-16" y="0"/>
				</Anchors>
				<FontString inherits="GameFontHighlightSmall" wordwrap="true" justifyH="LEFT" justifyV="TOP"/>
				<Scripts>
					<OnHyperlinkEnter function="DugiDesc_OnHyperlinkEnter"/>
					<OnHyperlinkLeave function="DugiDesc_OnHyperlinkLeave"/>
					<OnHyperlinkClick function="DugiDesc_OnHyperlinkClick"/>
					<OnMouseUp function="DugiDesc_OnMouseUp"/>
				</Scripts>
			</SimpleHTML>
		</Frames>
	</Frame>
	<Frame name="DugisObjectiveHeaderTemplate" inherits="ObjectiveTrackerModuleHeaderTemplate" virtual="true">
		<Frames>
			<StatusBar parentKey="ProgressBar" inherits="DugisProgressBarTemplate" hidden="true">
				<Anchors>
					<Anchor point="TOP" y="-7" /> 
					<Anchor point="RIGHT" x="-20" />
				</Anchors>
			</StatusBar>
		</Frames>
	</Frame>
	<Button Name="DugisObjectiveTabTemplate" hidden="true" virtual="true"  >
		<Size x="33" y="35"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture file="Interface\PaperDollInfoFrame\PaperDollSidebarTabs" parentKey="TabBg">
					<Size x="50" y="43"/>
					<Anchors>
						<Anchor point="BOTTOMLEFT" x="-9" y="-2"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.79687500" top="0.61328125" bottom="0.78125000"/>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture parentKey="Icon">
					<Size x="33" y="35"/>
					<Anchors>
						<Anchor point="BOTTOM" x="1" y="-2"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<Texture parentKey="Hider" file="Interface\PaperDollInfoFrame\PaperDollSidebarTabs">
					<Size x="34" y="19"/>
					<Anchors>
						<Anchor point="BOTTOM"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.54687500" top="0.11328125" bottom="0.18750000"/>
				</Texture>
			</Layer>
			<Layer level="HIGHLIGHT">
				<Texture parentKey="Highlight" file="Interface\PaperDollInfoFrame\PaperDollSidebarTabs">
					<Size x="31" y="31"/>	
					<Anchors>
						<Anchor point="TOPLEFT" x="2" y="-3"/>
					</Anchors>
					<TexCoords left="0.01562500" right="0.50000000" top="0.19531250" bottom="0.31640625"/>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
			</OnLoad>
			<OnEnable>
			</OnEnable>
			<OnDisable>
			</OnDisable>
			<OnEnter>
				self:GetParent():GetParent():FadeInFadeOutTabs()
				GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
                if self.tab then
                    if self.tab.guide then
                        local title = DugisGuideViewer:GetFormattedTitle(self.tab.guide)
                        GameTooltip:SetText(title, 1, 1, 1);
                    else
                        GameTooltip:SetText("No Guide Loaded", 1, 1, 1);
                    end
                    
                    GameTooltip:AddLine("[Right click for more options]");
                end
				GameTooltip:Show();
			</OnEnter>
			<OnLeave>
                self:GetParent():GetParent():FadeInFadeOutTabs()
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
	<Frame name="DugisObjectiveTrackerModuleTemplate" mixin="ObjectiveTrackerModuleMixin" hidden="true" virtual="true">
		<!-- this needs to have a valid rect or first layout will be off -->
		<Size x="260" y="10"/>
		<Anchors>
			<Anchor point="TOP"/>
		</Anchors>
		<Frames>
			<Frame parentKey="TabContainer" hidden="true" frameLevel="1">
				<Size x="327" y="67"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativeKey="$parent.$parent.NineSlice" relativePoint="TOPLEFT" x="1" y="8"/>
				</Anchors>
			</Frame>
			<Frame parentKey="Header" inherits="DugisObjectiveHeaderTemplate">
				<Anchors>
					<Anchor point="TOPLEFT"/>
				</Anchors>
			</Frame>
			<Frame parentKey="ContentsFrame">
				<Anchors>
					<Anchor point="TOP" relativeKey="$parent.Header" relativePoint="BOTTOM"/>
					<Anchor point="LEFT"/>
					<Anchor point="RIGHT"/>
					<Anchor point="BOTTOM"/>
				</Anchors>
			</Frame>
		</Frames>
		<Scripts>
			<OnLoad method="OnLoad"/>
			<OnEvent method="OnEvent"/>
		</Scripts>
	</Frame>
	<Frame name="DugisObjectiveBackground" inherits="BackdropTemplate" parent="UIParent" frameStrata="LOW" hidden="true"/>
</Ui>