MAGNIFY

Purpose:

Enables the cursor to select a region in a window to magnify.

Syntax:

MAGNIFY(

mode, msg, cursor, orientation, "onrclick", "onlclick")

(x1, y1, x2, y2) = MAGNIFY(

mode, msg, cursor, orientation, "onrclick", "onlclick")

mode

-

Optional. An integer, the operation mode:

0:

resize window region and return coordinates of dragged rectangle (default)

1:

do not resize, return x, y coordinates immediately after mouse click

2:

do not resize, return coordinates of dragged rectangle

msg

-

Optional. An integer the coordinate display method:

-1:

use the current method for the vertical cursor (default)

 0:

display coordinates in the status line

 1:

display coordinates in a popup box

 2:

display coordinates in the plot Window

cursor

-

Optional. An integer, the mouse cursor style:

-1:

use a cursor based on orientation (default)

 0:

XOR Cross

 1:

Up-Down-Left-Right

 2:

Standard Arrow

 3:

I Bar

 5:

SW-NE Arrow

 6:

SE-NW Arrow

 9:

Up-Down Arrow

10:

Left-Right Arrow

13:

Hourglass

15:

Up Arrow

16:

Hand

17:

Pen

18:

None

orientation

-

Optional. An integer, the magnify orientation:

0:

unconstrained magnify (default)

1:

horizontal magnify

2:

vertical magnify

"onrclick"

-

Optional. A string, the callback function to execute on the mouse right click event. Defaults to empty (none).

"onlclick"

-

Optional. A string, the callback function to execute on the mouse left click event. Defaults to empty (none).

Returns:

(x1, y1, x2, y2) = magnify

returns the new magnified coordinates after scaling the plot.

 

(x, y) = magnify(1)

returns the x, y, coordinates after the mouse click without modifying the plot.

 

(x1, y1, x2, y2) = magnify(2)

returns the coordinates of the dragged rectangle without modifying the plot.

Example:

(x, y) = magnify()

 

Resizes the plot and returns the coordinates in x and y.

Example:

(x, y) = magnify(2)

 

Does not resize the plot, but the final magnify coordinates are returned in x and y.

Example:

magnify(0, 1, -1, 1)

 

Magnifies the plot horizontally.

Remarks:

MAGNIFY with no arguments performs the same function as the magnifier button in the toolbar.

 

Use (x, y) = magnify(1) to return the coordinates of a free roaming cursor after a mouse click.

 

If the magnify operation is canceled, the returned coordinates are unaltered from their original values.

 

The onrclick and onlclick callbacks specify functions to run when the associated event occurs. For example, consider the following callback function:

 

 

/* right click callback */

mgn_onrclick()

{

    message("Right Click");

}

 

 

Now for:

 

magnify(0, 1, -1, 0, "mgn_onrclick")

 

The mgn_onrclick function is invoked when the right mouse button is clicked. In this case, a message is displayed.

See Also:

SETXY

ZOOM