(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP")
(FILECREATED "10-Feb-88 12:17:36" {QV}<NOTECARDS>1.3LNEXT>PMIPATCH086.;1 6106   

      changes to%:  (VARS PMIPATCH086COMS))


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

(PRETTYCOMPRINT PMIPATCH086COMS)

(RPAQQ PMIPATCH086COMS (
          
          (* ;; "pmi 2/10/88: Fixes problem with opening up a card whose definition is not loaded")

                        (DECLARE%: DONTCOPY (PROPS (PMIPATCH086 MAKEFILE-ENVIRONMENT)
                                                   (PMIPATCH086 FILETYPE)))
                        
          
          (* ;; "Changed in NCCARDS")

                        (FNS NC.EditNoteCard)))



(* ;; "pmi 2/10/88: Fixes problem with opening up a card whose definition is not loaded")

(DECLARE%: DONTCOPY 

(PUTPROPS PMIPATCH086 MAKEFILE-ENVIRONMENT (:PACKAGE "INTERLISP" :READTABLE "INTERLISP"))

(PUTPROPS PMIPATCH086 FILETYPE :BCOMPL)
)



(* ;; "Changed in NCCARDS")

(DEFINEQ

(NC.EditNoteCard
  [LAMBDA (Card ReadOnly RegionOrPosition TypeSpecificArgs)  (* ; "Edited 10-Feb-88 12:09 by pmi")
          
          (* ;; "Bring the already created NoteCard specified by ID onto the screen at Region or Position specified by RegionOrPosition")
          
          (* ;; "fgh 11/11/85: Updated to handle new Card object.")
          
          (* ;; "fgh 2/5/86 Added call to NC.ApplyFn")
          
          (* ;; "kirk 15May86 Added call to NC.AttachNoteFileName")
          
          (* ;; "rht 7/13/86: Added TypeSpecificArgs arg.")
          
          (* ;; "kef 7/16/86: Added NC.ObtainCardEditPermission.")
          
          (* ;; "kef 8/7/86: Added check to make sure that applying the EditFn worked.  If not, then release those write locks, thus keeping the writelock count consistent.")
          
          (* ;; "fgh 8/30/86 Converted APPLY* to NC.ApplyFn.")
          
          (* ;; "rht 10/6/86: Added checks before doing WINDOWPROP calls in case there was a recursive call to NC.EditNoteCard.")
          
          (* ;; "rg 3/30/87 added NC.ProtectedCardOperation wrapper")
          
          (* ;; "rht 5/13/87: Added call to new NC.InstallCopyButtonEventFn.")
          
          (* ;; "dsj 9/22/87: Included check for valid card type of destination card.")
          
          (* ;; "rg 11/4/87 added ReadOnly arg")
          
          (* ;; "pmi 12/30/87: Added dsj's change;  see comment above.")
          
          (* ;; "pmi 2/10/88: Replaced bogus InterestedWindow argument with NIL in call to NCP.PrintMsg if card type definition is missing.")

    (DECLARE (GLOBALVARS NC.ShowNoteFileOnCards))
    (NC.ProtectedCardOperation Card "Edit NoteCard" NIL (RESETSAVE (CURSOR WAITINGCURSOR))
           (LET ((NoteCardType (NC.RetrieveType Card))
                 (CardWindow (NCP.CardWindow Card)))
                (if (NCP.CardTypeP NoteCardType)
                    then (PROG (Window Substance EditResult)
                               [COND
                                  ((AND (NC.ActiveCardP Card)
                                        (NC.ObtainEditPermission Card))
                                   (SETQ Substance (NC.FetchSubstance Card)))
                                  ((NC.ObtainEditPermission Card)
                                   (NC.GetNoteCard Card)
                                   (SETQ Substance (NC.FetchSubstance Card)))
                                  (T (RETURN (NC.CardPartBusy Card '(SUBSTANCE TOLINKS GLOBALTOLINKS 
                                                                           PROPLIST]
                               (COND
                                  ([AND (SETQ EditResult (ERSETQ (NC.ApplyFn EditFn Card Substance 
                                                                        RegionOrPosition 
                                                                        TypeSpecificArgs)))
                                        (WINDOWP (SETQ Window (CAR EditResult]
                                   (WINDOWADDPROP Window 'CLOSEFN (FUNCTION NC.QuitCard)
                                          'FIRST)
                                   (OR (NC.CardP (WINDOWPROP Window 'NoteCardObject))
                                       (WINDOWPROP Window 'NoteCardObject Card))
                                   (NC.InstallCopyButtonEventFn Window)
                                   (if NC.ShowNoteFileOnCards
                                       then (NC.AttachNoteFileName Window)))
                                  (T                         (* ; 
       "At this point, we've obtain the write locks but the edit failed, so we'd better release them")

                                     (for CardPart in '(SUBSTANCE TOLINKS GLOBALTOLINKS PROPLIST)
                                        do (NC.ApplyFn ReleaseWritePermissionFn Card CardPart))
                                     (RETURN)))
                               (if ReadOnly
                                   then (NC.ApplyFn MakeReadOnlyFn Card))
                               (RETURN Window))
                  else (if CardWindow
                           then (FLASHW CardWindow)
                                (NCP.PrintMsg CardWindow T 
                                       "Cannot open this card because card type definition " 
                                       NoteCardType " not found." (CHARACTER 13)
                                       "First redefine card type " NoteCardType "." (CHARACTER 13))
                         else (NCP.PrintMsg NIL T 
                                     "Cannot open this card because card type definition " 
                                     NoteCardType " not found." (CHARACTER 13)
                                     "First redefine card type " NoteCardType "." (CHARACTER 13])
)
(PUTPROPS PMIPATCH086 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1034 6023 (NC.EditNoteCard 1044 . 6021)))))
STOP