Thread Tools Display Modes
09-26-10, 05:53 PM   #1
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
SecureHandlers help

I have made bindings to bind my frame which inherits from the SecureHandlerMouseUpDownTemplate, and I thought that because my frame was keybound, it was intercepting my keybinds as mouse clicks, when the bind is down, the mouse is down, so to speak.

This doesnt appear to be the case in my addon, so is there a way that I can make a keybind show/hide a frame, even during combat. This frame has protected children.

I added the SecureClick template in trying new things, and this is copy-n-pasted, with some fluff removed for space

also, my bindings.xml used to include a function to toggle the frame, i removed it when added secure handlers, it worked out of combat before i changed.

.xml
Code:
<Frame name="myFrame" parent="UIParent" hidden="true" enableMouse="true"  inherits="SecureHandlerClickTemplate, SecureHandlerMouseUpDownTemplate">

    <Size x="256" y="256" />

    <Anchors>

      <Anchor point="CENTER"/>

    </Anchors>

    <Scripts>

      <OnLoad>

        myFrame_OnLoad(self)

      </OnLoad>

    </Scripts>

  </Frame>
.lua
Code:
_G["BINDING_NAME_CLICK myFrame:LeftButton"] = "Show Buttons"

function myFrame_OnLoad(frame)

    frame:SetAttribute("_onmouseup", [=[self:Hide()]=])

    frame:SetAttribute("_onmousedown", [=[self:Show()]=])

    frame:SetAttribute("_onclick", [=[self:Show()]=])

end
bindings.xml
Code:
<Bindings>

  <Binding name="Show Buttons" description="Show the Buttons" header="My Addon">

    --foo

  </Binding>

</Bindings>
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote
09-26-10, 06:00 PM   #2
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
wow

all i needed to do was change the bindings name to


Code:
<Binding name="CLICK myFrame:LeftButton" header="My Addon">
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SecureHandlers help


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