comparison Button.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 46b59a9ded76
children 36a29870bf34
comparison
equal deleted inserted replaced
256:5ab04f393b0b 259:c918ff9ac787
83 -- install LibKeyBound handlers onto frame 83 -- install LibKeyBound handlers onto frame
84 function f:GetActionName() 84 function f:GetActionName()
85 return format("%s:%s", bar:GetName(), idx) 85 return format("%s:%s", bar:GetName(), idx)
86 end 86 end
87 87
88 -- mouse and clicking
89 -- set click handlers in subclasses
90 f:EnableMouse(true)
91 f:RegisterForClicks( bar:GetConfig().clickDown and "AnyDown" or "AnyUp" )
88 local clickBinding = format("CLICK %s:LeftButton", name) 92 local clickBinding = format("CLICK %s:LeftButton", name)
89 function f:GetHotkey() 93 function f:GetHotkey()
90 return LKB:ToShortKey(GetBindingKey(clickBinding)) 94 return LKB:ToShortKey(GetBindingKey(clickBinding))
91 end 95 end
92 96