(FILECREATED "23-Aug-85 17:21:12" {QV}<NOTECARDS>RELEASE1.2I>FGHPATCH022.;3 11815 changes to: (VARS FGHPATCH022COMS) (FNS NC.SelectNoteCards) previous date: "23-Aug-85 15:36:58" {QV}<NOTECARDS>RELEASE1.2I>FGHPATCH022.;1) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT FGHPATCH022COMS) (RPAQQ FGHPATCH022COMS ((* * Redefined from NCCARDS) (FNS NC.AddPropToPropList NC.DelPropFromList) (* * Redefined from NCINTERFACE) (FNS NC.SelectNoteCards))) (* * Redefined from NCCARDS) (DEFINEQ (NC.AddPropToPropList (LAMBDA (editW) (* fgh: "23-Aug-85 15:31") (* Add a new prop to the propList being edited in editW) (PROG ((promptWindow (GETPROMPTWINDOW editW 5 NIL NIL)) selectedObject propName propValue insertPtr insertChars beginPtr (stream (WINDOWPROP editW (QUOTE TEXTSTREAM))) (tobj (WINDOWPROP editW (QUOTE TEXTOBJ)))) (SETQ propName (MKATOM (NC.AskUser "New Property Name is = " NIL NIL T promptWindow))) (NC.PrintMsg promptWindow NIL (CHARACTER 13)) (SETQ propValue (NC.AskUser (CONCAT "Value for " propName " property = ") NIL NIL T promptWindow)) (* Insert these values into the editW) (* Position just before selected button) (NC.PrintMsg promptWindow T "Please select a property before which to insert this new property." (CHARACTER 13)) (SETQ selectedObject (NC.SelectProperty editW)) (NC.ClearMsg editW T) (AND (NULL selectedObject) (RETURN NIL)) (SETQ insertPtr (TEDIT.FIND.OBJECT tobj selectedObject)) (SETQ beginPtr insertPtr) (* Insert a button with this property name) (TEDIT.INSERT.OBJECT (MBUTTON.CREATE propName (FUNCTION NC.EditPropButtonFN) (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))) stream insertPtr) (* Spacer between Prop and Value) (add insertPtr 1) (TEDIT.INSERT stream (CHARACTER 9) insertPtr) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED ON)) insertPtr 1) (add insertPtr 1) (* Create a new field (Copied from JBS's \TEXTMENU.DOC.CREATE)) (TEDIT.INSERT stream (CONCAT " {}" (CHARACTER 13)) insertPtr) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED ON)) insertPtr 5) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED ON SELECTPOINT ON)) (IPLUS insertPtr 2) 1) (TEDIT.INSERT stream (MKSTRING propValue) (IPLUS insertPtr 3)) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED OFF SELECTPOINT OFF)) (IPLUS insertPtr 3) (NCHARS (MKSTRING propValue))) (add insertPtr (NCHARS (MKSTRING propValue))) (add insertPtr 5)))) (NC.DelPropFromList (LAMBDA (editW) (* fgh: "23-Aug-85 15:34") (PROG ((promptWindow (GETPROMPTWINDOW editW 5 NIL NIL)) (tobj (WINDOWPROP editW (QUOTE TEXTOBJ))) (stream (WINDOWPROP editW (QUOTE TEXTSTREAM))) selectedObject CH#) (NC.PrintMsg promptWindow T "Please select property to be deleted.") (SETQ selectedObject (NC.SelectProperty editW)) (NC.ClearMsg promptWindow T) (COND ((COND ((NOT (IMAGEOBJPROP selectedObject (QUOTE EditPropListNoDelete))) (SETQ CH# (TEDIT.FIND.OBJECT tobj selectedObject)) (MBUTTON.FIND.NEXT.FIELD tobj CH#) (* Delete everything between the imageobj and the end-of-line.) (TEDIT.LOOKS tobj (QUOTE (PROTECTED OFF)) CH# (IPLUS 2 (IDIFFERENCE (fetch CHLIM of (fetch SCRATCHSEL of tobj)) CH#))) (TEDIT.DELETE stream CH# (IPLUS 2 (IDIFFERENCE (fetch CHLIM of (fetch SCRATCHSEL of tobj)) CH#))) (TEDIT.SETSEL stream (GETEOFPTR stream) 0 (QUOTE RIGHT))) (T (NC.PrintMsg promptWindow T "Selected property:value pair cannot be deleted." (CHARACTER 13))))))))) ) (* * Redefined from NCINTERFACE) (DEFINEQ (NC.SelectNoteCards (LAMBDA (SingleCardFlg SelectionPredicate Menu InstigatingIDorWindow ReturnLinksFlg Msg CheckForCancelFlg) (* fgh: "23-Aug-85 17:14") (* Select a set of note cards or a single note card, depending on SingleCardFlg. Works by interpreting all mouse presses until a card has been chosen (if SingleCardFlg is T) or until the Done button has been pressed (if SingleCardFlg is NIL). If the mouse press occus within a Title bar of a notecard, add that note card to the selected list. Otherwise, if you are pointing into a note card, call the BUTTONEVENTFN for that note card. The Selection in Progress flag has been set, so all note card BUTTONEVENTFNs should know to ignore all presses except those that occur on link icons. Link icon presses should simply add the desination of that link to the selected note cards list.) (* * rht 8/1/84: Changed second RESETSAVE call to give NC.ClearMsg a NIL argument.) (* * rht 1/9/85: Fixed so now prints name of selected item even it's a link.) (* * rht 2/15/85: Now can backspace over last selection chosen. Added new arg Msg so that when we reprint the list, we can reprint the message as well.) (* * rht 3/23/85: Added the CheckForCancelFlg arg, which if non-nil causes Cancel to be handled differently then Done after no selections. Namely, Cancel will return the atom CANCELLED whereas Done with no selections returns NIL. If CheckForCancelFlg is NIL then NIL is returned in both cases.) (PROG (Window WinRegion ID ButtonEventFn (OldLength 0) InstigatingWindow MenuWindow SelectedCard LinkOrID TextObj) (OR SelectionPredicate (SETQ SelectionPredicate (FUNCTION TRUE))) (SETQ NC.SelectedCards) (COND ((NC.IDP InstigatingIDorWindow) (SETQ InstigatingWindow (NC.FetchWindow InstigatingIDorWindow))) ((WINDOWP InstigatingIDorWindow) (SETQ InstigatingWindow InstigatingIDorWindow)) (T (SETQ InstigatingWindow NIL))) (SETQ WinRegion (WINDOWREGION (OR InstigatingWindow (WFROMMENU NC.MainMenu)))) (NC.PrintMsg InstigatingWindow T (COND (Msg (CONCAT Msg (CHARACTER 13))) (T "")) "Items selected: ") (RESETLST (RESETSAVE NIL (BQUOTE (NC.ClearMsg , InstigatingWindow T))) (RESETSAVE NC.SelectionInProgress (COND (ReturnLinksFlg (QUOTE Links)) (T T))) (RESETSAVE (ADDMENU Menu NIL (create POSITION XCOORD ←(fetch (REGION LEFT) of WinRegion) YCOORD ←(COND (InstigatingWindow (fetch (REGION TOP) of WinRegion)) (T (fetch (REGION BOTTOM) of WinRegion))))) (LIST (QUOTE PROGN) (LIST (QUOTE DETACHWINDOW) (LIST (QUOTE WFROMMENU) Menu)) (LIST (QUOTE DELETEMENU) Menu T))) (* If there is an instigating window, make sure it and all its attachments are visible on the screen.) (COND (InstigatingWindow (ATTACHWINDOW (WFROMMENU Menu) InstigatingWindow (QUOTE TOP) (QUOTE LEFT)) (NC.MoveWindowOntoScreen InstigatingWindow))) (until (COND (SingleCardFlg (OR NC.SelectedCards (NULL NC.SelectionInProgress))) (T (NULL NC.SelectionInProgress))) do (until (MOUSESTATE LEFT)) (SETQ Window (WHICHW LASTMOUSEX LASTMOUSEY)) (AND Window (SETQ ID (NC.IDFromWindow Window))) (COND (Window (SETQ ButtonEventFn (WINDOWPROP Window (QUOTE BUTTONEVENTFN))) (COND ((AND (NOT (INSIDEP (DSPCLIPPINGREGION NIL (WINDOWPROP Window (QUOTE DSP))) (LASTMOUSEX Window) (LASTMOUSEY Window)))) (AND ID (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards)))) (T (COND (ButtonEventFn (RESETLST (COND ((AND (EQ InstigatingWindow Window) (SETQ TextObj (TEXTOBJ Window))) (RESETSAVE (replace (TEXTOBJ EDITOPACTIVE) of TextObj with NIL) (LIST (FUNCTION (LAMBDA (TextObj OldValue) (replace (TEXTOBJ EDITOPACTIVE) of TextObj with OldValue))) TextObj (fetch (TEXTOBJ EDITOPACTIVE) of TextObj))))) (APPLY* ButtonEventFn Window)))))))) (COND ((IGREATERP (LENGTH NC.SelectedCards) OldLength) (COND ((EQ (CAR NC.SelectedCards) (QUOTE *Undo% Selection*)) (* Chop off two elements from the list - the indicator and the previous item.) (SETQ NC.SelectedCards (CDDR NC.SelectedCards)) (SETQ OldLength (LENGTH NC.SelectedCards)) (NC.ClearMsg InstigatingWindow NIL) (* Reprint the titles of the selections.) ) ((NULL (APPLY* SelectionPredicate (CAR NC.SelectedCards))) (* Selection was not valid.) (SETQ NC.SelectedCards (CDR NC.SelectedCards))) (T (* A valid selection.) (SETQ OldLength (LENGTH NC.SelectedCards)) (NC.ClearMsg InstigatingWindow NIL))) (NC.PrintMsg InstigatingWindow NIL (COND (Msg (CONCAT Msg (CHARACTER 13))) (T "")) "Items selected: ") (for LinkOrID in (REVERSE NC.SelectedCards) do (NC.PrintMsg InstigatingWindow NIL (NC.FetchTitle (COND ((type? NOTECARDLINK LinkOrID) (fetch (NOTECARDLINK SOURCEID) of LinkOrID)) (T LinkOrID))) ", ")))) (until (MOUSESTATE UP)) (TOTOPW (WFROMMENU Menu))) (* Allow TEdit to finish any outstanding Selections caused by buttoning off of the Notecard link objects) (BLOCK)) (UNTILMOUSESTATE UP) (RETURN (PROG1 (COND ((EQ NC.SelectedCards (QUOTE CANCELLED)) (COND (CheckForCancelFlg (QUOTE CANCELLED)) (T NIL))) (SingleCardFlg (CAR NC.SelectedCards)) (T (DREVERSE NC.SelectedCards))) (SETQ NC.SelectedCards)))))) ) (PUTPROPS FGHPATCH022 COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (559 4815 (NC.AddPropToPropList 569 . 3436) (NC.DelPropFromList 3438 . 4813)) (4855 11733 (NC.SelectNoteCards 4865 . 11731))))) STOP