<!--

	Atlas, a World of Warcraft instance map browser
	Copyright 2005-2010 Dan Gilbert <dan.b.gilbert@gmail.com>

	This file is part of Atlas.

	Atlas is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	Atlas is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Atlas; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

-->

<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">
	<Frame name="AtlasButtonFrame" parent="Minimap" enableMouse="true" hidden="false" frameStrata="LOW">
		<Size>
			<AbsDimension x="32" y="32"/>
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="Minimap" relativePoint="RIGHT">
				<Offset>
					<AbsDimension x="2" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Frames>
			<Button name="AtlasButton">
				<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
				<Size>
					<AbsDimension x="33" y="33"/>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="0" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BORDER">
						<Texture name="$parentIcon" file="Interface\WorldMap\WorldMap-Icon">
							<Size>
								<AbsDimension x="20" y="20"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="-2" y="1"/>
									</Offset>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="OVERLAY">
						<Texture name="$parentBorder" file="Interface\Minimap\MiniMap-TrackingBorder">
							<Size>
								<AbsDimension x="52" y="52"/>
							</Size>
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						this:RegisterForDrag("RightButton");
						this.dragme = false;
					</OnLoad>
					<OnDragStart> 
						this.dragme = true;
					</OnDragStart> 
					<OnDragStop>
						this.dragme = false;
					</OnDragStop>
					<OnUpdate>
						if(this.dragme == true) then
							AtlasButton_BeingDragged();
						end
					</OnUpdate>
					<OnClick>
						AtlasButton_OnClick();
					</OnClick>
					<OnMouseUp>
						if ( arg1 == "MiddleButton" ) then
							AtlasOptions_Toggle();
						end
					</OnMouseUp>
					<OnEnter>
						AtlasButton_OnEnter();
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				this:RegisterEvent("VARIABLES_LOADED");
			</OnLoad>
			<OnEvent>
				AtlasButton_Init();
				AtlasButton_UpdatePosition();
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>
