comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Giant crosshairs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Giant crosshairs [message #545] Fri, 28 August 1992 16:14 Go to previous message
james is currently offline  james
Messages: 9
Registered: March 1992
Junior Member
In article <laa-270892173708@berserk.c3.lanl.gov> laa@lanl.gov (Lee Ankeny) writes:
> Hello Wave gurus,
>
> I'd like to implement a "giant crosshair", like the old tek terminals used
> to have. It would extend from top edge to bottom edge, and left edge to
> right edge of the window, intersecting at the current mouse pointer
> location.
>

Hi Lee. You might give this a try. Not guaranteed to be bullet proof :-)
But it should get you going in the right direction. Courtesy of
Mike 4 Mayer, PVI field Technical Sales Engineer.

----8<----------CUT HERE -----8<---------------CUT HERE-------------

PRO BIGHAIR, x, y
;
; Procedure to get cursor location in current window,
; using cursor lines across the entire window.
; The X and Y cursor locations (in pixels) are returned.
; Further modification could allow Normalized or
; Data coordinates to be returned.
;
; Mike Mayer, 8/28/92
;
; Usage:
; WAVE> BIGHAIR, x, y
;
PRINT, 'Press left mouse button to quit...'
DEVICE, Get_Graphics = oldmode
DEVICE, Set_Graphics = 6 ; XOR write mode.
xmax = !D.X_Vsize
ymax = !D.Y_Vsize
!Err = 0 ; Reset.
CURSOR, oldx, oldy, /Device, /Change
PLOTS, [oldx, oldx], [0, ymax], /Device ; Draw first crosshairs.
PLOTS, [0, xmax], [oldy, oldy], /Device ; Draw first crosshairs.
EMPTY
WHILE !Err NE 1 DO BEGIN
CURSOR, x, y, /Device, /Change
PLOTS, [oldx, oldx], [0, ymax], /Device ; Erase last crosshairs.
PLOTS, [0, xmax], [oldy, oldy], /Device ; Erase last crosshairs.
PLOTS, [x, x], [0, ymax], /Device ; Draw new crosshairs.
PLOTS, [0, xmax], [y, y], /Device ; Draw new crosshairs.
oldx = x
oldy = y
EMPTY
ENDWHILE
PLOTS, [oldx, oldx], [0, ymax], /Device ; Erase last crosshairs.
PLOTS, [0, xmax], [oldy, oldy], /Device ; Erase last crosshairs.
DEVICE, Set_Graphics = oldmode
PRINT, 'X = ' + STRTRIM(x, 2), ' Y = ' + STRTRIM(y, 2)
END

----8<----------CUT HERE -----8<---------------CUT HERE-------------

James K. Phillips Sprocket Scientist pvi!james@boulder.colorado.edu
Precision Visuals, Inc. (303) 530-9000
6260 Lookout Rd Boulder - A quaint little town nestled between
Boulder, CO 80301 the ROCKIES and REALITY.
[Message index]
 
Read Message
Read Message
Previous Topic: WANTED: 2 IDL routines
Next Topic: IDL & PV~WAVE routine ftp archives

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:29:30 PDT 2025

Total time taken to generate the page: 0.00390 seconds