<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>rubberbox</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>2002</DATE>
  <SHORT_DESCRIPTION name="rubberbox"> Rubberband box for rectangle selection</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>[final_rect,btn]=rubberbox(initial_rect)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[final_rect,btn]=rubberbox()  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[final_rect,btn]=rubberbox(edition_mode)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>initial_rect</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: vector with two or four entries. With four entries it gives the
  initial rectangle  defined by [x_left, y_top, width, height], with
  two entries width and height are supposed to be 0.
  coordinates of the upper-left corner of</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>edition_mode</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>:a boolean, if edition_mode==%t; button press selects the first corner, release
	    selects the opposite corner.if edition_mode==%f, button press or
	    click selects the first corner, a click is requested to select the
	    opposite corner. The default value is  edition_mode=%f </SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>final_rect</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>:a rectangle defined by [x_left, y_top, width, height]</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>btn</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>:an integer, the number of the mouse button clicked</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P><VERB>rubberbox(initial_rect)</VERB>  tracks a rubberband box in
    the current graphic window, following the mouse. When a button is clicked <VERB>rubberbox</VERB> returns the final
    rectangles definition  in <VERB>final_Rect</VERB>. If the argument
    <VERB>initial_rect</VERB> user has to click to fix the initial
    corner position.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
xsetech(frect=[0,0,100,100])
[x,y]=xclick();r=rubberbox([x;y;30;10])
xrect(r)
r=rubberbox()
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>xrect</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>xrects</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>xclick</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>xgetmouse</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>dragrect</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
