comparison ActionButton.lua @ 259:c918ff9ac787

Add option to make buttons activate on mouse/key down
author Flick
date Mon, 25 Apr 2011 11:43:42 -0700
parents 65f2805957a0
children b40e2aaccfa0
comparison
equal deleted inserted replaced
256:5ab04f393b0b 259:c918ff9ac787
228 f:SetScript("OnUpdate", function(frame, elapsed) self:OnUpdate(elapsed) end) 228 f:SetScript("OnUpdate", function(frame, elapsed) self:OnUpdate(elapsed) end)
229 f:SetScript("OnDragStart", function(frame) self:OnDragStart() end) 229 f:SetScript("OnDragStart", function(frame) self:OnDragStart() end)
230 f:SetScript("OnReceiveDrag", function(frame) self:OnReceiveDrag() end) 230 f:SetScript("OnReceiveDrag", function(frame) self:OnReceiveDrag() end)
231 231
232 -- event registration 232 -- event registration
233 f:EnableMouse(true)
234 f:RegisterForDrag("LeftButton", "RightButton") 233 f:RegisterForDrag("LeftButton", "RightButton")
235 f:RegisterForClicks("AnyUp")
236 for _, evt in pairs(eventList) do 234 for _, evt in pairs(eventList) do
237 f:RegisterEvent(evt) 235 f:RegisterEvent(evt)
238 end 236 end
239 237
240 f.action = config.actionID -- need this to support silly ActionButton_UpdateFlyout. Should not taint anything anymore. 238 f.action = config.actionID -- need this to support silly ActionButton_UpdateFlyout. Should not taint anything anymore.