(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP")
(FILECREATED "21-Oct-88 14:23:09" {QV}<NOTECARDS>1.3LNEXT>RARPATCH048.;1 10088  

      changes to%:  (VARS RARPATCH048COMS)
                    (FNS NC.AskBrowserSpecs))


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

(PRETTYCOMPRINT RARPATCH048COMS)

(RPAQQ RARPATCH048COMS (
                        (* ;; "rar. 10/21/88.  Fixed this so that passing ALL or ←ALL actually works.  ALL gives all of the forward pointing links and ←ALL gives all the back links.  ")

                        
                        (* ;; "Changes to NCBROWSERCARD.")

                        (FNS NC.AskBrowserSpecs)))



(* ;; 
"rar. 10/21/88.  Fixed this so that passing ALL or ←ALL actually works.  ALL gives all of the forward pointing links and ←ALL gives all the back links.  "
)




(* ;; "Changes to NCBROWSERCARD.")

(DEFINEQ

(NC.AskBrowserSpecs
  [LAMBDA (MainWindow BrowserCard OldLinkLabels OldDepth OldFormat CreatingBrowserFlg Don'tAskFlg)
                                                             (* ; "Edited 21-Oct-88 14:12 by RAR")

    (* ;; "Puts up the big stylesheet asking user about link types, depth, browser format, etc.  The stylesheet returns a list of 5 things: forward links, backward links, depth, format, and orientation.  The last two are smashed together to form a browserformat and the first two are nconc'ed together.  Thus we return a list of 3 things: links, depth, and browserformat.")

    (* ;; 
    "rht 4/1/85: Now takes Don'tAskFlg arg for when we don't want to ask the user for browser specs.")

    (* ;; "rht 11/17/85: Updated for new card and notefile objects.")

    (* ;; "pmi 4/2/87: Added NC.MenuFont to all menus.")

    (* ;; "rht 1/23/88: Now uses OmitLinkLabelsFlg taken off user data props to decide whether link choices appear in stylesheet.")

    (* ;; "RAR 10/21/88 Fixed so that if you can pass ALL or ←ALL (and it actually works like the documentation says...)")

    (DECLARE (GLOBALVARS NC.MenuFont MENUFONT NC.BrowserFormatOptions))
    (PROG ((LinkLabels (NC.RetrieveLinkLabels (fetch (Card NoteFile) of BrowserCard)
                              T))
           (OmitLinkLabelsFlg (NC.FetchUserDataProp BrowserCard 'OmitLinkLabelsFromBrowserSpecsFlg))
           Position Choices ReverseFlg DepthMenu FormatMenu OrientationMenu DepthSelection 
           FormatSelection OrientationSelection)             (* ; 
  "Replace ALL and/or ←ALL with the actual lists of linklabels and backlinklabels in oldLinkLabels. ")
          (SETQ OldLinkLabels (LSUBST LinkLabels 'ALL (LSUBST (NCP.ReverseLinkTypes
                                                               (fetch (Card NoteFile) of BrowserCard)
                                                               )
                                                             '←ALL
                                                             OldLinkLabels)))
          [if Don'tAskFlg
              then (RETURN (LIST (OR OldLinkLabels LinkLabels)
                                 (OR OldDepth 99999)
                                 (OR OldFormat '(LATTICE]
          [SETQ Position (AND (WINDOWP MainWindow)
                              (create POSITION
                                     XCOORD ← (fetch (REGION LEFT) of (WINDOWPROP MainWindow
                                                                             'REGION))
                                     YCOORD ← (fetch (REGION TOP) of (WINDOWREGION MainWindow]
          (if CreatingBrowserFlg
              then (SETQ OldLinkLabels LinkLabels))
          (SETQ ReverseFlg (EQ (CADDR OldFormat)
                               'REVERSE))
          (SETQ DepthMenu (create MENU
                                 ITEMS ←
                                 '(0 1 2 3 4 5 6 7 8 9 INF)
                                 MENUFONT ← NC.MenuFont))
          (SETQ DepthSelection (if (OR (NOT (FIXP OldDepth))
                                       (IGREATERP OldDepth 9)
                                       (ILESSP OldDepth 0))
                                   then 'INF
                                 else OldDepth))
          (SETQ FormatMenu (create MENU
                                  ITEMS ← NC.BrowserFormatOptions
                                  MENUFONT ← NC.MenuFont))
          (SETQ FormatSelection (OR (CAR (FASSOC (CAR OldFormat)
                                                NC.BrowserFormatOptions))
                                    'LATTICE))
          (SETQ OrientationMenu (create MENU
                                       ITEMS ← '(Horizontal Vertical Reverse/Horizontal 
                                                       Reverse/Vertical)
                                       MENUFONT ← NC.MenuFont))
          [SETQ OrientationSelection (if (EQ (CADR OldFormat)
                                             'VERTICAL)
                                         then (if ReverseFlg
                                                  then 'Reverse/Vertical
                                                else 'Vertical)
                                       else (if ReverseFlg
                                                then 'Reverse/Horizontal
                                              else 'Horizontal]
          [SETQ Choices (COND
                           (OmitLinkLabelsFlg (STYLESHEET (CREATE.STYLE 'ITEMS (LIST DepthMenu 
                                                                                     FormatMenu 
                                                                                     OrientationMenu)
                                                                 'SELECTIONS
                                                                 (LIST DepthSelection FormatSelection
                                                                       OrientationSelection)
                                                                 'ITEM.TITLES
                                                                 '(Depth Format Orientation)
                                                                 'NEED.NOT.FILL.IN
                                                                 '(NIL NIL NIL)
                                                                 'POSITION Position 'ITEM.TITLE.FONT
                                                                 (FONTCOPY MENUFONT 'WEIGHT
                                                                        'BOLD)
                                                                 'TITLE "Browser Specs?")))
                           (T (STYLESHEET (CREATE.STYLE
                                           'ITEMS
                                           (LIST (create MENU
                                                        ITEMS ← LinkLabels
                                                        MENUFONT ← NC.MenuFont)
                                                 (create MENU
                                                        ITEMS ← (for Link in LinkLabels
                                                                   collect (PACK* '← Link))
                                                        MENUFONT ← NC.MenuFont)
                                                 DepthMenu FormatMenu OrientationMenu)
                                           'SELECTIONS
                                           (LIST (for Label in OldLinkLabels
                                                    when (NEQ (NTHCHAR Label 1)
                                                              '←) collect Label)
                                                 (for Label in OldLinkLabels
                                                    when (EQ (NTHCHAR Label 1)
                                                             '←) collect Label)
                                                 DepthSelection FormatSelection OrientationSelection)
                                           'ITEM.TITLES
                                           '(Forward% Links Backward% Links Depth Format Orientation)
                                           'NEED.NOT.FILL.IN
                                           '(MULTI MULTI NIL NIL NIL)
                                           'POSITION Position 'ITEM.TITLE.FONT (FONTCOPY MENUFONT
                                                                                      'WEIGHT
                                                                                      'BOLD)
                                           'TITLE "Browser Specs?"]
          [if (AND OmitLinkLabelsFlg Choices)
              then (SETQ Choices `(,OldLinkLabels NIL ,@Choices]
          (RETURN (COND
                     [Choices (LIST (APPEND (CAR Choices)
                                           (CADR Choices))
                                    (OR (FIXP (CADDR Choices))
                                        MAX.FIXP)
                                    (CONS (CADDDR Choices)
                                          (SELECTQ (CADDDR (CDR Choices))
                                              (Horizontal (LIST 'HORIZONTAL 'REVERSE/DAUGHTERS))
                                              (Vertical (LIST 'VERTICAL NIL))
                                              (Reverse/Horizontal 
                                                   (LIST 'HORIZONTAL 'REVERSE 'REVERSE/DAUGHTERS))
                                              (Reverse/Vertical 
                                                   (LIST 'VERTICAL 'REVERSE))
                                              NIL]
                     (CreatingBrowserFlg NIL)
                     (T (LIST OldLinkLabels OldDepth OldFormat])
)
(PUTPROPS RARPATCH048 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (923 10005 (NC.AskBrowserSpecs 933 . 10003)))))
STOP