(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP")
(FILECREATED "25-Jan-88 10:56:02" {QV}<NOTECARDS>1.3LNEXT>RHTPATCH307.;4 10627  

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

      previous date%: "23-Jan-88 21:14:45" {QV}<NOTECARDS>1.3LNEXT>RHTPATCH307.;1)


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

(PRETTYCOMPRINT RHTPATCH307COMS)

(RPAQQ RHTPATCH307COMS (

(* ;;; "New file")

                        (DECLARE%: DONTCOPY (PROPS (RHTPATCH307 MAKEFILE-ENVIRONMENT)
                                                   (RHTPATCH307 FILETYPE)))
                        [DECLARE%: FIRST (P (NC.LoadFileFromDirectories 'NCBROWSERCARD]
                        

(* ;;; "Fixes AskBrowserSpecs so that it will optionally omit link labels from stylesheet.  Also fixes problem where browser specs of two browsers up simultaneously blow each other out of the water.")

                        

(* ;;; "**********  ")

                        
          
          (* ;; "NOTE:  The GLOBALVARS and INITVARS for NC.BrowserSpecsStylesheet should be REMOVED from NCBROWSERCARD.")

                        

(* ;;; "**********")

                        
          
          (* ;; "Change to NCBROWSERCARD")

                        (FNS NC.AskBrowserSpecs)))



(* ;;; "New file")

(DECLARE%: DONTCOPY 

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

(PUTPROPS RHTPATCH307 FILETYPE :TCOMPL)
)
(DECLARE%: FIRST 
(NC.LoadFileFromDirectories 'NCBROWSERCARD)
)



(* ;;; 
"Fixes AskBrowserSpecs so that it will optionally omit link labels from stylesheet.  Also fixes problem where browser specs of two browsers up simultaneously blow each other out of the water."
)




(* ;;; "**********  ")




(* ;; 
"NOTE:  The GLOBALVARS and INITVARS for NC.BrowserSpecsStylesheet should be REMOVED from NCBROWSERCARD."
)




(* ;;; "**********")




(* ;; "Change to NCBROWSERCARD")

(DEFINEQ

(NC.AskBrowserSpecs
  [LAMBDA (MainWindow BrowserCard OldLinkLabels OldDepth OldFormat CreatingBrowserFlg Don'tAskFlg)
                                                             (* ; "Edited 25-Jan-88 10:55 by Trigg")

(* ;;; "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.")

    (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)
          [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 RHTPATCH307 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (2059 10544 (NC.AskBrowserSpecs 2069 . 10542)))))
STOP