<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">

	<!--
	Skillet: A tradeskill window replacement.

	This program 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 3 of the License, or
	(at your option) any later version.

	This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
	-->

<!--
#
#  Template for all the buttons we use to display items in the shopping list
#
-->
<Frame name="SkilletShoppingListItemButtonTemplate_Count" hidden="false" virtual="true">
	<Size>
		<AbsDimension x="30" y="16"/>
	</Size>
	<Layers>
		<Layer level="OVERLAY">
			<FontString name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
				<Size>
					<AbsDimension x="30" y="0"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT"/>
				</Anchors>
				<Color r="1" g="1" b="1" a="1"/>
			</FontString>
		</Layer>
	</Layers>
</Frame>

<Frame name="SkilletShoppingListItemButtonTemplate_Name" hidden="false" virtual="true">
	<Size>
		<AbsDimension x="230" y="16"/>
	</Size>
	<Layers>
		<Layer level="OVERLAY">
			<FontString name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
				<Size>
					<AbsDimension x="230" y="0"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT"/>
				</Anchors>
				<Color r="1" g="1" b="1" a="1"/>
			</FontString>
		</Layer>
	</Layers>
</Frame>

<Frame name="SkilletShoppingListItemButtonTemplate_Player" hidden="false" virtual="true">
	<Size>
		<AbsDimension x="50" y="16"/>
	</Size>
	<Layers>
		<Layer level="OVERLAY">
			<FontString name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
				<Size>
					<AbsDimension x="50" y="0"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT"/>
				</Anchors>
				<Color r="1" g="1" b="1" a="1"/>
			</FontString>
		</Layer>
	</Layers>
</Frame>

<Frame name="SkilletShoppingListItemButtonTemplate" hidden="true" virtual="true">
	<Size>
		<AbsDimension x="330" y="16"/>
	</Size>
	<Frames>
		<Frame name="$parentCount" inherits="SkilletShoppingListItemButtonTemplate_Count">
			<Anchors>
				<Anchor point="LEFT"/>
			</Anchors>
		</Frame>
		<Frame name="$parentName" inherits="SkilletShoppingListItemButtonTemplate_Name">
			<Anchors>
				<Anchor point="LEFT">
					<Offset>
						<AbsDimension x="34" y="0"/>
					</Offset>
				</Anchor>
			</Anchors>
		</Frame>
		<Frame name="$parentPlayer" inherits="SkilletShoppingListItemButtonTemplate_Player">
			<Anchors>
				<Anchor point="LEFT" relativeTo="$parent" relativePoint="LEFT">
					<Offset>
						<AbsDimension x="268" y="0"/>
					</Offset>
				</Anchor>
			</Anchors>
		</Frame>
	</Frames>
	<Scripts>
		<OnLoad>
			self:RegisterForClicks("LeftButtonUp","RightButtonUp")
		</OnLoad>
		<OnClick>
			<!-- shift clicking will insert a link to the recipe in the chat window. -->
			if button == "LeftButton" and IsShiftKeyDown() then
				local name,link = GetItemInfo(self.id)
				ChatEdit_InsertLink(self.count .. "x" .. link)
			end

			<!-- alt clicking will insert the item name into the Auction House. -->
			if button == "LeftButton" and IsAltKeyDown() then
				if(CanSendAuctionQuery()) then
					local name,link = GetItemInfo(self.id)
					BrowseName:SetText(name)
					AuctionFrameBrowse_Search()
					BrowseNoResultsText:SetText(BROWSE_NO_RESULTS)
				end
			end

			<!-- control clicking will remove this player's entries. -->
			if button == "LeftButton" and IsControlKeyDown() then
				Skillet:ClearShoppingList(self.player)
			end

			<!-- right clicking will remove this player's entries. -->
			if button == "RightButton" then
				Skillet:ClearShoppingList(self.player)
			end
		</OnClick>
		<OnEnter>
			Skillet:ShoppingListButton_OnEnter(self)
		</OnEnter>
		<OnLeave>
			GameTooltip:Hide()
		</OnLeave>
	</Scripts>
</Frame>

<!--
	#
	# Template used when creating checkboxes
	#
	-->
<CheckButton name="SkilletShoppingListCheckButtonTemplate" virtual="true">
	<Size>
		<AbsDimension x="20" y="20"/>
	</Size>
	<Layers>
		<Layer level="ARTWORK">
			<FontString name="$parentText" inherits="GameFontHighlightSmall">
				<Anchors>
					<Anchor point="RIGHT" relativePoint="LEFT">
						<Offset>
							<AbsDimension x="0" y="1"/>
						</Offset>
					</Anchor>
				</Anchors>
			</FontString>
		</Layer>
	</Layers>
	<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
	<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
	<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
	<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
	<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>

<CheckButton name="SkilletShoppingListCheckButtonTemplate2" virtual="true">
	<Size>
		<AbsDimension x="20" y="20"/>
	</Size>
	<Layers>
		<Layer level="ARTWORK">
			<FontString name="$parentText" inherits="GameFontHighlightSmall">
				<Anchors>
					<Anchor point="LEFT" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="0" y="1"/>
						</Offset>
					</Anchor>
				</Anchors>
			</FontString>
		</Layer>
	</Layers>
	<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
	<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
	<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
	<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
	<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>

<!--
 #
 #  The shopping list window ....
 #
