;;; -*- Mode: Common-Lisp; Package: User; Base: 10.; Patch-File: T -*-

;;; Reason: Changed cvv-read-pop-up-string to NOT :set-superior which leaves the resource
;;; pointing to an un-exposeable temporary menu for other users of the same resource.
;;; Also made pop-up menu COMPLETELY cover superior to prevent user from trying to 
;;; mouse on margin choices that don't take effect until later.

;;;                           RESTRICTED RIGHTS LEGEND
;;;
;;; Use, duplication, or disclosure by the Government is subject to
;;; restrictions as set forth in subdivision (c)(1)(ii) of the Rights in
;;; Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;   TEXAS INSTRUMENTS INCORPORATED      
;;;   P.O. BOX 2909, M/S 2151             
;;;   AUSTIN, TEXAS 78769                 
;;;
;;; Copyright (C) 1988 Texas Instruments Incorporated.
;;; All rights reserved.

;;; Written 07/22/88 17:50:24 by MARKY,
;;; while running on LIBRA from band LODA
;;; With SYSTEM 4.74, VIRTUAL-MEMORY 4.4, EH 4.5, MAKE-SYSTEM 4.6, MICRONET 4.5, Experimental LOCAL-FILE 4.2,
;;;  BASIC-PATHNAME 4.13, NETWORK-SUPPORT-COLD 4.1, NAMESPACE 4.23, NETWORK-NAMESPACE 4.3,
;;;  DISK-IO 4.16, DISK-LABEL 4.0, BASIC-FILE 4.13, MAC-PATHNAME 4.10, NETWORK-PATHNAME 4.1,
;;;  COMPILER 4.13, TV 4.100, DATALINK 4.16, CHAOSNET 4.19, GC 4.3, MEMORY-AUX 4.1,
;;;  NVRAM 4.6, SYSLOG 4.0, STREAMER-TAPE 4.8, UCL 4.1, INPUT-EDITOR 4.0, METER 4.3,
;;;  ZWEI 4.28, DEBUG-TOOLS 4.2, NETWORK-SUPPORT 4.6, NETWORK-SERVICE 4.0, DATALINK-DISPLAYS 4.0,
;;;  FONT-EDITOR 4.0, SERIAL 4.0, PRINTER 4.10, PRINTER-TYPES 4.5, IMAGEN 4.1, SUGGESTIONS 4.0,
;;;  MAIL-DAEMON 4.9, MAIL-READER 4.9, TELNET 4.1, VT100 4.6, NAMESPACE-EDITOR 4.5,
;;;  PROFILE 4.4, VISIDOC 4.5, IP 3.21, Experimental BUG 10.0,  microcode 345, Band Name: Rel 4.1.1 + IP 6/15

#!C
; From file UPDATE-BUG.LISP#> BUG; VIRGO:
#10R USER#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "USER"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* SYS:COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: BUG; UPDATE-BUG.#"


;;;  revised by may 7-22-88. 
(defun cvv-read-pop-up-string (old-value)
   ;;  The following modified from the definition of pop-up-edstring.  The lowercase
   ;;  is mine.  Note that this version really does go into Text Mode, really does
   ;;  go into Auto Fill, and returns the old value unchanged if the user aborts.

   (USING-RESOURCE (WINDOW zwei:POP-UP-STANDALONE-EDITOR-FRAME)
	 (send WINDOW :SET-COMTAB zwei:*standalone-comtab*)
         ;; (send WINDOW :SET-SUPERIOR TV:SELECTED-WINDOW) ;; causes output hold exceptions if not cleared in resource later
	 ;; below used to allow user mouse interactions with the menu - this is probably undesired. Now the invoking menu gets
	 ;; covered up completely. may 7-22-88.
	 ;; (send WINDOW :SET-SIZE-FROM-STRING old-value (send (send window :superior) :inside-width) 300)
	 (LET* ((superior tv:selected-window) 	;; may 7-22-88
		(w (send superior :width))	;; may 7-22-88
		(h (send superior :height))	;; may 7-22-88
		(x (send superior :x-offset))	;; may 7-22-88
		(y (send superior :y-offset)))	;; may 7-22-88
	   (SEND window :set-size-from-string old-value w h);; may 7-22-88 min-width and min-height cover menu

	   (send WINDOW :SET-INTERVAL-STRING old-value)
	 
	   (send WINDOW :SET-MODE-LINE-LIST
		 '(zwei:*mode-name-list* (:right-flush "(Press the END key to exit, ABORT to abort)")))
	   (send (send window :editor-closure)
		 window :eval-inside-yourself '(progn (zwei:com-text-mode)
						      (zwei:turn-on-mode 'zwei:auto-fill-mode)))
	   (W:EXPOSE-WINDOW-NEAR WINDOW ;; Make pop-up overlay window, hiding mouse sensitive areas. Was: '(:point 0 0))
				 `(:point ,(+ x (ASH w -1)) ,(+ y (ASH h -1))))) ;; may 7-22-88
	 (send WINDOW :TYPEIN-LINE "Type in and edit your description above.")
	 (W:WINDOW-CALL (WINDOW :DEACTIVATE)
	       (CATCH 'zwei:ABORT-STANDALONE-EDIT
		 (send WINDOW :EDIT)
		 (SETF OLD-VALUE (send WINDOW :INTERVAL-STRING))))
             
	     )old-value)



;; Clear any existing resources for patch to take effect
(si:clear-resource 'zwei:POP-UP-STANDALONE-EDITOR-FRAME nil nil)


))
