Skip to content

Instantly share code, notes, and snippets.

Created November 19, 2015 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2eebedd2141d3106f108 to your computer and use it in GitHub Desktop.
Save anonymous/2eebedd2141d3106f108 to your computer and use it in GitHub Desktop.
<Button name="MyAddon_IconTemplate" virtual="true" enableMouse="true">
<Size>
<AbsDimension x="64" y="64"/>
</Size>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentIcon" parentKey="texture" file="Interface\AddOns\MyAddon\Icons\logo">
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
<AbsDimension x="1" y="1"/>
</Anchor>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentCharge" parentKey="charge" inherits="NumberFontNormalSmall" justifyH="RIGHT">
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnDragStart>
self:GetParent():StartMoving();
</OnDragStart>
<OnDragStop>
MyAddon:OnDragStop(self, button);
</OnDragStop>
<OnMouseDown>
MyAddon_ButtonOnMouseDown(self, button);
</OnMouseDown>
<OnHide>
self:GetParent():StopMovingOrSizing();
</OnHide>
</Scripts>
<Frames>
<Frame name="$parent_MyAddonDropDown" inherits="UIDropDownMenuTemplate" enableMouse="true" hidden="true">
<Anchors>
<Anchor point="TOP"/>
</Anchors>
<Scripts>
<OnLoad>
MyAddon_DropDownOnLoad(self)
</OnLoad>
<OnShow>
MyAddon_DropDownOnLoad(self)
</OnShow>
</Scripts>
</Frame>
<Cooldown name="$parentCooldown" parentKey="cooldown" setAllPoints="true" inherits="CooldownFrameTemplate" reverse="true"/>
<Frame name="$parentTooltip" parentKey="tooltip" enableMouse="true" setAllPoints="true" hidden="true"/>
</Frames>
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
</Button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment