<< JunoCursorJunk.mesa>> << Last edited by Stolfi May 18, 1984 10:33:59 pm PDT>> << Removed May 18, 1984 10:23:47 pm PDT PDT from JunoCursorMenuImpl.mesa:>> << From RemoveCursor:>> << IF ix=-1 THEN -- DEBUG {ViewerOps.NotifyViewer -- DEBUG [menu.parent, LIST[$Debug, $NotFound, name]]; -- DEBUG RETURN}; -- DEBUG>> << From PickUpCursor:>> << IF ix=-1 THEN -- DEBUG {ViewerOps.NotifyViewer -- DEBUG [menu.parent, LIST[$Debug, $NotFound, name]]; -- DEBUG RETURN}; -- DEBUG>> << From HighlightCursor:>> << IF champ=-1 THEN -- DEBUG {ViewerOps.NotifyViewer -- DEBUG [menu.parent, LIST[$Debug, $NotFound, name]]; -- DEBUG RETURN}; -- DEBUG>> << From MousedCursor:>> << IF table.cursor[champ].type = blank THEN -- no luck>> << BEGIN>> << Try exhaustive search>> << champ _ -1;>> << zcol, zrow: INTEGER; xc, yc: INTEGER; -- center of current candidate cursor ix: INTEGER _ 0; champDist: INTEGER _ 2*cursorDelta+1; -- distance between champ and click dist: INTEGER;>> << yc _ extraMargin+cursorMargin+8 + (table.rows-1)*cursorDelta; FOR zrow IN [1..table.rows] DO xc _ extraMargin+cursorMargin+8; FOR zcol IN [1..table.cols] DO IF table.cursor[ix].type # blank THEN {dist _ MAX [ABS[y - yc], ABS[x - xc]]; IF dist < champDist THEN {champ _ ix; champDist _ dist; col _ zcol; row _ zrow}}; ix _ ix+1; xc _ xc + cursorDelta ENDLOOP; yc _ yc - cursorDelta ENDLOOP>> << END;>> << From ProcessMenuClicks:>> << ViewerOps.NotifyViewer [self.parent, CONS [$Debug, input]]; -- DEBUG>> << IF champ = -1 THEN -- DEBUG {ViewerOps.NotifyViewer -- DEBUG [self.parent, LIST[$Debug, $Missed]]; -- DEBUG RETURN}; -- DEBUG>> << Removed May 18, 1984 10:20:30 pm PDT from JunoCursorTest.mesa:>> ItemsChanged: CONDITION; GetNewItems: ENTRY PROC RETURNS [start, lim: LIST OF Item] = BEGIN WAIT ItemsChanged; RETURN [items, olditems]; END; WatchNewItems: PROC = BEGIN old, new: LIST OF Item _ NIL; DO new_ GetNewItems[]; FOR p: LIST OF Item _ new, p.rest WHILE p#old DO ViewerOps.PaintViewer [viewer: viewer, hint: client, clearClient: FALSE, whatChanged: p.first] ENDLOOP; old _ new ENDLOOP END; Process.Detach[FORK WatchNewItems[]]