(DEFINE-FILE-INFO PACKAGE "IL" READTABLE "INTERLISP" BASE 10)
(FILECREATED "14-Jun-88 14:47:09" {QV}<NOTECARDS>1.3LNEXT>RGPATCH084.;3 8123   

      changes to%:  (VARS RGPATCH084COMS)
                    (FNS NCP.ClearMsg NC.ZapPromptWindowWaiter NC.ClearMsg NC.ClearMsgNow 
                         NC.ClearMsgWaiter)

      previous date%: "11-Jun-88 20:03:50" {QV}<NOTECARDS>1.3LNEXT>RGPATCH084.;1)


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

(PRETTYCOMPRINT RGPATCH084COMS)

(RPAQQ RGPATCH084COMS (
                       (* ;; "rg 6/10/88: new feature for IDE.  NC.ClearMsg has WaitMsecs arg, window will not clear before specified delay.  Subsequent calls override previous ones")

                       
                       (* ;; "new for NCUTILITIES")

                       (FNS NC.ClearMsgNow NC.ClearMsgWaiter NC.ZapPromptWindowWaiter)
                       
                       (* ;; "changes to NCUTILITIES")

                       (FNS NC.ClearMsg)
                       
                       (* ;; "changes to NCPROGINT")

                       (FNS NCP.ClearMsg)))



(* ;; 
"rg 6/10/88: new feature for IDE.  NC.ClearMsg has WaitMsecs arg, window will not clear before specified delay.  Subsequent calls override previous ones"
)




(* ;; "new for NCUTILITIES")

