<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="ubutton" module="max" category="U/I">
	<digest>
		Transparent button
	</digest>
	<description>
		Creates a transparant click-able region that can be placed over graphics or other objects. Produces a bang message when clicked.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			U/I
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Inverts Button and Sends bang out Left Outlet
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				bang on Mouse-Up or Incoming Message
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				bang on Mouse-Down
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				Click Cursor Location
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="OUTLET_TYPE">
			<digest>
				1 if Mouse Clicked Inside Button, 0 if Outside
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<palette action="ubutton" category="Buttons" pic="ubutton.svg" />
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Function depends on mode
			</digest>
			<description>
				The <o>ubutton</o> object can operate in one of two modes. When the <o>ubutton</o> is in button mode (the default mode), it responds to a <m>bang</m> in its inlet by becoming highlighted briefly and sending a <m>bang</m> out its left outlet. When ubutton is in toggle mode, a <m>bang</m> in its inlet causes it to become (and stay) highlighted and send a <m>bang</m> out its right outlet; or, if it is already highlighted, it becomes unhighlighted and sends a bang out its left outlet.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Highlight the display area
			</digest>
			<description>
				If <o>ubutton</o> is waiting for a particular number (its Stay-on Value) and the incoming number matches it, the button is highlighted but nothing is sent out. If the incoming number does not match the number that <o>ubutton</o> is waiting for, the button is unhighlighted (or remains that way). If <o>ubutton</o> has a Stay-on Value of <m>0</m>, int is the same as <m>bang</m>.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Highlight the display area
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="input" optional="1" type="list" />
			</arglist>
			<digest>
				Function depends on mode
			</digest>
			<description>
				Converted to <m>bang</m>.
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Bang when clicked
			</digest>
			<description>
				In &quot;button&quot; mode, a mouse click on <o>ubutton</o> highlights it for as long as the mouse is held down, sending a <m>bang</m> out the right outlet when the mouse button is pressed down, and another <m>bang</m> out the left outlet when the mouse button is released. In &quot;toggle&quot; mode, a mouse click behaves the same as a <m>bang</m>. When the mouse is clicked, <o>ubutton</o> will send a 1 out the right outlet if the cursor is inside of the <o>ubutton</o> object's rectangle, and 0 if it is not. It will also send these messages when the mouse button is released. When the object is in &quot;Track Mouse While Dragging&quot; mode, these messages are sent continuously while the mouse button is held down after a click.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on mode
			</digest>
			<description>
				If <o>ubutton</o> is in toggle mode, <m>set 1</m> sets the <o>ubutton</o> object's toggle (highlights it) and <m>set 0</m> clears the <o>ubutton</o> object's toggle (unhighlights it). Other integer arguments for <m>set</m> will send the number to <o>ubutton</o>, for comparison to its Stay-on Value, without causing any output.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="dragtrack" get="1" set="1" type="int" size="1">
			<digest>
				Track mouse while dragging mode
			</digest>
			<description>
				The word <m>dragtrack</m>, followed by a non-zero number, enables &quot;Track Mouse While Dragging&quot; mode. In this mode, positional and inside/outside messages (described above for mouse clicks) are sent continuously while the mouse button is held down after a click. <m>dragtrack 0</m> disables this behavior, which is off by default. Dragging the mouse will continue to generate these message pairs until the mouse button is released. Drag tracking is off by default. It can also be enabled in the <o>ubutton</o> object's Inspector.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Track Mouse Dragging" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="hilite" get="1" set="1" type="int" size="1">
			<digest>
				Highlighting flag
			</digest>
			<description>
				Toggles the display of a highlight when <o>ubutton</o> is clicked.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Highlighting" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="hltcolor" get="1" set="1" type="float" size="4">
			<digest>
				Highlight Color
			</digest>
			<description>
				Sets the Highlight Color in RGBA format.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Color" />
				<attribute name="defaultname" get="1" set="1" type="float" size="4" value="0.475 0.695 1. 0.5" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Hilight Color" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="rgba" />
			</attributelist>
		</attribute>
		<attribute name="rounded" get="1" set="1" type="float" size="1">
			<digest>
				Highlight Round-ness
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Appearance" />
				<attribute name="defaultname" get="1" set="1" type="float" size="1" value="0." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Highlight Round-ness" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="stay" get="1" set="1" type="int" size="1">
			<digest>
				Stay on value mode.
			</digest>
			<description>
				Selects the button mode. The modes are:
				<br />
				0 the <o>ubutton</o> object is in normal button mode. It does not look for any particular number.
				<br />
				(any non-zero number) the object is in button mode and waits for the specified non-zero number. When that number is received in the inlet, no output is sent, but <o>ubutton</o> stays highlighted until some other message (or a mouse click) is received.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Stay Highlighted (or Not)" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
			</attributelist>
		</attribute>
		<attribute name="toggle" get="1" set="1" type="int" size="1">
			<digest>
				Toggle mode
			</digest>
			<description>
				Selects the toggle mode. The modes are:
				<br />
				0 button mode
				<br />
				(any non-zero number) toggle mode
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="2">
					<enumlist>
						<enum name="Button">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Toggle">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Mode" />
				<attribute name="paint" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="save" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="ubutton.png" caption="When ubutton is placed on comments or pictures, they can" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="button" />
		<seealso name="fpic" />
		<seealso name="led" />
		<seealso name="matrixctrl" />
		<seealso name="pictctrl" />
		<seealso name="radiogroup" />
		<seealso name="tab" />
		<seealso name="textbutton" />
	</seealsolist>
	<discussion>
		The left-middle outlet sends a <m>bang</m> when the mouse is clicked on the button, and left outlet sends a <m>bang</m> when the mouse button is released. Note that you can resize <o>ubutton</o> when you create a new one - just continue dragging the mouse after placing the button in the patcher window.
	</discussion>
	<misc name="Output">
		<entry name="bang">
			<description>
				Out 1st outlet: In button mode (with a Stay-on Value of <m>0</m>), any input causes <o>ubutton</o> to flash and send a <m>bang</m> out the left outlet. A <m>bang</m> is also sent out the left outlet when the mouse button is released.
				<br />
				<br />
				If the <o>ubutton</o> object is in toggle mode and is already highlighted, any input causes <o>ubutton</o> to become unhighlighted and send a <m>bang</m> out its left outlet.
			</description>
		</entry>
		<entry name="bang">
			<description>
				Out 2nd outlet: In button mode (with a Stay-on Value of <m>0</m>), a mouse click sends a <m>bang</m> when the mouse button is pressed.
				<br />
				<br />
				If the object is in toggle mode, any input causes <o>ubutton</o> to become highlighted and send a <m>bang</m> out the outlet. If it is already highlighted, it becomes unhighlighted and no <m>bang</m> is sent.
			</description>
		</entry>
		<entry name="list">
			<description>
				Out 3rd outlet: When the mouse button is clicked and released, the <o>ubutton</o> object sends out a list composed of two numbers which specify the coordinates for the cursor position expressed as an offset, in pixels, from the upper left-hand corner of the <o>ubutton</o> object rectangle. If the &quot;Track Mouse While Dragging&quot; option is enabled using the Inspector or the <m>dragtrack</m> message, new coordinates will be reported as the mouse is moved until the mouse button is released.
			</description>
		</entry>
		<entry name="int">
			<description>
				Out right outlet: When the mouse button is clicked and released, a <m>1</m> is sent out this outlet if the cursor is inside of the <o>ubutton</o> object's rectangular area. If the &quot;Track Mouse While Dragging&quot; option is enabled using the Inspector or the <m>dragtrack</m> message, a <m>0</m> will be output if the cursor moves outside of the <o>ubutton</o> object's rectangular area while the mouse button is pressed.
			</description>
		</entry>
	</misc>
</c74object>
