(FILECREATED " 9-Dec-86 00:00:11" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH162.;9 32275 changes to: (FNS NC.OpenNoteFile NC.MakeTEditPropsList NCP.SetUpTitleBar NC.NoteFileIconMiddleButtonFn NC.NoteFileIconButtonEventFn NC.TitleBarButtonEventFn NC.InstallTitleBarMiddleMenu) (VARS RHTPATCH162COMS) previous date: "21-Nov-86 20:46:56" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH162.;3) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT RHTPATCH162COMS) (RPAQQ RHTPATCH162COMS ((* * Fixes made while working on collaboration package.) (* * Changes to NCTEXTCARD to allow extra tedit props to be stashed on notefile user data. If there are any such, then supercede the global params ones.) (FNS NC.MakeTEditPropsList NC.BringUpTEditCard NC.MakeTEditCard) (* * Changes to NCLINKINDEXCARD) (VARS (NC.LinkIndexExtraMenuItems (QUOTE ((Recompute% Link% Index (FUNCTION NC.RecomputeLinkIndex) "Recompute this link index throwing away current contents.") (Change% Link% Index% Specs (FUNCTION NC.ChangeLinkIndexSpecs) "Change some or all of Link Index specs."))))) (* * Changes to NCCARDS to enable a WhenSavedFn hook.) (FNS NC.CardSaveFn) (* * Changes to NCDATABASE Takes protection away from call to openevents card evals.) (FNS NC.OpenNoteFile) (* * New functions for NCCARDS) (FNS NC.TitleBarButtonEventFn NC.InstallTitleBarMiddleMenu) (* * New functions for NCPROGINT) (FNS NCP.SetUpTitleBar) (* * Every occurrence of NC.GraphTitleBarButtonEventFn should be changed to NC.TitleBarButtonEventFn. Every occurrence of NC.InstallGraphTitleBarMiddleMenu should be changed to NC.InstallTitleBarMiddleMenu. Then those two Graph functions should be deleted.))) (* * Fixes made while working on collaboration package.) (* * Changes to NCTEXTCARD to allow extra tedit props to be stashed on notefile user data. If there are any such, then supercede the global params ones.) (DEFINEQ (NC.MakeTEditPropsList (LAMBDA (TEditWindow Don'tAttachUserSpecifiedPropsFlg NoteFile) (* rht: " 8-Dec-86 18:17") (* * Create the props list to hand to all TEdit and OPENTEXTSTREAM calls) (* * rht 9/10/85: Now takes a TEditWindow arg so can compute a prompt window.) (* * 5/1/86: Now appends NC-specific props in front of TEdit props specified as global param by user.) (* * rht 8/2/86: Added Don'tAttachUserSpecifiedPropsFlg to override attaching user-specified props. For use by fileboxes.) (* * rht&pmi 11/19/86: Added another set of props at the notefile level stashed on NoteFile user data. Also added NoteFile argument.) (DECLARE (GLOBALVARS NC.UserSpecifiedTEditProps)) (APPEND (LIST (QUOTE TITLEMENUFN) (FUNCTION NC.TEditMenuFn) (QUOTE PUTFN) (FUNCTION NC.TEditPutFn) (QUOTE GETFN) (FUNCTION NC.TEditGetFn) (QUOTE QUITFN) (LIST (FUNCTION NC.TEditPropsListQuitFn) (FUNCTION (LAMBDA NIL (QUOTE DON'T)))) (QUOTE PROMPTWINDOW) (AND TEditWindow (NC.GetPromptWindow TEditWindow))) (LIST (QUOTE FONT) (OR (AND (type? NoteFile NoteFile) (NC.NoteFileProp NoteFile (QUOTE Font))) NC.DefaultFont)) (if Don'tAttachUserSpecifiedPropsFlg then NIL else (OR (AND (type? NoteFile NoteFile) (NC.NoteFileProp NoteFile (QUOTE ExtraTEditProps))) NC.UserSpecifiedTEditProps))))) (NC.BringUpTEditCard (LAMBDA (Card TextStream RegionOrPosition) (* rht: "20-Nov-86 22:28") (* Bring up a TEdit window for Card ID whose text stream is TextStream in Region specified by RegionOrPosition or by the user.) (* * rht 9/10/85: Fixed call to NC.MakeTEditPropsList so prompt window gets fixed up before card is brought up.) (* * fgh 11/13/85 Updated to handle Card objects.) (* * kirk 2Dec85 Removed illegal RETURN) (* * rht 4/11/86: Added Type arg to call to NC.MakeTEditMiddleMenu and changed names of menu windowprops.) (* * rht 5/5/86: Now calls NC.InstallTitleBarLeftMenu and NC.InstallTextTitleBarMiddleMenu.) (* * rht 8/2/86: Now doesn't throw in any extra tedit props if card is a filebox.) (* * rht 11/16/86: Now moves window to RegionOrPosition if already up.) (* * rht&pmi 11/19/86: Now passes NoteFile arg to NC.MakeTEditPropsList.) (LET (Region TEditWindow TEditProcess Title TextStreamDirtyFlg Type) (if (AND (SETQ TEditWindow (WINDOW.FROM.TEDIT.THING TextStream)) (SETQ TEditProcess (WINDOWPROP TEditWindow (QUOTE PROCESS)))) then (TOTOPW TEditWindow) (if RegionOrPosition then (SHAPEW TEditWindow (NC.DetermineDisplayRegion Card RegionOrPosition))) (RPTQ 2 (FLASHW TEditWindow)) (TTY.PROCESS TEditProcess) TEditWindow else (SETQ Region (NC.DetermineDisplayRegion Card RegionOrPosition)) (SETQ Title (NC.RetrieveTitle Card)) (SETQ Type (NC.RetrieveType Card)) (SETQ TEditWindow (CREATEW Region Title NIL T)) (WINDOWADDPROP TEditWindow (QUOTE SHRINKFN) (FUNCTION NC.TextCardShrinkFn)) (NC.InstallTitleBarLeftMenu TEditWindow Type) (NC.InstallTextTitleBarMiddleMenu TEditWindow Type) (SETQ TextStreamDirtyFlg (NC.CardDirtyP Card)) (TEDIT TextStream TEditWindow NIL (NC.MakeTEditPropsList TEditWindow (NC.FileBoxP Card T) (fetch (Card NoteFile) of Card))) (AND TextStreamDirtyFlg (NC.MarkCardDirty Card))) TEditWindow))) (NC.MakeTEditCard (LAMBDA (Card Title NoDisplayFlg ParamList) (* rht: "19-Nov-86 12:26") (* Make up a blank text card and display it.) (* * rht 9/10/85: Fixed call to NC.MakeTEditPropsList so prompt window gets fixed up before card is brought up.) (* * fgh 11/13/85 Updated to handle Card object.) (* * rht 4/11/86: Now passes type to NC.MakeTEditMiddleMenu.) (* * rht 5/6/86: Now calls NC.InstallTitleBarLeftMenu and NC.InstallTextTitleBarMiddleMenu.) (* * rht 9/8/86: No longer hangs Card off NoteCardObject windowprop. THis is done in NC.MakeNoteCard.) (* * rht 9/19/86: Mod to above fix. Now calls NC.MakeNewCardWindow a new fn that creates window and hangs Card off windowprop. Also takes ParamList arg.) (* * rht&pmi 11/19/86: Now passes NoteFile arg to NC.MakeTEditPropsList.) (LET (TextStream Window Type) (COND (NoDisplayFlg (SETQ TextStream (OPENTEXTSTREAM "" NIL NIL NIL (NC.MakeTEditPropsList NIL (LISTGET ParamList (QUOTE Don'tAttachUserSpecifiedPropsFlg))))) (NC.SetSubstance Card TextStream) (STREAMPROP TextStream (QUOTE NoteCardObject) Card) Card) (T (SETQ Window (NC.MakeNewCardWindow Card (OR Title "Untitled") NIL T)) (SETQ Type (NC.RetrieveType Card)) (NC.InstallTitleBarLeftMenu Window Type) (NC.InstallTextTitleBarMiddleMenu Window Type) (WINDOWADDPROP Window (QUOTE SHRINKFN) (FUNCTION NC.TextCardShrinkFn)) (TEDIT NIL Window NIL (NC.MakeTEditPropsList Window (NC.FileBoxP Card T) (fetch (Card NoteFile) of Card))) (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK)) (SETQ TextStream (WINDOWPROP Window (QUOTE TEXTSTREAM))) (NC.SetSubstance Card TextStream) (STREAMPROP TextStream (QUOTE NoteCardObject) Card) Window))))) ) (* * Changes to NCLINKINDEXCARD) (RPAQQ NC.LinkIndexExtraMenuItems ((Recompute% Link% Index (FUNCTION NC.RecomputeLinkIndex) "Recompute this link index throwing away current contents.") (Change% Link% Index% Specs (FUNCTION NC.ChangeLinkIndexSpecs) "Change some or all of Link Index specs."))) (* * Changes to NCCARDS to enable a WhenSavedFn hook.) (DEFINEQ (NC.CardSaveFn (LAMBDA (WindowOrID QuietFlg DontCheckForOpsInProgressFlg InterestedWindow OperationMsg) (* rht: "21-Nov-86 17:51") (* * rht 2/1/85: New function for saving ANY kind of card. All strangenesses are handled in NC.CardDirtyP and NC.MarkCardDirty. Added print statements to show what is being saved. Lets NC.CardDirtyP take care of proper dirty checks.) (* * rht 2/8/85: Added InsureFilingFlg) (* * rht 6/25/85: Pulled out InsureFilingFlg. That check now done upstairs in NC.QuitCard.) (* * rht 9/20/85: Added QuietFlg.) (* * fgh 11/12/85 Updated to handle Card objects. Removed DatabaseStream object.) (* * kirk 29Jan86 replaced call on undefined NC.UpdateRegionData with NC.PutRegion) (* * fgh 6/13/86 Added operations in progress code and DontCheckForOpsInProgressFlg arg.) (* * fgh 6/26/86 Added InterestedWindow & OperationMsg arg.) (* * rht 7/4/86: Added check for readonly notefile.) (* * kef 7/22/86: Added something to obtain the write permission on the FROMLINKS if the links have been changed. FROMLINKS aren't ordinarily obtained at edit time like the rest of the links are.) (* * kef 7/30/86: Modified to check for Client's concept of whether he owns the write lock or not, thus deciding whether or not to setup the release of the write lock afterwards.) (* * kef 7/30/86: Added a check to see if the NewCardFlg was on, then release TITLE and FROMLINKS writelocks. This is needed since ordinary deactivation of cards won't do this; i.e., only new cards have their TITLE and FROMLINKS also writelocked.) (* * fgh 8/30/86 Changed APPLY* to NC.ApplyFn where possible.) (* * rht&pmi 11/21/86: Now calls WhenSavedFn for card type if any.) (LET ((Card (NC.CoerceToCard WindowOrID)) Window OldRegion NewRegion DoneAPutP OperationInProgress) (SETQ Window (NC.FetchWindow Card)) (SETQ InterestedWindow (OR Window InterestedWindow)) (LET ((WhenSavedFn (GETPROP (NC.FetchType Card) (QUOTE WhenSavedFn)))) (AND WhenSavedFn (APPLY* WhenSavedFn Card))) (if (NC.CheckForNotReadOnly Card Window "Can't save cards in ") then (if (AND (NULL DontCheckForOpsInProgressFlg) (SETQ OperationInProgress (NC.OperationInProgress Card)) (NEQ OperationInProgress (QUOTE Close% Card))) then (NC.PrintOperationInProgressMsg Window "Save Card" OperationInProgress) else (NC.ProtectedCardOperation Card Save% Card (OR QuietFlg (NC.PrintMsg InterestedWindow T (OR OperationMsg "") (NC.FetchTitle Card) ": Checking ... ")) (COND ((OR (NC.CardDirtyP Card) (NC.FetchNewCardFlg Card)) (OR QuietFlg (NC.PrintMsg InterestedWindow NIL "Saving ")) (OR QuietFlg (NC.PrintMsg InterestedWindow NIL "substance, ")) (NC.PutMainCardData Card T) (SETQ DoneAPutP T) (NC.MarkCardDirty Card (QUOTE RESET))) ((AND (NOT (NC.FetchBeingDeletedFlg Card)) Window (OR (NOT (EQUAL (fetch (REGION WIDTH) of (SETQ OldRegion (NC.FetchRegion Card))) (fetch (REGION WIDTH) of (SETQ NewRegion (WINDOWPROP Window (QUOTE REGION)))))) (NOT (EQUAL (fetch (REGION HEIGHT) of OldRegion) (fetch (REGION HEIGHT) of NewRegion))))) (OR DoneAPutP QuietFlg (NC.PrintMsg InterestedWindow NIL "Saving ")) (OR QuietFlg (NC.PrintMsg InterestedWindow NIL "region, ")) (NC.PutRegion Card) (SETQ DoneAPutP T))) (COND ((NC.FetchTitleDirtyFlg Card) (OR DoneAPutP QuietFlg (NC.PrintMsg InterestedWindow NIL "Saving ")) (OR QuietFlg (NC.PrintMsg InterestedWindow NIL "title, ")) (NC.PutTitle Card) (SETQ DoneAPutP T))) (COND ((NC.FetchPropListDirtyFlg Card) (OR DoneAPutP QuietFlg (NC.PrintMsg InterestedWindow NIL "Saving ")) (OR QuietFlg (NC.PrintMsg InterestedWindow NIL "proplist, ")) (NC.PutPropList Card) (SETQ DoneAPutP T))) (COND ((NC.FetchLinksDirtyFlg Card) (OR DoneAPutP QuietFlg (NC.PrintMsg InterestedWindow NIL "Saving ")) (OR QuietFlg (NC.PrintMsg InterestedWindow NIL "links, ")) (* Make sure that we have the FROMLINKS of this card. Only necessary because all of the LINKS are written together.) (RESETLST (until (NC.ApplyFn ObtainWritePermissionFn Card (QUOTE FROMLINKS)) do (BLOCK) (NC.PrintMsg InterestedWindow NIL "waiting for FROMLINKS write permission....")) (RESETSAVE NIL (BQUOTE (APPLY* , (fetch (Card ReleaseWritePermissionFn) of Card) , Card FROMLINKS))) (NC.PutLinks Card) (SETQ DoneAPutP T)))) (OR DoneAPutP QuietFlg (NC.PrintMsg InterestedWindow NIL (CHARACTER 13) "Nothing changed. ")) (* It's not a new card anymore.) (COND ((NC.FetchNewCardFlg Card) (* If a new card, then make sure we release the FROMLINKS and TITLE. Necessary because DeactivateCard normally doesn't do this, because the FROMLINKS and TITLE aren't ordinarily owned on an active card.) (NC.ApplyFn ReleaseWritePermissionFn Card (QUOTE FROMLINKS)) (NC.ApplyFn ReleaseWritePermissionFn Card (QUOTE TITLE)) (NC.SetNewCardFlg Card NIL))) (OR QuietFlg (PROGN (NC.PrintMsg InterestedWindow NIL "Done." (CHARACTER 13)) (if Window then (NC.ClearMsg Window T)))))))))) ) (* * Changes to NCDATABASE Takes protection away from call to openevents card evals.) (DEFINEQ (NC.OpenNoteFile (LAMBDA (NoteFileOrFileName NoteFilesHashArray Don'tCacheTypesAndTitlesFlg Don'tCreateFlg ConvertNoConfirmFlg Don'tCreateArrayFlg Can'tTruncateFlg Don'tCreateInterfaceFlg Don'tGetSpecialCardsFlg InterestedWindow PublicOrPrivate Don'tCheckOperationsInProgressFlg MenuPosition QuietFlg ReadOnlyFlg Don'tCheckForTruncationFlg) (* rht: " 8-Dec-86 23:59") (* * fgh 5/23/86 Renamed to NC.OpenNoteFile from NC.OpenDatabaseFile. Total revamp to implement device vector.) (* * kef 7/18/86: Inserted a call to stuff the UID into the NoteFile because BuildHashArray needed it.) (* * kef 7/21/86: Moved up the install of the NoteFile into the NoteFileHashArray to before the building of the NoteFile's hash array. The reason is that the remote multi client build hash array function needs to get a list of UIDs, and in order to do this, it needs to grab a Courier stream for the NoteFile given only the UID. It can only do this if the UID is registered in the NoteFilesHashArray.) (* * fgh 8/31/86 Updated to account for changes made to system since 5/23/86 revamp. Changes reimplemented include: (fgh 6/8/86 Added code to insure that two files with SameUIDP would never be open at once.) (fgh 6/25/86 Added contention locks -- NC.ProtectedNoteFileOperation, Don'tCheckOperationInProgressFlg etc.) (fgh 6/27/86 Added MenuPsotion arg to pass to SetUpNoteFileInterface) (kirk 15Jul86 Added call to NC.SetUpNoteFileInterface if already open)) (* * fgh 9/1/86 Reimplemented ReadOnly NoteFile open.) (* * fgh 9/4/86 Put in default for NoteFilesHashArray which is NC.NoteFilesHashArray) (* * kirk/rht 8/29/86: Now resets Name after conversion from version 2 to version3.) (* * rht 10/29/86: Changed "aborted" to "canceled" in message.) (* * rht 10/31/86: Added Don'tCheckForTruncationFlg arg.) (* * rht&pmi 11/21/86: Took away the protection from around the AFTER call to open events fns.) (DECLARE (GLOBALVARS NC.OpenNoteFileFns NC.LastNoteFileOpened)) (* * If the value returned is not a NoteFile, let the user know there's been some problem.) (PROG (NoteFile FileName ReturnValue CriticalUIDs) (* * Figure out the name of the file containing the NoteFile) (if (NULL (SETQ FileName (COND ((type? NoteFile NoteFileOrFileName) (fetch (NoteFile FullFileName) of NoteFileOrFileName)) (NoteFileOrFileName) (T (NC.DatabaseFileName "Name of NoteFile to open:" " -- " T NIL NIL InterestedWindow))))) then (RETURN)) (* SETQ FileName (OR (FULLNAME FileName) FileName)) (* * Create a NoteFile object or use existing notefile object if there is one for this file name.) (SETQ NoteFile (if (type? NoteFile NoteFileOrFileName) then NoteFileOrFileName else (OR (NC.NoteFileFromFileName FileName) (create NoteFile)))) (replace (NoteFile FullFileName) of NoteFile with FileName) (replace (NoteFile ReadOnlyFlg) of NoteFile with ReadOnlyFlg) (* * If there is no interested window, see if the menu window can be used.) (if (AND (NULL InterestedWindow) (fetch (NoteFile Menu) of NoteFile)) then (SETQ InterestedWindow (WFROMMENU (fetch (NoteFile Menu) of NoteFile))) ) (* * Figure out the appropriate device vector from the file name.) (NC.InstallDeviceVectorInNoteFile NoteFile PublicOrPrivate) (* * If this is an open NoteFIle, just bring up its menu.) (if (NC.NoteFileOpenP NoteFile) then (OR Don'tCreateInterfaceFlg (NC.SetUpNoteFileInterface NoteFile MenuPosition)) (* bring up or create notefile icon if needed) (RETURN NIL)) (* * Notify user.) (OR QuietFlg (NC.PrintMsg InterestedWindow T "Opening NoteFile: " FileName " ..." (CHARACTER 13))) (* * Check to see if this NoteFile is busy doing something else) (if (AND (NULL Don'tCheckOperationsInProgressFlg) (PROCESSP (NC.NoteFileProp NoteFile (QUOTE ProcessInProgress)))) then (NC.PrintOperationInProgressMsg InterestedWindow (QUOTE Open% NoteFile) (NC.NoteFileProp NoteFile (QUOTE OperationInProgress))) (RETURN NIL)) (* * Run rest of function with contention lock.) (SETQ ReturnValue (NC.ProtectedNoteFileOperation NoteFile Open% NoteFile (PROG NIL (* * Run through OpenNoteFileFns with param of BEFORE. Exit if any returns DON'T) (if (for Function in NC.OpenNoteFileFns thereis (OR (EQ Function (QUOTE DON'T)) (EQ (QUOTE DON'T) (APPLY* Function FileName NoteFile (QUOTE BEFORE))))) then (if (WINDOWP InterestedWindow) then (NC.PrintMsg InterestedWindow NIL "Open canceled for NoteFile " FileName "." (CHARACTER 13)) (NC.ClearMsg InterestedWindow T)) (RETURN)) (* * Call the device specific OpenNoteFileFn, which returns a list of special UIDs) (if (NULL (ERSETQ (SETQ ReturnValue (APPLY* (fetch (NoteFile OpenNoteFileFn) of NoteFile) NoteFile InterestedWindow Don'tCheckForTruncationFlg)))) then (SETQ ReturnValue (QUOTE NoteFileOpenFailed))) (* * Process error returns from the OpenNoteFileFn) (if (NOT (LITATOM ReturnValue)) then (* * OpenNoteFileFn returned correctly) (SETQ CriticalUIDs ReturnValue) else (* * Error, process it.) (SETQ ReturnValue (OR (SELECTQ ReturnValue (NoteFileNotFound ( NC.ProcessNoteFileNotFoundError NoteFile NoteFilesHashArray Don'tCacheTypesAndTitlesFlg Don'tCreateFlg ConvertNoConfirmFlg Don'tCreateArrayFlg Can'tTruncateFlg Don'tCreateInterfaceFlg Don'tGetSpecialCardsFlg InterestedWindow PublicOrPrivate Don'tCheckOperationsInProgressFlg MenuPosition QuietFlg ReadOnlyFlg Don'tCheckForTruncationFlg)) (NoteFileNeedsConversion ( NC.ProcessNoteFileNeedsConversionError NoteFile NoteFilesHashArray Don'tCacheTypesAndTitlesFlg Don'tCreateFlg ConvertNoConfirmFlg Don'tCreateArrayFlg Can'tTruncateFlg Don'tCreateInterfaceFlg Don'tGetSpecialCardsFlg InterestedWindow PublicOrPrivate Don'tCheckOperationsInProgressFlg MenuPosition QuietFlg ReadOnlyFlg Don'tCheckForTruncationFlg)) (NoteFileNeedsTruncation ( NC.ProcessNoteFileNeedsTruncationError NoteFile NoteFilesHashArray Don'tCacheTypesAndTitlesFlg Don'tCreateFlg ConvertNoConfirmFlg Don'tCreateArrayFlg Can'tTruncateFlg Don'tCreateInterfaceFlg Don'tGetSpecialCardsFlg InterestedWindow PublicOrPrivate Don'tCheckOperationsInProgressFlg MenuPosition QuietFlg ReadOnlyFlg Don'tCheckForTruncationFlg)) (NoteFileAlreadyOpen (ERSETQ (NC.ReportError NIL (CONCAT (fetch (NoteFile FullFileName) of NoteFile) " is already open for exclusive access. Open failed.")))) (NoteFileOpenFailed (ERSETQ (NC.ReportError NIL (CONCAT "Open of " (fetch (NoteFile FullFileName) of NoteFile) " failed for unknown reason.")))) (NoteFileHeaderBad (ERSETQ (NC.ReportError NIL (CONCAT "Header of NoteFile " (fetch (NoteFile FullFileName) of NoteFile) " is bad. Contact a NoteCards wizard.")))) (PROGN (ERSETQ (NC.ReportError NIL (CONCAT "Unknown error code (" ReturnValue ") returned by OpenNoteFileFn for NoteFile " FileName))))) ReturnValue)) (* * notify the user. if there's been a problem) (if (AND (NOT (type? NoteFile ReturnValue)) (WINDOWP InterestedWindow)) then (NC.PrintMsg InterestedWindow NIL "Open canceled for NoteFile " FileName "." (CHARACTER 13)) (NC.ClearMsg InterestedWindow T)) (* * return whatever the error processing returned.) (RETURN ReturnValue)) (SETQ ReturnValue) (* * Make sure there is no other open NF with this UID.) (LET (NF) (if (AND (SETQ NF (GETHASH (fetch (NoteFileCriticalUIDs NoteFile) of CriticalUIDs) NC.NoteFilesHashArray)) (NEQ (fetch (NoteFile FullFileName) of NoteFile) (fetch (NoteFile FullFileName) of NF)) (NC.NoteFileOpenP NF)) then (FLASHW PROMPTWINDOW) (NC.PrintMsg PROMPTWINDOW T "Couldn't open " FileName (CHARACTER 13) "because " (fetch (NoteFile FullFileName) of NF) " is already open " (CHARACTER 13) "and has the same UID.") (NC.CloseNoteFile NoteFile InterestedWindow T T) (RETURN NIL))) (* * If needed, build a hash array by calling the device specific BuilHashArrayFn.) (replace (NoteFile UID) of NoteFile with (fetch (NoteFileCriticalUIDs NoteFile) of CriticalUIDs)) (* * Store this NoteFile object in the appropriate NoteFile hash array) (NC.StoreNoteFileInHashArray NoteFile (OR NoteFilesHashArray NC.NoteFilesHashArray)) (if (NOT Don'tCreateArrayFlg) then (OR QuietFlg (NC.PrintMsg InterestedWindow T "Opening NoteFile: " FileName (CHARACTER 13) "Building index array ..." (CHARACTER 13))) (if (OR (NULL (ERSETQ (SETQ ReturnValue (APPLY* (fetch (NoteFile BuildHashArrayFn) of NoteFile) NoteFile QuietFlg InterestedWindow (CONCAT "Opening NoteFile " (fetch (NoteFile FullFileName) of NoteFile) (CHARACTER 13)))))) (NOT (type? NoteFile ReturnValue))) then (* * Error during building of hash array) (ERSETQ (NC.ReportError NIL (CONCAT "Build Hash Array failed for NoteFile " (fetch (NoteFile FullFileName) of NoteFile) " because " ReturnValue))) (RETURN))) (* * Set up critical UIDs in NoteFile object using the values returned from OpenNoteFileFn.) (NC.InstallCriticalUIDsInNoteFile NoteFile CriticalUIDs) (* * if needed, cache the special cards) (if (NOT Don'tGetSpecialCardsFlg) then (NC.GetSpecialCards NoteFile QuietFlg InterestedWindow (CONCAT "Opening NoteFile: " (fetch (NoteFile FullFileName) of NoteFile) (CHARACTER 13)))) (* * If needed, start the titles and types caching process) (if (NOT Don'tCacheTypesAndTitlesFlg) then (replace (NoteFile CachingProcess) of NoteFile with (ADD.PROCESS (LIST (FUNCTION NC.CacheTypesAndTitles) NoteFile)))) (* * If needed, open up a NoteFile interface.) (if (NOT Don'tCreateInterfaceFlg) then (NC.SetUpNoteFileInterface NoteFile MenuPosition)) (* * Record this as the last NF opened.) (SETQ NC.LastNoteFileOpened NoteFile) (RETURN NoteFile)))) (if (type? NoteFile ReturnValue) then (* * Run through OpenNoteFIleFns with param of AFTER. Stop if any returns DON'T) (for Function in NC.OpenNoteFileFns thereis (EQ (QUOTE DON'T) (APPLY* Function FileName NoteFile (QUOTE AFTER)))) (* * Go home, returning NoteFile) (if (NULL QuietFlg) then (NC.PrintMsg InterestedWindow T "Opening NoteFile: " FileName (CHARACTER 13) "Done." (CHARACTER 13)) (NC.ClearMsg InterestedWindow T)) (RETURN NoteFile) else (* * Bail out if open was unsuccessful.) (RETURN NIL))))) ) (* * New functions for NCCARDS) (DEFINEQ (NC.TitleBarButtonEventFn (LAMBDA (Window) (* rht: " 6-May-86 12:10") (* * if inside title region, bringup left or middle menu, otherwise just call the oldbuttoneventfn) (LET (MiddleButtonMenu LeftButtonMenu) (COND ((INSIDEP (DSPCLIPPINGREGION NIL Window) (LASTMOUSEX Window) (LASTMOUSEY Window)) (APPLY* (WINDOWPROP Window (QUOTE OLDBUTTONEVENTFN)) Window)) ((AND (LASTMOUSESTATE MIDDLE) (type? MENU (SETQ MiddleButtonMenu (WINDOWPROP Window (QUOTE TitleBarMiddleButtonMenu))))) (APPLY* (OR (MENU MiddleButtonMenu) (FUNCTION NILL)) Window)) ((AND (LASTMOUSESTATE LEFT) (type? MENU (SETQ LeftButtonMenu (WINDOWPROP Window (QUOTE TitleBarLeftButtonMenu))))) (APPLY* (OR (MENU LeftButtonMenu) (FUNCTION NILL)) Window)))))) (NC.InstallTitleBarMiddleMenu (LAMBDA (Window CardType) (* rht: "23-Nov-86 12:57") (* * Make a middle button title bar menu and install.) (DECLARE (GLOBALVARS NC.MenuFont)) (WINDOWPROP Window (QUOTE TitleBarMiddleButtonMenu) (create MENU ITEMS ←(NC.GetCardTypeField MiddleButtonMenuItems CardType) CENTERFLG ← T MENUFONT ← NC.MenuFont)))) ) (* * New functions for NCPROGINT) (DEFINEQ (NCP.SetUpTitleBar (LAMBDA (CardWindow CardType) (* rht: " 8-Dec-86 18:00") (* * Set up the left and middle button menus for this card. Also handle installation of button event fn.) (NC.InstallTitleBarLeftMenu CardWindow CardType) (NC.InstallTitleBarMiddleMenu CardWindow CardType) (NC.InstallTitleBarButtonEventFn CardWindow (FUNCTION NC.TitleBarButtonEventFn)))) ) (* * Every occurrence of NC.GraphTitleBarButtonEventFn should be changed to NC.TitleBarButtonEventFn. Every occurrence of NC.InstallGraphTitleBarMiddleMenu should be changed to NC.InstallTitleBarMiddleMenu. Then those two Graph functions should be deleted.) (PUTPROPS RHTPATCH162 COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (2157 8527 (NC.MakeTEditPropsList 2167 . 3886) (NC.BringUpTEditCard 3888 . 6320) ( NC.MakeTEditCard 6322 . 8525)) (8943 15586 (NC.CardSaveFn 8953 . 15584)) (15679 29891 (NC.OpenNoteFile 15689 . 29889)) (29930 31426 (NC.TitleBarButtonEventFn 29940 . 30971) (NC.InstallTitleBarMiddleMenu 30973 . 31424)) (31467 31927 (NCP.SetUpTitleBar 31477 . 31925))))) STOP