(FILECREATED "15-Jan-86 22:12:19" {QV}<NOTECARDS>1.3K>RHTPATCH023.;1 4213   

      changes to:  (VARS RHTPATCH023COMS))


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT RHTPATCH023COMS)

(RPAQQ RHTPATCH023COMS ((* * Fixed functions from NCBROWSERCARD)
			  (FNS NC.MakeLinksLegendMenu NC.SetBrowserRoots)))
(* * Fixed functions from NCBROWSERCARD)

(DEFINEQ

(NC.MakeLinksLegendMenu
  (LAMBDA (Win LabelPairs)                                   (* rht: "15-Jan-86 21:55")

          (* * Build a links legend menu and attach to Win)



          (* * rht 1/10/85: Before starting, kill any old links legend menus for Win.)



          (* * rht 1/13/86: Now holds onto value of PASSTOMAINCOMS windowprop of prompt win and restores after reattaching.)



          (* * rht 1/15/86: Added windowprops MINSIZE and MAXSIZE to fix the bug where reshaping browser screws up links 
	  legend menu.)


    (PROG (Menu MenuWin PromptWin MainWinPromptInfo PromptWinPASSTOMAINCOMS)
	    (for AttachedWin in (ATTACHEDWINDOWS Win) when (WINDOWPROP AttachedWin
										 (QUOTE 
										  LINKSLEGENDWINP))
	       do (CLOSEW AttachedWin))
	    (SETQ Menu (COND
		(NC.LinkDashingInBrowser (create MENU
						   ITEMS ←(for Pair in LabelPairs
							     join (LIST (CAR Pair)
									    (LIST (QUOTE "  "))))
						   TITLE ←(QUOTE Links)
						   MENUCOLUMNS ← 2))
		(T (create MENU
			     ITEMS ←(for Pair in LabelPairs collect (CAR Pair))
			     TITLE ←(QUOTE Links)
			     MENUCOLUMNS ← 1))))             (* Detach the prompt window for a second, saving the 
							     prompt window info from the main win's props.)
	    (if (SETQ PromptWin (GETPROMPTWINDOW Win NIL NIL T))
		then (SETQ MainWinPromptInfo (WINDOWPROP Win (QUOTE PROMPTWINDOW)))
		       (SETQ PromptWinPASSTOMAINCOMS (WINDOWPROP PromptWin (QUOTE 
										   PASSTOMAINCOMS)))
		       (DETACHWINDOW PromptWin))           (* Stick the links legend window at upper right 
							     corner.)
	    (ATTACHWINDOW (SETQ MenuWin (ADDMENU Menu NIL NC.OffScreenPosition))
			    Win
			    (QUOTE RIGHT)
			    (QUOTE TOP)
			    (QUOTE LOCALCLOSE))
	    (WINDOWADDPROP MenuWin (QUOTE REPAINTFN)
			     (QUOTE NC.LinksLegendRepaintFn))
	    (WINDOWADDPROP MenuWin (QUOTE RESHAPEFN)
			     (QUOTE NC.LinksLegendReshapeFn))
	    (WINDOWADDPROP MenuWin (QUOTE LINKSLEGENDWINP)
			     T)
	    (WINDOWPROP MenuWin (QUOTE MINSIZE)
			  (QUOTE MENUWMINSIZEFN))
	    (WINDOWPROP MenuWin (QUOTE MAXSIZE)
			  (QUOTE MENUWMINSIZEFN))
	    (WINDOWPROP Win (QUOTE NCLABELPAIRS)
			  LabelPairs)                        (* Put back the prompt window if it exists.)
	    (if PromptWin
		then (ATTACHWINDOW PromptWin Win (QUOTE TOP)
				       (QUOTE LEFT))
		       (WINDOWPROP PromptWin (QUOTE PASSTOMAINCOMS)
				     PromptWinPASSTOMAINCOMS)
		       (WINDOWPROP Win (QUOTE PROMPTWINDOW)
				     MainWinPromptInfo))
	    (MOVEW Win (MAKEWITHINREGION (WINDOWREGION Win)
					     WHOLESCREEN))   (* For some reason, the above MOVEW tends to leave the
							     prompt window open.)
	    (if (OPENWP PromptWin)
		then (CLOSEW PromptWin))
	    (if NC.LinkDashingInBrowser
		then (NC.LinksLegendRepaintFn MenuWin NIL))
	NIL)))

(NC.SetBrowserRoots
  (LAMBDA (Card BrowserRoots)                                (* rht: "15-Jan-86 22:10")

          (* * Put the roots on the Card's property list in the CardUID/NoteFileUID pair format.)


    (NC.PutProp Card (QUOTE BrowserRootUIDPairs)
		  (for BrowserRoot in BrowserRoots eachtime (BLOCK)
		     collect (CONS (fetch (Card UID) of BrowserRoot)
				       (fetch (NoteFile UID) of (fetch (Card NoteFile)
								       of BrowserRoot)))))))
)
(PUTPROPS RHTPATCH023 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (401 4131 (NC.MakeLinksLegendMenu 411 . 3597) (NC.SetBrowserRoots 3599 . 4129)))))
STOP