' *** RECTNGLE.LST *** 2nd GFA-Manual, page 20-27 > PROCEDURE rectangle(VAR rectangle$,x,y) ' ' *** User defines rectangle as GET-string rectangle$ ' *** Coordinates (x&,y&) of left upper corner are also returned ' *** Instructions for user are shown in reverse on bottom-line of TOS-screen ' ' *** Standard: x.max& y.max& char.height& line.max& col.max& ' *** Procedure: Point ' LOCAL message.scrn$,text$,clp.x2,clp.y2,x1,y1,mx,my,x2,y2,k @point(" Click on left upper corner ",x,y) DEFMOUSE 0 GET 0,y.max-char.height,x.max,y.max,message.scrn$ ! save screen under message LOCATE 1,line.max PRINT CHR$(27);"K"; ! erase line text$=" Draw rectangle (confirm with click) " PRINT SPACE$((col.max-LEN(text$))/2)+CHR$(27)+"p"+text$+CHR$(27)+"q"; PAUSE 50 x1=MOUSEX y1=MOUSEY SHOWM REPEAT MOUSE mx,my,k UNTIL mx<>x1 OR my<>y1 ! wait for mouse-movement PUT 0,y.max-char.height,message.scrn$,3 ! restore screen GRAPHMODE 3 MOUSE x2,y2,k REPEAT BOX x,y,x2,y2 ! draw rectangle PLOT x,y SHOWM REPEAT MOUSE clp.x2,clp.y2,k UNTIL (clp.x2<>x2 OR clp.y2<>y2 OR k>0) AND (clp.x2>x AND clp.y2>y) BOX x,y,x2,y2 ! erase rectangle PLOT x,y x2=clp.x2 y2=clp.y2 UNTIL k>0 GRAPHMODE 1 GET x,y,clp.x2,clp.y2,rectangle$ ! this is the one PAUSE 10 ! give user time to release button RETURN ' ********* '