<doc>
	<legacy_id>1292</legacy_id>
	<name>grab</name>
	<type>command</type>

	<syntax>
		<example>grab <i>object</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Causes an <glossary tag="object">object</glossary> to follow the movements of the mouse.</summary>

	<examples>
<example>grab graphic 1</example>
<example>grab the mouseControl</example>
<example><p>grab me</p></example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>User Interaction</category>
	</classification>

	<references>
		<function tag="mouseLoc">mouseLoc Function</function>
		<command tag="move">move Command</command>
		<command tag="click">click Command</command>
		<command tag="drag">drag Command</command>
		<message tag="mouseDown">mouseDown Message</message>
		<message tag="mouseMove">mouseMove Message</message>
		<message tag="moveStack">moveStack Message</message>
	</references>

	<description>Use the <b>grab</b> <glossary tag="command">command</glossary> within a <message tag="mouseDown">mouseDown</message> <glossary tag="handler">handler</glossary> to drag an <glossary tag="object">object</glossary> around the <glossary tag="stack window">stack window</glossary> without <glossary tag="select">selecting</glossary> it.<p></p><p><b>Parameters:</b></p><p>The <i>object</i> is any <keyword tag="control">control</keyword> on the <glossary tag="current card">current card</glossary>.</p><p></p><p><b>Comments:</b></p><p>You can only grab a control when the mouse pointer is within the control's <b>rectangle</b> at the time the mouse is clicked. If the <glossary tag="mouse pointer">mouse pointer</glossary> is outside the <keyword tag="control">control</keyword> when the <b>grab</b> <glossary tag="command">command</glossary> is <glossary tag="execute">executed</glossary>, nothing happens.</p><p></p><p>Although the <b>grab</b> <glossary tag="command">command</glossary> returns to the calling handler immediately, the target control will remain grabbed until the user releases the mouse button, at which point the control will receive a mouseUp message.</p><p></p><p>If a subsequent script action deletes the control, or if the control becoms invisible, the grab will be automatically cancelled and in this case no message will be sent to the control.</p></description>
</doc>