magic/doc/html/cursor.html

96 lines
3.7 KiB
HTML
Raw Normal View History

<HTML>
<HEAD>
<STYLE type="text/css">
H1 {color: black }
H2 {color: maroon }
H3 {color: #007090 }
A.head:link {color: #0060a0 }
A.head:visited {color: #3040c0 }
A.head:active {color: white }
A.head:hover {color: yellow }
A.red:link {color: red }
A.red:visited {color: maroon }
A.red:active {color: yellow }
</STYLE>
</HEAD>
<TITLE>Magic-8.3 Command Reference</TITLE>
<BODY BACKGROUND=graphics/blpaper.gif>
<H1> <IMG SRC=graphics/magic_title8_3.png ALT="Magic VLSI Layout Tool Version 8.3">
<IMG SRC=graphics/magic_OGL_sm.gif ALIGN="top" ALT="*"> </H1>
<H2>cursor</H2>
<HR>
Return <B>magic</B> internal coordinates of the cursor (X11 pointer)
<HR>
<H3>Usage:</H3>
<BLOCKQUOTE>
<B>cursor</B> <I>glyphnum</I> <BR><BR>
<B>cursor</B> [<B>internal</B>|<B>lambda</B>|<B>user</B>] <BR><BR>
<B>cursor</B> [<B>microns</B>|<B>window</B>|<B>screen</B>]
</BLOCKQUOTE>
<H3>Summary:</H3>
<BLOCKQUOTE>
The <B>cursor</B> command has two distinct uses. When followed
by an integer value, the cursor glyph is changed to the indicated
glyph, as defined internally to Magic. <BR>
When used without an option, or when followed by a measurement
metric "internal", "lambda", or "user", the <B>cursor</B> command
returns the current position of the cursor (the X11 pointer, not
the <B>magic</B> cursor box) in layout coordinates. The coordinates
are given in the indicated metric, or in internal units by default. <P>
Magic version 8.1 defines the additional option "<B>microns</B>",
which is like the metrics mentioned above bug returns the current
position of the cursor in micron units, where the scalefactor for
determining micron units is defined by the current CIF/GDS output
style. <P>
Magic version 8.1 also defines two options for returning pixel
coordinates: Option "<B>window</B>" returns the pointer coordinate
in pixels from the bottom left-hand corner of the layout window.
Option "<B>screen</B>" returns the pointer coordinate in pixels
relative to the root screen. In X11, this is defined as the top
left-hand corner of the screen. This second form is useful for
interacting with the window manager, for example, to open up a new
window or drop-down menu next to the pointer position.
</BLOCKQUOTE>
<H3>Implementation Notes:</H3>
<BLOCKQUOTE>
<B>cursor</B> is implemented as a built-in window command in <B>magic</B>.
In the Tcl version of magic, it returns a Tcl result (list of two
elements, <B>x</B> and <B>y</B> coordinates). <P>
Like all window commands, it reports relative to the existing window
if only one window is present, or the active window if called with
the "<TT>:</TT>" macro. Otherwise, it must be called using the
<I>tk_path_name</I> command to specify relative to which layout
window the cursor coordinates will be given. <P>
The value returned by <B>cursor</B> may be modified according to the
state set by the <B>snap</B> command. <B>cursor user</B> reports
units relative to the grid set by the <B>grid</B> command, which may
differ in aspect between the X and Y axes. <P>
Note, as stated above, which versions of magic support which options. <P>
</BLOCKQUOTE>
<H3>See Also:</H3>
<BLOCKQUOTE>
<A HREF=snap.html><B>snap</B></A> <BR>
<A HREF=grid.html><B>grid</B></A> <BR>
<A HREF=tk_path_name.html><I>tk_path_name</I></A> <BR>
</BLOCKQUOTE>
<P><IMG SRC=graphics/line1.gif><P>
<TABLE BORDER=0>
<TR>
<TD> <A HREF=commands.html>Return to command index</A>
</TR>
</TABLE>
<P><I>Last updated:</I> March 7, 2020 at 1:06pm <P>
</BODY>
</HTML>