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.
|