Thread Tools Display Modes
05-31-07, 04:50 PM   #1
Zilver
A Fallenroot Satyr
 
Zilver's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 29
Thumbs up How do I Set Activater to non-Left Mouse Button on a Secure Button?

Hi, I have been working on a project which includes Secure Button's, got it functioning, but can't seem to figure out how to bind a mouse click other than Left mouse button to the spell cast of button.

Ex:
1 Button
Left Click --> Cast "Healing Touch"
Right Click --> Cast "Mark of the Wild"
Middle Click --> Cast "Some_Spell"
Button 4 Click --> Cast "Some_Other_Spell"

I was hoping that some1 might be able to tell me what I could be doing wrong, here is an ex code of what I have been trying:

<XML>
<CheckButton name="FrameButtonTemplate" frameStrata="MEDIUM" inherits="SecureActionButtonTemplate" virtual="true" toplevel="true" hidden="true">
--Size
--BORDER
--OVERLAY
--$parentCooldown
--OnLoad
--OnAttributeChanged
--OnEvent
--OnShow
--OnHide
--OnEnter
--OnLeave
--OnUpdate
<NormalTexture/>
--PushedTexture
--HighlightTexture
--CheckedTexture
</CheckButton>

<Frame name="Frame_HiddenParent" parent="UIParent" hidden="true">
--Size
</Frame>

<CheckButton name="Frame_ButtonTemplate" parent="Frame_HiddenParent" inherits="FrameButtonTemplate" virtual="true">
--Size
</CheckButton>

<CheckButton name="Frame_Player" inherits="Frame_ButtonTemplate" parent="PlayerFrame" id="501">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PlayerFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="108" y="-66"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="19" y="19"/>
</Size>
</CheckButton>
<XML end>

<Lua>
button = getglobal("Frame_Player");
button:SetAttribute("*unit*","player");
button:SetAttribute("*helpbutton1", "heal1"); -- ##
button:SetAttribute("*type-heal1", "spell"); -- ##
button:SetAttribute("spell-heal1", "Healing Touch"); -- ##
button:SetAttribute("*helpbutton2", "heal2"); -- **
button:SetAttribute("*type-heal2", "spell");-- **
button:SetAttribute("spell-heal2", "Mark of the Wild"); -- **
getglobal("Frame_PlayerIconTexture"):SetTexture(Healing_Touch_icon);
getglobal("Frame_PlayerCooldown"):SetPoint("CENTER", button, "CENTER");
getglobal("Frame_PlayerCooldown"):SetScale(19/36);
<Lua end>

-- ## This is working perfectly if I comment our the lines with -- ** in the end
-- ** This should be activated by Right Mouse button, but I can't seem to make it work

And yes this is a small piece of entire code, but my only problem is how to
SetAttritute("*helpbutton#OtherThanLeftMouseButton", "Heal#OtherThanLeftMouseButton")
SetAttritute("*type-heal", "spell")
SetAttritute("spell-hea", "Spell_Name")

Hope to hear from some1 soon.
Thanks to a great wow-community,
Zilver

Edit:
I figured it out, I forgot to
self:RegisterForClicks("LeftButtonUp","RightButtonUp","MiddleButtonUp");
in the <OnLoad>, so only LeftButton where RegisteredForClicks.

A special thanks to Saiiyna for the AddOn Healerbuttons, which lead me to solving my problem.

Zilver

Last edited by Zilver : 06-01-07 at 06:18 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » How do I Set Activater to non-Left Mouse Button on a Secure Button?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off