API Button RegisterForClicks

Registers the widget for clicks with a mouse button. button:RegisterForClicks("clicktype1" [, "clicktype2" [, ...]])

Arguments
Any number of the following strings:
 * "LeftButtonUp"
 * "RightButtonUp"
 * "MiddleButtonUp"
 * "Button4Up"
 * "Button5Up"
 * "LeftButtonDown"
 * "RightButtonDown"
 * "MiddleButtonDown"
 * "Button4Down"
 * "Button5Down"
 * "AnyUp"
 * "AnyDown"

Example
   self:RegisterForClicks("LeftButtonUp", "RightButtonDown");   print("OnClick: "..button);   print("OnMouseUp: "..button);   print("OnMouseDown: "..button);   

Results
Clicking the Left, Right and Middle buttons in turn will produce:

OnMouseDown: LeftButton OnMouseUp: LeftButton OnClick: LeftButton OnMouseDown: RightButton OnClick: RightButton OnMouseUp: RightButton OnMouseDown: MiddleButton OnMouseUp: MiddleButton

Details

 * Buttons default to having "LeftButtonUp" registered for clicks.
 * Registering for means  will never trigger.
 * Registering for invalid event names will not cause errors; invalid names are silently ignored.
 * The  and  handlers will always receieve all mouse up/down events.
 * ONLY BUTTONS (and widgets that inherit from Button) HAVE OnClick HANDLERS! If you want to trap mouse button events for other objects, use the OnMouseDown and OnMouseUp events.
 * OnDragStart and OnReceiveDrag are unaffected by this function.
 * If Frame:EnableMouse(false) is called, it will not receive any mouse, drag, or click events.