(DEFINEQ

(NC.ClearMsgNow
  [LAMBDA (MainWindow ClosePromptWindowFlg)           (* ; "Edited  9-Jun-88 14:25 by Randy.Gobbel")
                                                             (* ; 
                                        "Clear and optionally close the prompt 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.")

(* ;;; "fgh 6/8/86 Added call to REPOSITIONATTACHEDWINDOWS")

(* ;;; "fgh 6/13/86 Now uses prompt window for NF menus as well as cards.")

(* ;;; "fgh 6/27/86 Updated to match window width changes in NC.PrintMsg")

(* ;;; 
"fgh&rht 7/4/86: Now checks that window isn't shrunken before calling REPOSITIONATTACHEDWINDOWS")

(* ;;; "fgh 7/5/86 Redid the previous fix.  Replaced REPOSITIONATTACHEDWINDOWS with FREEATTACHWINDOW in order to handle cases for open but buried windows as well as shrunken windows.")

(* ;;; "rht&rg&pmi: 4/22/87: Now smashes the PromptWindowProcess windowprop.")

(* ;;; "rg 6/8/88: Renamed from NC.ClearMsg, which now takes a wait time arg.")

    (* ;; "WARNING! This procedure should only be called from inside NC.PromptWindowMonitorLock!")

    (LET (PromptWindow)
         (COND
            [(WINDOWP MainWindow)
             (COND
                [(NC.NoteCardsWindowP MainWindow)
                 (SETQ PromptWindow (NC.GETPROMPTWINDOW MainWindow NIL NIL T))
                 (if (OPENWP PromptWindow)
                     then (CLEARW PromptWindow))
                 (WINDOWPROP PromptWindow 'MaxLineWidth NIL)
                 (WINDOWPROP PromptWindow 'LastLineLength NIL)
                 (WINDOWPROP PromptWindow 'OldMaxWidth 0)
                 (WINDOWPROP MainWindow 'PromptWindowLastNotCR NIL)
                 (COND
                    (ClosePromptWindowFlg (WINDOWPROP PromptWindow 'PromptWindowProcess NIL)
                           [WINDOWDELPROP MainWindow 'OtherPromptWindows (ASSOC PromptWindow
                                                                                (WINDOWPROP
                                                                                 MainWindow
                                                                                 'OtherPromptWindows]
                           (FREEATTACHEDWINDOW PromptWindow)
                           (REMOVEWINDOW PromptWindow]
                (T (CLEARW MainWindow)
                   (if ClosePromptWindowFlg
                       then (CLOSEW MainWindow]
            (T (CLRPROMPT])

(NC.ClearMsgWaiter
  [LAMBDA (Window)                                    (* ; "Edited  9-Jun-88 17:23 by Randy.Gobbel")
    (LET (WakeupTime ClosePromptWindowFlg)
         (WITH.MONITOR NC.PromptWindowMonitorLock
             (while [NOT (TIMEREXPIRED? (WINDOWPROP Window 'ClearMsgTimer]
                do (MONITOR.AWAIT.EVENT NC.PromptWindowMonitorLock (WINDOWPROP Window 'ClearMsgEvent)
                          (WINDOWPROP Window 'ClearMsgTimer)
                          T))
             (WINDOWDELPROP Window 'CLOSEFN (FUNCTION NC.ZapPromptWindowWaiter))
             (WINDOWPROP Window 'ClearMsgEvent NIL)
             (WINDOWPROP Window 'ClearMsgTimer NIL)
             (WINDOWPROP Window 'ClearPromptWindowProcess NIL)
             (SETQ ClosePromptWindowFlg (WINDOWPROP Window 'ClosePromptWindowFlg NIL))
             (NC.ClearMsgNow Window ClosePromptWindowFlg))])

(NC.ZapPromptWindowWaiter
  [LAMBDA (Window)                                    (* ; "Edited  9-Jun-88 17:16 by Randy.Gobbel")
    (WITH.MONITOR NC.PromptWindowMonitorLock
        (LET [(PromptWindowWaiter (WINDOWPROP Window 'ClearPromptWindowProcess]
             (WINDOWDELPROP Window 'CLOSEFN (FUNCTION NC.ZapPromptWindowWaiter))
             (AND (PROCESSP PromptWindowWaiter)
                  (DEL.PROCESS PromptWindowWaiter))))])
)



(* ;; "changes to NCUTILITIES")

(DEFINEQ

(NC.ClearMsg
  [LAMBDA (MainWindow ClosePromptWindowFlg WaitMsecs) (* ; "Edited  9-Jun-88 17:16 by Randy.Gobbel")
                                                             (* ; "Clear and optionally close the prompt window for MainWindow.  Wait (at least) specified time if supplied")

(* ;;; "rg 6/8/88: Created.  Old code now in NC.ClearMsgNow.")

    (DECLARE (GLOBALVARS NC.PromptWindowMonitorLock))
    (WITH.MONITOR NC.PromptWindowMonitorLock
        0
        (if (NOT (WINDOWP MainWindow))
            then (SETQ MainWindow (GETPROMPTWINDOW)))
        [if [AND (NULL WaitMsecs)
                 (NOT (WINDOWPROP MainWindow 'ClearPromptWindowProcess]
            then 
                 (* ;; "no waiting involved")

                 (NC.ClearMsgNow MainWindow ClosePromptWindowFlg)
          else 
               (* ;; 
             "window already has a waiter of needs one.  Must at least update close/clear parameters")

               [WINDOWPROP MainWindow 'ClosePromptWindowFlg (OR ClosePromptWindowFlg
                                                                (WINDOWPROP MainWindow '
                                                                       ClosePromptWindowFlg]
               [if (NUMBERP WaitMsecs)
                   then 
                        (* ;; "set time for action, overriding any previously specified value")

                        (WINDOWPROP MainWindow 'ClearMsgTimer (SETUPTIMER WaitMsecs
                                                                     (WINDOWPROP MainWindow
                                                                            'ClearMsgTimer]
               (if (NOT (WINDOWPROP MainWindow 'ClearPromptWindowProcess))
                   then (WINDOWPROP MainWindow 'ClearMsgEvent (CREATE.EVENT 'ClearMsgEvent))
                        (WINDOWADDPROP MainWindow 'CLOSEFN (FUNCTION NC.ZapPromptWindowWaiter))
                        (WINDOWPROP MainWindow 'ClearPromptWindowProcess
                               (ADD.PROCESS `(NC.ClearMsgWaiter ,MainWindow])])
)



(* ;; "changes to NCPROGINT")

(DEFINEQ

(NCP.ClearMsg
  [LAMBDA (Window ClosePromptWinFlg WaitMsecs)        (* ; "Edited 14-Jun-88 14:45 by Randy.Gobbel")

(* ;;; "Clears the prompt window for Window.  Will close if ClosePromptWinFlg is non-nil.")

    (* ;; "rg 6/14/88: Added WaitMsecs arg.")

    (NC.ClearMsg Window ClosePromptWinFlg WaitMsecs])
)
(PUTPROPS RGPATCH084 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1347 5522 (NC.ClearMsgNow 1357 . 4184) (NC.ClearMsgWaiter 4186 . 5078) (
NC.ZapPromptWindowWaiter 5080 . 5520)) (5563 7673 (NC.ClearMsg 5573 . 7671)) (7712 8041 (NCP.ClearMsg 
7722 . 8039)))))
STOP