-->
<Frame name="SkilletShoppingList" toplevel="true" movable="true" resizable="true" parent="UIParent" enableMouse="true" hidden="true">
	<Size>
		<AbsDimension x="385" y="240"/>
	</Size>

	<Frames>

		<!--
		#
		# A button on the top right to close the window
		#
		-->
		<Button name="SkilletShoppingListCloseButton" inherits="UIPanelCloseButton" parent="SkilletShoppingList">
			<Anchors>
				<Anchor point="TOPRIGHT" relativeTo="SkilletShoppingList" relativePoint="TOPRIGHT">
					<Offset>
						<AbsDimension x="-2" y="-2"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					HideUIPanel(SkilletShoppingList)
				</OnClick>
			</Scripts>
		</Button>

		<!--
		#
		# A button to retrieve all the mats from the bank
		#
		-->
		<Button name="SkilletShoppingListRetrieveButton" inherits="UIPanelButtonTemplate" text="Retrieve" parent="SkilletShoppingList">
			<Size>
				<AbsDimension x="70" y="22"/>
			</Size>
			<Anchors>
				<Anchor point="BOTTOMLEFT" relativeTo="SkilletShoppingList" relativePoint="BOTTOMLEFT">
					<Offset>
						<AbsDimension x="5" y="50"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					Skillet:GetReagentsFromBanks()
				</OnClick>
			</Scripts>
		</Button>

		<!--
			#
			# Check boxes for various recipe filtering options.
			#
			-->
		<CheckButton name="SkilletShowQueuesFromAllAlts" inherits="SkilletShoppingListCheckButtonTemplate">
			<Anchors>
				<Anchor point="BOTTOMRIGHT" relativeTo="SkilletShoppingList" relativePoint="BOTTOMRIGHT">
					<Offset>
						<AbsDimension x="-10" y="30"/> <!-- 50 is the next row up -->
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					Skillet:ShoppingListToggleShowAlts()
					Skillet:UpdateShoppingListWindow(false)
				</OnClick>
			</Scripts>
		</CheckButton>

		<CheckButton name="SkilletShowQueuesIncludeGuild" inherits="SkilletShoppingListCheckButtonTemplate">
			<Anchors>
				<Anchor point="BOTTOMRIGHT" relativeTo="SkilletShoppingList" relativePoint="BOTTOMRIGHT">
					<Offset>
						<AbsDimension x="-10" y="10"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					Skillet:ShoppingListToggleIncludeGuild()
					Skillet:UpdateShoppingListWindow(false)
				</OnClick>
			</Scripts>
		</CheckButton>

		<CheckButton name="SkilletShowQueuesInItemOrder" inherits="SkilletShoppingListCheckButtonTemplate2">
			<Anchors>
				<Anchor point="BOTTOMLEFT" relativeTo="SkilletShoppingList" relativePoint="BOTTOMLEFT">
					<Offset>
						<AbsDimension x="10" y="30"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					Skillet:ShoppingListToggleItemOrder()
					Skillet:UpdateShoppingListWindow(false)
				</OnClick>
			</Scripts>
		</CheckButton>

		<CheckButton name="SkilletShowQueuesMergeItems" inherits="SkilletShoppingListCheckButtonTemplate2">
			<Anchors>
				<Anchor point="BOTTOMLEFT" relativeTo="SkilletShoppingList" relativePoint="BOTTOMLEFT">
					<Offset>
						<AbsDimension x="10" y="10"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnClick>
					Skillet:ShoppingListToggleMergeItems()
					Skillet:UpdateShoppingListWindow(false)
				</OnClick>
			</Scripts>
		</CheckButton>

		<!--
		#
		# The list of known recipes on the left hand side
		#
		-->
		<Frame name="SkilletShoppingListParent" parent="SkilletShoppingList">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="SkilletShoppingList" relativePoint="TOPLEFT">
					<Offset>
						<AbsDimension x="5" y="-35"/>
					</Offset>
				</Anchor>
				<Anchor point="BOTTOMRIGHT" relativeTo="SkilletShoppingList" relativePoint="BOTTOMRIGHT">
					<Offset>
						<AbsDimension x="-5" y="70"/>
					</Offset>
				</Anchor>
			</Anchors>
		</Frame>
		<ScrollFrame name="SkilletShoppingListList" inherits="FauxScrollFrameTemplate" parent="SkilletShoppingListParent">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="SkilletShoppingListParent" relativePoint="TOPLEFT">
					<Offset>
						<AbsDimension x="5" y="-5"/>
					</Offset>
				</Anchor>
				<Anchor point="BOTTOMRIGHT" relativeTo="SkilletShoppingListParent" relativePoint="BOTTOMRIGHT">
					<Offset>
						<AbsDimension x="-27" y="5"/>
					</Offset>
				</Anchor>
			</Anchors>
			<Scripts>
				<OnVerticalScroll>
					FauxScrollFrame_OnVerticalScroll(self, offset, SKILLET_SHOPPING_LIST_HEIGHT, Skillet.ShoppingList_OnScroll)
				</OnVerticalScroll>
			</Scripts>
		</ScrollFrame>
		<Button name="SkilletShoppingListButton1" inherits="SkilletShoppingListItemButtonTemplate">
			<Anchors>
				<Anchor point="TOPLEFT" relativeTo="SkilletShoppingListList" relativePoint="TOPLEFT">
					<Offset>
						<AbsDimension x="2" y="0"/>
					</Offset>
				</Anchor>
			</Anchors>
		</Button>
		<!-- buttons 2 ... whatever are created dynamically in the Skillet:UpdateShoppingListWindow() function-->
	</Frames>
</Frame>

</Ui>

