diff 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
line wrap: on
line diff
--- a/Button.lua	Mon Apr 04 13:04:11 2011 -0700
+++ b/Button.lua	Mon Apr 25 11:43:42 2011 -0700
@@ -85,6 +85,10 @@
     return format("%s:%s", bar:GetName(), idx)
   end
 
+  -- mouse and clicking
+  -- set click handlers in subclasses
+  f:EnableMouse(true)
+  f:RegisterForClicks( bar:GetConfig().clickDown and "AnyDown" or "AnyUp" )
   local clickBinding = format("CLICK %s:LeftButton", name)
   function f:GetHotkey()
     return LKB:ToShortKey(GetBindingKey(clickBinding))