diff Button.xml @ 1:c11ca1d8ed91

Version 0.1
author Flick <flickerstreak@gmail.com>
date Tue, 20 Mar 2007 21:03:57 +0000
parents
children 8e0ff8ae4c08
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Button.xml	Tue Mar 20 21:03:57 2007 +0000
@@ -0,0 +1,129 @@
+<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">
+
+
+  <CheckButton name="ReActionButtonTemplate" inherits="ActionButtonTemplate, SecureActionButtonTemplate" virtual="true" enableMouse="true">
+		<Scripts>
+			<OnLoad>
+        this:RegisterForDrag("LeftButton", "RightButton")
+        this:RegisterForClicks("AnyUp")
+			</OnLoad>
+			<PostClick>
+        if arg1 == "LeftButton" and IsAltKeyDown() then
+          this.rxnBtn:ShowAssignKeybinding()
+        end
+        if this.rxnBtn:ShouldPickupAction(button) then
+					PickupAction(this.rxnBtn:GetActionID())
+				end
+        this.rxnBtn:UpdateCheckedState()
+			</PostClick>
+			<OnDragStart>
+				if LOCK_ACTIONBAR ~= "1" then
+					PickupAction(this.rxnBtn:GetActionID())
+          this.rxnBtn:UpdateDisplay()
+				end
+			</OnDragStart>
+			<OnReceiveDrag>
+				if LOCK_ACTIONBAR ~= "1" then
+					PlaceAction(this.rxnBtn:GetActionID())
+          this.rxnBtn:UpdateDisplay()
+				end
+			</OnReceiveDrag>
+			<OnEnter>
+        this.rxnBtn:SetTooltip()
+			</OnEnter>
+			<OnLeave>
+				this.rxnBtn:ClearTooltip()
+			</OnLeave>
+		</Scripts>
+  </CheckButton>
+
+  <Frame name="ReActionButtonRecyler" parent="UIParent" hidden="true" setAllPoints="true" enableMouse="false"/>
+  
+  <Frame name="ReActionKeybindFrame" enableMouse="true" enableKeyboard="true" parent="UIParent" hidden="true">
+    <Size>
+      <AbsDimension x="160" y="52"/>
+    </Size>
+    <Backdrop file="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="0" right="0" top="0" bottom="0"/>
+      </BackgroundInsets>
+    </Backdrop>
+    <Layers>
+      <Layer level="BACKGROUND">
+        <Texture>
+          <Color r="0" g="0" b="0" a="0.5"/>
+        </Texture>
+      </Layer>
+      <Layer level="ARTWORK">
+        <FontString inherits="GameFontNormal" text="Set Keybinding">
+          <Anchors>
+            <Anchor point="TOP">
+              <Offset>
+                <AbsDimension x="0" y="-5"/>
+              </Offset>
+            </Anchor>
+          </Anchors>
+        </FontString>
+      </Layer>
+    </Layers>
+    <Frames>
+      <Button name="$parentButton" inherits="UIPanelButtonTemplate2" enableKeyboard="true" enableMouse="true">
+        <Size>
+          <AbsDimension x="120" y="22"/>
+        </Size>
+        <Anchors>
+          <Anchor point="BOTTOM" relativePoint="BOTTOM">
+            <Offset>
+              <AbsDimension x="-2" y="5"/>
+            </Offset>
+          </Anchor>
+        </Anchors>
+        <Scripts>
+          <OnLoad>
+            this:RegisterForClicks("AnyUp")
+          </OnLoad>
+          <OnClick>
+            if this.selected and this.keybindTarget then
+              this.keybindTarget:HandleKeybindAssign(this, nil, arg1)
+            else
+              this.selected = not(this.selected)
+            end
+            if this.selected and this.keybindTarget then
+              this:LockHighlight()
+              this:SetScript("OnKeyDown", function() this.keybindTarget:HandleKeybindAssign(this,arg1) end)
+            else
+              this:UnlockHighlight()
+              this:SetScript("OnKeyDown", nil)
+            end
+          </OnClick>
+          <OnShow>
+            this.keybindTarget.button:SetChecked(1)
+            this.keybindTarget:UpdateDisplay()
+          </OnShow>
+          <OnHide>
+            if this.keybindTarget then
+              this.keybindTarget.button:SetChecked(0)
+              this.keybindTarget:UpdateDisplay()
+            end
+          </OnHide>
+        </Scripts>
+        <NormalFont    inherits="GameFontHighlightSmall"/>
+        <HighlightFont inherits="GameFontHighlightSmall"/>
+      </Button>
+    </Frames>
+    <Scripts>
+      <OnLoad>
+        table.insert(UISpecialFrames, this:GetName())  -- auto-hide on escape
+      </OnLoad>
+    </Scripts>
+  </Frame>
+
+</Ui>