(FILECREATED " 1-May-86 20:09:28" {QV}<NOTECARDS>1.3K>FGHPATCH027.;1 3506   

      changes to:  (VARS FGHPATCH027COMS)
		   (FNS NC.ClearMsg NC.AttachPromptWindow))


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

(PRETTYCOMPRINT FGHPATCH027COMS)

(RPAQQ FGHPATCH027COMS ((* * Fixes to bugs in the promptwindow above the NC sesssion icon.)
			  (* * From NCUTILTIES)
			  (FNS NC.ClearMsg)
			  (* * FROM NCINTERFACE)
			  (FNS NC.AttachPromptWindow)))
(* * Fixes to bugs in the promptwindow above the NC sesssion icon.)

(* * From NCUTILTIES)

(DEFINEQ

(NC.ClearMsg
  (LAMBDA (MainWindow ClosePromptWindowFlg)                  (* fgh: " 1-May-86 20:07")
                                                             (* Clear and optionally close the promnpt window for 
							     MainWindow)

          (* * rht 9/10/85: Fixed so closes instead of removing prompt window and clears whether prompt win gets closed or 
	  not.)



          (* * rht 11/7/85: Now checks if MainWindow is a NC window. If so, clears its promptwindow. If not, clears 
	  MainWindow itself.)



          (* * fgh 5/1/86 Fix to above fix. If clearing MainWindow, still need to check the ClosePromptWindowFlg.
	  Don't close the main window if this flag in NIL.)


    (LET (PromptWindow)
         (if (WINDOWP MainWindow)
	     then (if (NC.CoerceToCard MainWindow)
			then (CLEARW (SETQ PromptWindow (GETPROMPTWINDOW MainWindow)))
			       (if ClosePromptWindowFlg
				   then (CLOSEW PromptWindow))
		      else (CLEARW MainWindow)
			     (if ClosePromptWindowFlg
				 then (CLOSEW MainWindow)))
	   else (CLRPROMPT)))))
)
(* * FROM NCINTERFACE)

(DEFINEQ

(NC.AttachPromptWindow
  (LAMBDA (MainWindow XSize YSize Font DontCreate)           (* fgh: " 1-May-86 20:09")

          (* * GETPROMPTWINDOW that works for small windows. sizes default to 300 X 60)



          (* * fgh 5/1/86 MainWindowXSize now based on MainWindow's (REGION WIDTH) not its (REGION RIGHT).)


    (if MainWindow
	then (LET (PromptWindow PromptWindowRegion MainWindowRegion MainWindowXSize)
		    (OR XSize (SETQ XSize 300))
		    (OR YSize (SETQ YSize 60))
		    (SETQ MainWindowRegion (WINDOWPROP MainWindow (QUOTE REGION)))
		    (SETQ MainWindowXSize (fetch (REGION WIDTH) of MainWindowRegion))
		    (if (IGREATERP MainWindowXSize XSize)
			then (GETPROMPTWINDOW MainWindow (IQUOTIENT YSize 15)
						  Font DontCreate)
		      else (AND (SETQ PromptWindowRegion (CREATEREGION 0 0 XSize YSize))
				    (SETQ PromptWindow (CREATEW PromptWindowRegion NIL NIL T))
				    (ATTACHWINDOW PromptWindow MainWindow
						    (if (GREATERP YSize
								      (DIFFERENCE
									(fetch (REGION TOP)
									   of WHOLEDISPLAY)
									(fetch (REGION TOP)
									   of MainWindowRegion)))
							then (QUOTE BOTTOM)
						      else (QUOTE TOP))
						    (if (GREATERP XSize
								      (DIFFERENCE
									(fetch (REGION RIGHT)
									   of WHOLEDISPLAY)
									MainWindowXSize))
							then (QUOTE RIGHT)
						      else (QUOTE LEFT))
						    (QUOTE LOCALCLOSE))
				    PromptWindow))))))
)
(PUTPROPS FGHPATCH027 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (586 1763 (NC.ClearMsg 596 . 1761)) (1793 3424 (NC.AttachPromptWindow 1803 . 3422)))))
STOP