(FILECREATED " 3-Jul-84 00:44:40" {INDIGO}<LOOPS>SOURCES>LOOPSBROWSE.;67 79373  

      changes to:  (FNS FileBrowser.File ClassBrowser.MoveTo ClassBrowser.RenameMeth 
			ClassBrowser.RenameCV LatticeBrowser.Clear LatticeBrowser.AddRoot 
			LatticeBrowser.NewItem LatticeBrowser.Recompute LatticeBrowser.Show)
		   (CLASSES ClassBrowser)
		   (METHODS LatticeBrowser.Clear)
		   (INSTANCES LatticeBrowser.Clear)
		   (VARS LOOPSBROWSECOMS BROWSECLASSES)

      previous date: "26-Jun-84 15:29:06" {INDIGO}<LOOPS>SOURCES>LOOPSBROWSE.;66)


(* Copyright (c) 1983, 1984 by Xerox Corporation)

(PRETTYCOMPRINT LOOPSBROWSECOMS)

(RPAQQ LOOPSBROWSECOMS [(* Copyright (c)
			   Xerox Corporation, 1983)
	(CLASSES * BROWSECLASSES)
	(METHODS ClassBrowser.AddNewCV ClassBrowser.AddNewIV ClassBrowser.AddSuper 
		 ClassBrowser.BoxNode ClassBrowser.CVDoc ClassBrowser.ClassDoc ClassBrowser.CopyTo 
		 ClassBrowser.DefineSubclass ClassBrowser.DeleteCV ClassBrowser.DeleteClass 
		 ClassBrowser.DeleteClassItem ClassBrowser.DeleteFromBrowser ClassBrowser.DeleteIV 
		 ClassBrowser.DeleteMethod ClassBrowser.DestroyAndRecompute ClassBrowser.FindWhere 
		 ClassBrowser.GetMethodDoc ClassBrowser.GetSubs ClassBrowser.IVDoc 
		 ClassBrowser.LeftShiftSelect ClassBrowser.MoveTo ClassBrowser.NewItem 
		 ClassBrowser.Recompute ClassBrowser.RenameCV ClassBrowser.RenameClass 
		 ClassBrowser.RenameIV ClassBrowser.RenameMeth ClassBrowser.RenamePart 
		 ClassBrowser.SetItNew ClassBrowser.WhereIsCV ClassBrowser.WhereIsIV 
		 ClassBrowser.WhereIsMethod FileBrowser.DefineSubclass FileBrowser.EditComs 
		 FileBrowser.EditFns FileBrowser.EditInstances FileBrowser.EditVars FileBrowser.File 
		 FileBrowser.NewItem FileBrowser.Recompute FileBrowser.SaveFile FileBrowser.SetItNew 
		 InstanceBrowser.GetSubs InstanceBrowser.NewPath LatticeBrowser.AddRoot 
		 LatticeBrowser.BoxNode LatticeBrowser.BrowserObjects LatticeBrowser.ChangeFontSize 
		 LatticeBrowser.ChangeFormat LatticeBrowser.Clear LatticeBrowser.DoSelectedCommand 
		 LatticeBrowser.EEObject LatticeBrowser.EditObject LatticeBrowser.FlashNode 
		 LatticeBrowser.FlipNode LatticeBrowser.GetLabel LatticeBrowser.GetNodeList 
		 LatticeBrowser.GetSubs LatticeBrowser.HasObject LatticeBrowser.LeftSelection 
		 LatticeBrowser.LeftShiftSelect LatticeBrowser.ListObjects 
		 LatticeBrowser.MiddleSelection LatticeBrowser.MiddleShiftSelect 
		 LatticeBrowser.NewItem LatticeBrowser.ObjNamePair LatticeBrowser.Recompute 
		 LatticeBrowser.SaveInIT LatticeBrowser.ShapeToHold LatticeBrowser.Show 
		 LatticeBrowser.SubBrowser LatticeBrowser.TitleSelection LatticeBrowser.Unread 
		 MetaBrowser.GetSubs PathBrowser.AddAndBox PathBrowser.AddToPath PathBrowser.Clear 
		 PathBrowser.GetSubs PathBrowser.LeftShiftSelect PathBrowser.Recompute 
		 SupersBrowser.GetSubs)
	(FNS BoxWindowNode Browse DoMenuMethod DualMenu DualSelection DualSubItems FILECLASSES 
	     FileBrowse FindSelectedNode GetMethodArgs LatticeBrowser.ButtonFn 
	     LatticeBrowser.WhenHeldFn LispxSend SavedValue SendInTtyProcess SubItemSelection 
	     TreeRoots)
	(VARS BrowserMargin MaxLatticeHeight MaxLatticeWidth NestedMenuFlg)
	(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
									      (NLAML LispxSend)
									      (LAMA])



(* Copyright (c) Xerox Corporation, 1983)


(RPAQQ BROWSECLASSES (ClassBrowser FileBrowser InstanceBrowser LatticeBrowser PathBrowser 
				   SupersBrowser MetaBrowser))
(DEFCLASSES ClassBrowser FileBrowser InstanceBrowser LatticeBrowser PathBrowser SupersBrowser 
	    MetaBrowser)
[DEFCLASS ClassBrowser
   (MetaClass Class Edited:                                  (* dgb: " 2-Jul-84 23:46")
	      doc                                            (* A window containing a lattice displaying classes.)
	      )
   (Supers LatticeBrowser)
   (ClassVariables (LeftButtonItems ((Print*(PrintSummary (PP PP! PPV! PPMethod MethodSummary 
							      PrintSummary))
				       "PrintSummary of class")
				     (Doc*(ClassDoc (ClassDoc (MethodDoc GetMethodDoc)
							      IVDoc CVDoc))
				       
				"Documentation for Class, Methods, IVs and CVs
	Class is default")
				     (WhereIs*(FindWhere (WhereIsIV WhereIsCV WhereIsMethod))
				       "Find location of method, iv, or cv")
				     (SubBrowser SubBrowser "Make a subBrowser on this class")
				     (TypeInName Unread "Put class name in typein buffer")))
		   (MiddleButtonItems ((BoxNode BoxNode "Draw a box around selected node")
				       (EM*(EditMethod (EditMethod BreakMethod UnbreakMethod
								   (EM! EM! 
				   "Edit method selected from Menu, making it local if necessary")
								   (EditMethodObject EditMethodObject 
							"Edit the object representing the method"))
						       "Edit method of class selected from Menu"))
				       (Add*(DefMethod ((Specialize DefineSubclass 
								  "Define a specialized subclass")
							DefMethod SpecializeMethod DefRSM AddSuper 
							AddNewIV AddNewCV (New SetItNew 
						     "Set IT to a new instance of selected class")))
					 
	      "Add a new method, a specialized class, IV or CV to class, or make a new instance.")
				       (Delete*(DeleteClass (DeleteFromBrowser DeleteIV DeleteCV 
									       DeleteMethod 
									       DeleteClass))
					 "Delete one of Methods IVs CVs
or the class itself")
				       (Move*(MoveTo (MoveTo CopyTo))
					 "Move or copy")
				       (Rename*(RenameMeth (RenameClass RenameIV RenameCV RenameMeth))
					 "Rename some part of the class")
				       (Edit*(EditObject ((Edit EditObject "Edit the object")
							  (Edit! Edit! 
							      "Edit class showing inherited info")
							  (Inspect (QUOTE Inspect)
								   "Inspect selected class")))
					 "Edit class")))
		   (LocalCommands (AddNewIV AddNewCV CopyTo BoxNode ClassDoc CVDoc DefineSubclass 
					    DeleteClassItem DeleteIV EditObject FindWhere FlipNode 
					    IVDoc GetMethodDoc MoveTo Recompute RenamePart SubBrowser 
					    Unread)))
   (InstanceVariables (title "Class Inheritance Lattice"))]

[DEFCLASS FileBrowser
   (MetaClass Class Edited:                                  (* dgb: " 4-Jun-84 14:06"))
   (Supers ClassBrowser)
   (ClassVariables (TitleItems #(((EditFile (EditComs (EditComs EditFns EditInstances EditVars))
					    "Edit the Coms for the file")
				  (SaveFile SaveFile "Do (FILES?) and then dump the file"))
				 UnionSuperValue NIL) doc    (* Items for menu of selections in title of window)
			       ))
   (InstanceVariables (title "FileBrowser" doc               (* Title of browser))
		      (width 100)
		      (file NIL doc                          (* Name of file being browsed.
							     fileComs property is atom for fileComs)
			    fileComs NIL)
		      (nonFileClasses NIL doc                (* classes which should be added to browser, but are no 
							     on file. Must be exisiting classes)))]

[DEFCLASS InstanceBrowser
   (MetaClass Class doc 

          (* Follows the downward lattice in object named in subIV. If subIV is changed after display, will show the newly 
	  defined alternative lattice starting at the same starting points)


	      Edited:                                        (* dgb: "19-SEP-83 17:31")
	      )
   (Supers LatticeBrowser)
   (ClassVariables (TitleItems ((Recompute (QUOTE Recompute)
					   "Recompute lattice from starting objects")
				(NewPath (QUOTE NewPath)
					 "Change name of sub to be followed in computing lattice.")
				(AddRoot (QUOTE AddRoot)
					 "Add named item to startingList for browser")
				(DeleteRoot (QUOTE DeleteRoot)
					    "Delete named item on startinglist for browser")
				(SaveInIT (QUOTE SaveInIT)
					  "IT←<this browser>"))
			       doc                           (* Items for menu of selections in title of window)
			       ))
   (InstanceVariables (subIV NIL doc                         (* Name of instance variable which provides names and/or
							     pointers to subobjects)))]

[DEFCLASS LatticeBrowser
   (MetaClass Class Edited:                                  (* dgb: "28-May-84 15:24"))
   (Supers Window)
   (ClassVariables (LocalCommands (EditObject BoxNode Recompute AddStartingItem)
				  doc                        (* messages that should be sent to browser when item 
							     seleted in menu, even if object does understand them)
				  )
		   (TitleItems ((Recompute Recompute "Recompute lattice from starting objects")
				(ShapeToHold ShapeToHold 
					   "Make window large or small enough to just hold graph")
				(AddRoot AddRoot "Add named item to startingList for browser")
				(ChangeFontSize ChangeFontSize "Choose a new size Font")
				(Lattice/Tree ChangeFormat "Change format between lattice and tree")
				(SaveValue SaveInIT "(SavedValue)← thisBrowser"))
			       doc                           (* Items for menu of selections in title of window)
			       )
		   (LeftButtonItems ((BoxNode BoxNode 
				      "Draw box around selected node.
Unboxed by another BoxNode")
				     (PP PP "Prettyprint selected item"))
				    doc                      (* Menu items for LeftButton seletion -- Value sent as 
							     message to object or browser -- see LocalCommands)
				    )
		   (MiddleButtonItems ((Inspect Inspect "Inspect selected item")
				       (Edit EditObject "Edit selected item"))
				      doc                    (* Menu items for MiddleButton seletion -- Value sent as
							     message to object or browser -- see LocalCommands)
				      ))
   (InstanceVariables (topAlign NIL doc                      (* Flg used to indicate whether graph should be aligned 
							     with the top or bottom of the window))
		      (title "Browser Window" doc            (* Title passed to GRAPHER package))
		      (startingList NIL doc                  (* list of objects used to compute this browser)
				    )
		      (goodList NIL doc                      (* limit choices to this set))
		      (badList NIL doc                       (* Don't put in any items on this set))
		      (lastSelectedObject NIL doc            (* last object selected)
					  DontSave Any)
		      (browseFont #((FONTCREATE (QUOTE (HELVETICA 10 BOLD)))
				    FirstFetch ReplaceMe) FontFamily HELVETICA FontSize 10 FontFace 
				  BOLD DontSave (Value))
		      (boxedNode NIL doc                     (* last item Boxed, if any))
		      (graphFormat (LATTICE)
				   choices
				   [(HORIZONTAL/LATTICE (QUOTE (LATTICE)))
				    (VERTICAL/LATTICE (QUOTE (VERTICAL LATTICE)))
				    (HORIZONTAL/TREE (QUOTE (COPIES/ONLY)))
				    (VERTICAL/TREE (QUOTE (VERTICAL COPIES/ONLY]
				   doc                       (* Controls format for laying out graph for GRAPHER)
				   ))]

[DEFCLASS PathBrowser
   (MetaClass Class doc                                      (* A mixin which shows paths and their locl context in a
							     browser)
	      Edited:                                        (* dgb: " 7-FEB-84 17:52")
	      )
   (Supers LatticeBrowser)
   (InstanceVariables (pathObjects NIL doc                   (* objects which have been put on the path)
				   ))]

[DEFCLASS SupersBrowser
   (MetaClass Class Edited:                                  (* edited: "13-NOV-83 17:17")
	      doc                                            (* Browses upwards from a class to all of its supers.)
	      )
   (Supers ClassBrowser)
   (InstanceVariables (title "Supers Lattice" doc            (* Title passed to GRAPHER package)))]

[DEFCLASS MetaBrowser
   (MetaClass Class doc                                      (* Runs through the meta classes of a class)
	      Edited:                                        (* dgb: "22-JUL-83 15:39")
	      )
   (Supers ClassBrowser)]

[METH ClassBrowser  AddNewCV (object objName)
      (* Add a new IV or edit an old one)]


[METH ClassBrowser  AddNewIV NIL
      NIL]


[METH ClassBrowser  AddSuper (obj objName)
      (* Add a super as first)]


[METH ClassBrowser  BoxNode NIL
      (* Box selected node and unbox previous)]


[METH ClassBrowser  CVDoc (class className)
      NIL]


[METH ClassBrowser  ClassDoc (object objname)
      (* Print out class documentation if there is any)]


[METH ClassBrowser  CopyTo (object objName)
      (* Ask user whether to copy CVs IVs or Methods and then find which ones)]


[METH ClassBrowser  DefineSubclass (object objName)
      NIL]


[METH ClassBrowser  DeleteCV (obj objName)
      (* Delete selected CV)]


[METH ClassBrowser  DeleteClass (obj objName)
      (* Delete Class)]


[METH ClassBrowser  DeleteClassItem (class className type)
      (* Delete an item from a class, or the class itself)]


[METH ClassBrowser  DeleteFromBrowser NIL
      NIL]


[METH ClassBrowser  DeleteIV (obj objName)
      (* Delete selected IV)]


[METH ClassBrowser  DeleteMethod (obj objName)
      (* Delete selected Method)]


[METH ClassBrowser  DestroyAndRecompute (object objName)
      (* Destroy class and recompute lattice.)]


[METH ClassBrowser  FindWhere (object objName type)
      NIL]


[METH ClassBrowser  GetMethodDoc (object objName)
      (* Find the method requested and then ask the class)]


[METH ClassBrowser  GetSubs (obj objName)
      (* Returns subclasses of a class on goodlist if any)]


[METH ClassBrowser  IVDoc (class className)
      (* Show menu of classVariables and give documentation for each)]


[METH ClassBrowser  LeftShiftSelect (object objName)
      (* Ask user whether to move CVs IVs or Methodsand then find which ones)]


[METH ClassBrowser  MoveTo (object objName)
      (* Ask user whether to move CVs IVs or Methodsand then find which ones.)]


[METH ClassBrowser  NewItem (name)
      (* Either add named class, or create a class by that Name)]


[METH ClassBrowser  Recompute (reshapeFlg)
      (* Recompute graph, and rebox bosedNode)]


[METH ClassBrowser  RenameCV (object objName)
      (* Rename CV if one is given)]


[METH ClassBrowser  RenameClass (object objName)
      (* Read in a new name for the class, and rename it)]


[METH ClassBrowser  RenameIV (object objName)
      (* Rename an IV if one is given)]


[METH ClassBrowser  RenameMeth (object objName)
      (* Rename selected method)]


[METH ClassBrowser  RenamePart (object objName)
      NIL]


[METH ClassBrowser  SetItNew (class)
      (* Set self to instance of selected class)]


[METH ClassBrowser  WhereIsCV (obj objName)
      (* Whereis CV)]


[METH ClassBrowser  WhereIsIV (obj objName)
      (* Find class containing IV description)]


[METH ClassBrowser  WhereIsMethod (obj objName)
      NIL]


[METH FileBrowser  DefineSubclass (object objName)
      NIL]


[METH FileBrowser  EditComs NIL
      (* Edit the coms for file)]


[METH FileBrowser  EditFns NIL
      (* Choose a Function and Edit it)]


[METH FileBrowser  EditInstances NIL
      (* Select from the set of instances)]


[METH FileBrowser  EditVars NIL
      (* Edit a selected variable)]


[METH FileBrowser  File (fileName)
      (* Browse classes contained on the file)]


[METH FileBrowser  NewItem (name)
      (* Either add named class, or create a class by that Name)]


[METH FileBrowser  Recompute (dontReshapeFlg)
      (* Recompute what the classes are on the file)]


[METH FileBrowser  SaveFile NIL
      (* Save file for file browser)]


[METH FileBrowser  SetItNew (obj objName)
      NIL]


[METH InstanceBrowser  GetSubs NIL
      (* Gets a set of subs from an object for browsing.)]


[METH InstanceBrowser  NewPath (subName)
      (* Changes the name of the sub by which the lattice is computed, changes the title, and 
	 recomputes the graph)]


[METH LatticeBrowser  AddRoot (newItem)
      NIL]


[METH LatticeBrowser  BoxNode (object unboxPrevious)
      NIL]


[METH LatticeBrowser  BrowserObjects NIL
      (* Return a list of all the objects shown in the browser)]


[METH LatticeBrowser  ChangeFontSize (size)
      (* Change the font size from whatever it is to size)]


[METH LatticeBrowser  ChangeFormat (format)
      (* Change format between Lattice and Tree)]


[METH LatticeBrowser  Clear NIL
      (* Clear out nodes of graph)]


[METH LatticeBrowser  DoSelectedCommand (command obj objName)
      (* does the selected command or forwards it to the object)]


[METH LatticeBrowser  EEObject (object objName)
      (* Call editor with EE on object)]


[METH LatticeBrowser  EditObject (object objName args)
      (* Call editor with commands args)]


[METH LatticeBrowser  FlashNode (node N flashTime)
      (* Flip node N times)]


[METH LatticeBrowser  FlipNode (object)
      (* Inverts the video around the node in the graph representing the object)]


[METH LatticeBrowser  GetLabel (object)
      (* Get a label for an object to be displayed in the browser.)]


[METH LatticeBrowser  GetNodeList (browseList goodList)
      NIL]


[METH LatticeBrowser  GetSubs (object)
      (* Gets a set of subs from an object for browsing)]


[METH LatticeBrowser  HasObject (object)
      (* Check object in grapher nodes, and return if it is one of them)]


[METH LatticeBrowser  LeftSelection NIL
      (* * Move object if CTRL down. Do LeftShiftSelect if SHIFT down. Else choose from 
	 LeftButtonItems)]


[METH LatticeBrowser  LeftShiftSelect (object objname)
      (* Called when item is selected with left key and LSHIFT is down)]


[METH LatticeBrowser  ListObjects (object)
      (* return a list of the objects that are being displayed in the browser)]


[METH LatticeBrowser  MiddleSelection NIL
      (* This function called from the GRAPHER package when a node is selected with the middle mouse 
	 button. If no node is selected then just returns.)]


[METH LatticeBrowser  MiddleShiftSelect (object objname)
      (* Called when item is selected with middle key and LSHIFT is down SendInTtyProcess is so this 
	 is done in the TTY process)]


[METH LatticeBrowser  NewItem (newItem)
      (* Return named Object)]


[METH LatticeBrowser  ObjNamePair (objOrName)
      NIL]


[METH LatticeBrowser  Recompute (dontReshapeFlg)
      (* Recompute the browseGraph in the same window)]


[METH LatticeBrowser  SaveInIT NIL
      (* save value in IT)]


[METH LatticeBrowser  ShapeToHold (margin)
      (* Shape the browse window to just hold the nodes with (OR margin Browsemargin)
	 to spare)]


[METH LatticeBrowser  Show (browseList windowOrTitle goodList)
      (* * Show the items and their subs on a browse window.)]


[METH LatticeBrowser  SubBrowser (obj objName)
      (* Create a subbrowser on selected object)]


[METH LatticeBrowser  TitleSelection NIL
      (* Do TitleItems if selected in title area. Replaces TitleSelection in Window because this one 
	 does evaluation in TTY process, and saves events on history)]


[METH LatticeBrowser  Unread (object objName)
      (* Unread name into system buffer)]


[METH MetaBrowser  GetSubs (elt)
      (* Subs for meta browser is the meta class of the class.)]


[METH PathBrowser  AddAndBox (obj objName)
      (* Add selected object to path, and box it)]


[METH PathBrowser  AddToPath (object)
      (* Add a new object to the path)]


[METH PathBrowser  Clear NIL
      (* Empty PathBrowser)]


[METH PathBrowser  GetSubs (obj)
      (* Only get subs for elements on the path)]


[METH PathBrowser  LeftShiftSelect (obj objName)
      (* Add selected object to path, and box it)]


[METH PathBrowser  Recompute (dontReshapeFlg)
      (* Flip nodes which are on path)]


[METH SupersBrowser  GetSubs (object objName)
      (* Returns metaclass plus local supers)]


(DEFINEQ

(ClassBrowser.AddNewCV
  [LAMBDA (self object objName)                              (* dgb: "26-Jun-84 15:27")
                                                             (* Add a new IV or edit an old one)
    (PROG (cvForm (cvName (PromptRead "Please tell me the name of the CV.")))
          (COND
	    ((NULL cvName)
	      (RETURN NIL))
	    ((FMEMB cvName (← object List (QUOTE CVs)))
	      (RINGBELLS)
	      (PROMPTPRINT objName "already has " cvName)
	      (RETURN NIL)))
          [SETQ cvForm (BQUOTE (, cvName **DefaultValue doc 
                                                             (* CV added by , (USERNAME T))]
          (SETQ cvForm (DEDITE cvForm NIL objName (QUOTE CLASSES)))
          (AddCV object (CAR cvForm)
		 (CADR cvForm))
          (for P on (CDDR cvForm) by (CDDR P) do (PutClassValue object (CAR cvForm)
								(CADR P)
								(CAR P])

(ClassBrowser.AddNewIV
  [LAMBDA (self object objName)                              (* dgb: "21-Apr-84 13:05")
                                                             (* Add a new IV or edit an old one)
    (PROG (ivForm (ivName (PromptRead "Please tell me the name of the IV.")))
          (COND
	    ((NULL ivName)
	      (RETURN NIL))
	    ((← object HasIV ivName)
	      (RINGBELLS)
	      (PROMPTPRINT objName "already has " ivName)
	      (RETURN NIL)))
          [SETQ ivForm (BQUOTE (, ivName **DefaultValue doc 
                                                             (* IV added by , (USERNAME NIL T))]
      LP  (SETQ ivForm (DEDITE ivForm NIL objName (QUOTE CLASSES)))
          (OR (ERSETQ (AddCIV object (CAR ivForm)
			      (CADR ivForm)
			      (CDDR ivForm)))
	      (GO LP])

(ClassBrowser.AddSuper
  [LAMBDA (self obj objName)                                 (* dgb: "28-May-84 12:53")
                                                             (* Add a super as first)
    (PROG ((superName (PromptRead "Type in name of new super")))
          (RETURN (COND
		    ((NULL superName)
		      (PROMPT "Nothing Added"))
		    ((NOT (type? class ($! superName)))
		      (PROMPT superName " not a class,
nothing added"))
		    ((FMEMB superName (GetSourceSupers obj))
		      (PROMPT superName " is already super of class."))
		    (T (InstallSupers obj (CONS superName (GetSourceSupers obj])

(ClassBrowser.BoxNode
  [LAMBDA (self object)                                      (* dgb: " 4-JUN-83 17:07")
                                                             (* Box selected node and unbox previous)
    (←Super
      self BoxNode object T])

(ClassBrowser.CVDoc
  [LAMBDA (self class className)                             (* dgb: "21-Apr-84 09:33")
                                                             (* Show menu of classVariables and give documentation 
							     for each)
    (PROG [choice menu (vbls (← class List!(QUOTE CVS]
          (COND
	    ((NULL vbls)
	      (PROMPT (CHARACTER 7)
		      "
No Class Variables found for " className)))
          (SETQ menu (← self ItemMenu vbls (CONCAT className " ClassVars")))
      LP  (COND
	    ((NULL (SETQ choice (MENU menu)))
	      (RETURN NIL)))
          (printout PPDefault T T className "::" choice ": " (GetClassValue class choice
									    (QUOTE doc)))
          (GO LP])

(ClassBrowser.ClassDoc
  [LAMBDA (self object objname)                              (* dgb: " 8-DEC-82 17:02")
                                                             (* Print out class documentation if there is any)
    (PROG [(doc (GetClassHere object (QUOTE doc]
          (COND
	    ((NotSetValue doc)
	      (printout PPDefault T objname " has no documentation." T))
	    (T (printout PPDefault T objname ": " doc T])

(ClassBrowser.CopyTo
  [LAMBDA (self object objName)                              (* dgb: "22-Jun-84 11:49")
                                                             (* Ask user whether to copy CVs IVs or Methods and then 
							     find which ones)
    (PROG (name type value items flg)
          (COND
	    ((NULL (@ boxedNode))
	      (PrintStatus (CHARACTER 7)
			   "First Box the node which is target for move.")
	      (RETURN NIL)))
          (OR [SETQ type (MENU (create MENU
				       ITEMS ←(QUOTE (IVS CVS Methods]
	      (RETURN NIL))
      LP  (COND
	    ((NULL (SETQ items (← object List type)))
	      (OR flg (PrintStatus (CHARACTER 7)
				   objName " has no " type))
	      (RETURN)))
          (SETQ flg T)                                       (* So that when last IV is removed, no comment is made)
          (OR [SETQ name (MENU (← self ItemMenu (SORT items)
				  (CONCAT (ClassName object)
					  " " type]
	      (RETURN NIL))
          (SELECTQ type
		   (IVS (← object CopyIV name (@ boxedNode)))
		   (CVS (← object CopyCV name (@ boxedNode)))
		   [Methods (COND
			      [(EQ object (@ boxedNode))
				(← object CopyMethod name (@ boxedNode)
				   (OR (PromptRead "Tell me new selector name")
				       (RETURN (PROMPT "Not copied"]
			      (T (← object CopyMethod name (@ boxedNode)
				    name]
		   NIL)
          (PrintStatus type " " name " has been copied to " (@ boxedNode))
          (GO LP])

(ClassBrowser.DefineSubclass
  [LAMBDA (self object objName)                              (* dgb: "20-SEP-83 16:47")
                                                             (* Define a new subclass, giving it a name typed in by 
							     user)
    (PROG (className)
          (COND
	    ((SETQ className (PromptRead "Type in the name of the new class, or NIL for none."))
	      [COND
		((NOT (LITATOM className))
		  (RETURN (PROMPT (CHARACTER 7)
				  className "should be an atom to name a class"]
	      (← object Specialize className)
	      (← self Recompute])

(ClassBrowser.DeleteCV
  [LAMBDA (self obj objName)                                 (* dgb: "15-DEC-83 08:11")
                                                             (* Delete selected CV)
    (← self DeleteClassItem obj objName (QUOTE CVs])

(ClassBrowser.DeleteClass
  [LAMBDA (self obj objName)                                 (* dgb: "15-DEC-83 08:12")
                                                             (* Delete Class)
    (← self DeleteClassItem obj objName (QUOTE Class])

(ClassBrowser.DeleteClassItem
  [LAMBDA (self class className type)                        (* dgb: "12-Jun-84 17:28")
                                                             (* Delete an item from a class, or the class itself)
    (PROG (choice choices)
          (OR type [SETQ type (MENU (MenuGetOrCreate ClassChoiceMenu (QUOTE (IVs CVs Methods Class]
	      (RETURN))
          (OR (SETQ choices (← class List type))
	      (PROMPT "
No items for " className " of type " type ".
")
	      (RETURN))
          (AND (EQ type (QUOTE Class))
	       (RETURN (← self DestroyAndRecompute class className)))
          (OR [SETQ choice (MENU (← self ItemMenu choices (CONCAT (ClassName class)
								  " " type]
	      (RETURN))
          (SELECTQ type
		   (IVs (← class Delete (QUOTE IV)
			   choice))
		   (CVs (← class Delete (QUOTE CV)
			   choice))
		   [Methods (← class Delete (QUOTE Method)
			       choice
			       (MENU (create MENU
					     TITLE ←(QUOTE "Select Deletion Operation")
					     ITEMS ←(QUOTE (("Delete as Method Only" NIL 
								       "Remove method from class")
							     ("Delete Method and Function" T 
								"Also delete function definition")
							     ("Abort" (ERROR!)
								      "Don't delete anything"]
		   (LoopsHelp type " wrong in DeleteClassItem."])

(ClassBrowser.DeleteFromBrowser
  [LAMBDA (self obj objname)                                 (* dgb: "21-Apr-84 10:17")
                                                             (* Place on badList for Browser)
    (←@
      badList
      (CONS obj (@ badList)))
    (← self Recompute])

(ClassBrowser.DeleteIV
  [LAMBDA (self obj objName)                                 (* dgb: "15-DEC-83 08:11")
                                                             (* Delete selected IV)
    (← self DeleteClassItem obj objName (QUOTE IVs])

(ClassBrowser.DeleteMethod
  [LAMBDA (self obj objName)                                 (* dgb: "15-DEC-83 08:11")
                                                             (* Delete selected Method)
    (← self DeleteClassItem obj objName (QUOTE Methods])

(ClassBrowser.DestroyAndRecompute
  [LAMBDA (self object objName)                              (* dgb: "21-Jun-84 23:22")
                                                             (* Destroy class and recompute lattice.)
    (AND [MENU (create MENU
		       TITLE ←(QUOTE Confirm)
		       ITEMS ←(LIST (CONCAT "Destroy " objName]
	 (PROGN (← object Destroy)
		(← self Recompute)
		T])

(ClassBrowser.FindWhere
  [LAMBDA (self object objName type)                         (* dgb: "21-Apr-84 09:04")
                                                             (* Ask user whether CVs IVs or Methods wanted and then 
							     find that one)
    (PROG (name value items menu)
          (OR type [SETQ type (MENU (create MENU
					    ITEMS ←(QUOTE (IVS CVS Methods]
	      (RETURN NIL))
          (COND
	    ((NULL (SETQ items (← object List! type)))
	      (PrintStatus (CHARACTER 7)
			   objName " has no " type)
	      (RETURN)))
          (SETQ menu (← self ItemMenu (SORT items)))
      LP  (OR (SETQ name (MENU menu))
	      (RETURN NIL))
          (SETQ value (← object WhereIs name type))
          (← self FlashNode value)
          (PrintStatus type " " name " is in " value "
")
          (GO LP])

(ClassBrowser.GetMethodDoc
  [LAMBDA (self object objName)                              (* dgb: "26-Apr-84 10:06")
                                                             (* Find the method requested and then ask the class)
    (PROG [selector (selectors (← object List!(QUOTE Methods]
          (AND selectors (SETQ selector (MENU (← self ItemMenu selectors "All methods")))
	       (← object MethodDoc selector])

(ClassBrowser.GetSubs
  [LAMBDA (self obj objName)                                 (* dgb: "12-DEC-83 16:10")
                                                             (* Returns subclasses of a class on goodlist if any)
    (for C in (← obj SubClasses) when (OR (NULL (@ goodList))
					  (FMEMB C (@ goodList))
					  (FMEMB (GetObjectRec C)
						 (@ goodList)))
       collect (GetObjectRec C])

(ClassBrowser.IVDoc
  [LAMBDA (self class className)                             (* dgb: "21-Apr-84 09:38")
                                                             (* Show menu of classVariables and give documentation 
							     for each)
    (PROG [choice menu (vbls (← class List!(QUOTE IVS]
          (COND
	    ((NULL vbls)
	      (PROMPT (CHARACTER 7)
		      "
No Instance Variables found for " className)))
          (SETQ menu (← self ItemMenu vbls (CONCAT className " Instance Vars")))
      LP  (COND
	    ((NULL (SETQ choice (MENU menu)))
	      (RETURN NIL)))
          (printout PPDefault T T className ":" choice ": " (GetClassIV class choice (QUOTE doc)))
          (GO LP])

(ClassBrowser.LeftShiftSelect
  [LAMBDA (self object objname)                              (* dgb: "25-MAR-83 12:15")
                                                             (* Call PrintSummary when selected with LSHIFT down)
    (← object PrintSummary])

(ClassBrowser.MoveTo
  [LAMBDA (self object objName)                              (* dgb: " 2-Jul-84 23:26")
                                                             (* Ask user whether to move CVs IVs or Methodsand then 
							     find which ones.)
    (PROG (name type value items flg)
          (OR [SETQ type (MENU (create MENU
				       ITEMS ←(QUOTE (IVS CVS Methods Supers File]
	      (RETURN NIL))
      LP  (COND
	    ((EQ type (QUOTE File))
	      (← object MoveToFile)
	      (RETURN (← self Recompute)))
	    ((NULL (SETQ items (← object List type)))
	      (OR flg (PrintStatus (CHARACTER 7)
				   objName " has no " type))
	      (RETURN)))
          [COND
	    ((NULL (@ boxedNode))
	      (RETURN (PROMPT (CHARACTER 7)
			      "Use BoxNode to box node which
is to be target for Move")))
	    ((EQ object (@ boxedNode))
	      (RETURN (PROMPT (CHARACTER 7)
			      "Can't move to same node"]
          (SETQ flg T)                                       (* So that when last item is removed, no comment is 
							     made)
          (OR [SETQ name (MENU (← self ItemMenu (COND
				    ((EQ type (QUOTE Supers))
				      items)
				    (T (SORT items)))
				  (CONCAT (ClassName object)
					  " " type]
	      (RETURN NIL))
          (SELECTQ type
		   (Supers                                   (* Substitute the boxed node for the selected super in 
							     the list of items)
			   (← object ReplaceSupers (SUBST (ClassName (@ boxedNode))
							  name items))
			   (← self Recompute)
			   (RETURN))
		   (IVS (MoveVariable objName (ClassName (@ boxedNode))
				      name))
		   (CVS (MoveClassVariable objName (ClassName (@ boxedNode))
					   name))
		   (Methods (MoveMethod objName (ClassName (@ boxedNode))
					name name))
		   NIL)
          (PrintStatus type " " name " is now in " (@ boxedNode))
          (GO LP])

(ClassBrowser.NewItem
  [LAMBDA (self name)                                        (* dgb: "21-Apr-84 11:26")
                                                             (* Either add named class, or create a class by that 
							     Name)
    (PROG ((newItem (←Super
		      self NewItem name)))
          (RETURN (COND
		    ((Object? newItem)
		      newItem)
		    ((AND newItem (MOUSECONFIRM (CONCAT "About to create class named " newItem)
						NIL PROMPTWINDOW))
		      (← ($ Class)
			 New newItem])

(ClassBrowser.Recompute
  [LAMBDA (self reshapeFlg)                                  (* dgb: "27-Mar-84 14:08")
                                                             (* Recompute graph, and rebox bosedNode)
    (←Super
      self Recompute reshapeFlg)
    (AND (@ boxedNode)
	 (BoxWindowNode (@ boxedNode)
			(@ window])

(ClassBrowser.RenameCV
  [LAMBDA (self object objName)                              (* dgb: " 2-Jul-84 23:27")
                                                             (* Rename CV if one is given)
    (PROG (name newName)
          (COND
	    ([NULL (SETQ items (← object List (QUOTE CVs]
	      (OR flg (PrintStatus (CHARACTER 7)
				   objName " has no Class Variables"))
	      (RETURN)))
          (OR [SETQ name (MENU (← self ItemMenu (SORT items)
				  (CONCAT (ClassName object)
					  " CVs"]
	      (RETURN NIL))
          (AND (SETQ newName (PromptRead "New CV name:"))
	       (RenameVariable objName name newName T])

(ClassBrowser.RenameClass
  [LAMBDA (self object objName)                              (* dgb: "23-DEC-83 00:50")
                                                             (* Read in a new name for the class, and rename it)
    (PROG ((className (PromptRead "Type in the new name for this class,
 or NIL not to change.")))
          (COND
	    (className (← object Rename className)
		       (← self Recompute])

(ClassBrowser.RenameIV
  [LAMBDA (self object objName)                              (* dgb: "21-Apr-84 09:42")
                                                             (* Rename an IV if one is given)
    (PROG (name newName)
          (COND
	    ([NULL (SETQ items (← object List (QUOTE IVs]
	      (OR flg (PrintStatus (CHARACTER 7)
				   objName " has no Instance Variables"))
	      (RETURN)))
          (OR [SETQ name (MENU (← self ItemMenu (SORT items)
				  (CONCAT (ClassName object)
					  " IVs"]
	      (RETURN NIL))
          (AND (SETQ newName (PromptRead "New IV name:"))
	       (RenameVariable objName name newName])

(ClassBrowser.RenameMeth
  [LAMBDA (self object objName)                              (* dgb: " 2-Jul-84 23:26")
                                                             (* Rename selected method)
    (PROG (name newName)
          (COND
	    ([NULL (SETQ items (← object List (QUOTE Methods]
	      (OR flg (PrintStatus (CHARACTER 7)
				   objName " has no Methods"))
	      (RETURN)))
          (OR [SETQ name (MENU (← self ItemMenu (SORT items)
				  (CONCAT (ClassName object)
					  " Methods"]
	      (RETURN NIL))
          (AND (SETQ newName (PromptRead "New Selector Name:"))
	       (← object RenameMethod name newName])

(ClassBrowser.RenamePart
  [LAMBDA (self object objName)                              (* dgb: "21-Apr-84 09:45")
                                                             (* Ask user whether to rename CVs IVs or Methods or 
							     class and then find which ones)
    (PROG (name newName type value items flg)
          (OR [SETQ type (MENU (create MENU
				       ITEMS ←(QUOTE (IVS CVS Methods Class]
	      (RETURN NIL))
      LP  (SELECTQ type
		   (Class (RETURN (← self RenameClass object objName)))
		   ((IVS CVS Methods))
		   (RETURN NIL))
          (COND
	    ((NULL (SETQ items (← object List type)))
	      (OR flg (PrintStatus (CHARACTER 7)
				   objName " has no " type))
	      (RETURN)))                                     (* So that when last IV is removed, no comment is made)
          (SETQ flg T)
          (OR [SETQ name (MENU (← self ItemMenu (SORT items)
				  (CONCAT (ClassName object)
					  " " type]
	      (RETURN NIL))
          (SELECTQ type
		   (IVS (AND (SETQ newName (PromptRead "New IV name:"))
			     (RenameVariable objName name newName)))
		   (CVS (AND (SETQ newName (PromptRead "New CV name:"))
			     (RenameVariable objName name newName T)))
		   (Methods (AND (SETQ newName (PromptRead "New Selector Name:"))
				 (← object RenameMethod name newName)))
		   NIL)
          (GO LP])

(ClassBrowser.SetItNew
  [LAMBDA (self class)                                       (* dgb: "27-Mar-84 14:12")
                                                             (* Set self to instance of selected class)
    (SETTOPVAL (QUOTE IT)
	       (PRINT (←New
			class Inspect)
		      T])

(ClassBrowser.WhereIsCV
  [LAMBDA (self obj objName)                                 (* dgb: "15-DEC-83 07:59")
                                                             (* Whereis CV)
    (← self FindWhere obj objName (QUOTE CVS])

(ClassBrowser.WhereIsIV
  [LAMBDA (self obj objName)                                 (* dgb: "14-Feb-84 13:51")
                                                             (* Find class containing IV description)
    (← self FindWhere obj objName (QUOTE IVS])

(ClassBrowser.WhereIsMethod
  [LAMBDA (self obj objName)                                 (* dgb: "15-DEC-83 08:00")
                                                             (* Where is method)
    (← self FindWhere obj objName (QUOTE Methods])

(FileBrowser.DefineSubclass
  [LAMBDA (self object objName)                              (* dgb: "21-Apr-84 09:59")
                                                             (* Define a new subclass, giving it a name typed in by 
							     user)
    (PROG (className)
          (COND
	    ((SETQ className (PromptRead "Type in the name of the new class, or NIL for none."))
	      [COND
		((NOT (LITATOM className))
		  (RETURN (PROMPT (CHARACTER 7)
				  className "should be an atom to name a class"]
	      (← object Specialize className)
	      (ADDTOFILE className (QUOTE CLASSES)
			 (@ file))
	      (← self Recompute])

(FileBrowser.EditComs
  [LAMBDA (self)                                             (* dgb: "18-Apr-84 13:03")
                                                             (* Edit the coms for file)
    (APPLY* (QUOTE DV)
	    (@ file:,fileComs])

(FileBrowser.EditFns
  [LAMBDA (self)                                             (* dgb: " 1-May-84 09:53")
                                                             (* Choose a Function and Edit it)
    (PROG [choice (fns (LDIFFERENCE (FILEFNSLST (@ file))
				    (FILECOMSLST (@ file)
						 (QUOTE METHODS]
          [SETQ choice (MENU (← self ItemMenu (CONS (QUOTE *NewFunction*)
						    fns)
				(CONCAT (@ file)
					" Functions"]
          [COND
	    ((EQ choice (QUOTE *NewFunction*))
	      (AND (SETQ choice (PromptRead "Please tell me the name of the new function"))
		   (APPLY* (QUOTE DE)
			   choice NIL (LIST (QUOTE *)
					    (QUOTE Comment))
			   NIL)
		   (ADDTOFILE choice (QUOTE FNS)
			      (@ file]
          (RETURN (AND choice (APPLY* (QUOTE DF)
				      choice])

(FileBrowser.EditInstances
  [LAMBDA (self)                                             (* dgb: "21-Apr-84 09:47")
                                                             (* Select from the set of instances)
    (PROG [choice (instances (FILECOMSLST (@ file)
					  (QUOTE INSTANCES]
          (AND instances [SETQ choice (MENU (← self ItemMenu (MAPCAR instances
								     (FUNCTION GetObjectRec))
					       (CONCAT (@ file)
						       " Instances"]
	       (← choice Edit])

(FileBrowser.EditVars
  [LAMBDA (self)                                             (* dgb: "21-Apr-84 09:48")
                                                             (* Edit a selected variable)
    (PROG [choice (vars (FILECOMSLST (@ file)
				     (QUOTE VARS]
          (AND vars [SETQ choice (MENU (← self ItemMenu vars (CONCAT (@ file)
								     " Vars"]
	       (APPLY* (QUOTE DV)
		       choice])

(FileBrowser.File
  [LAMBDA (self fileName)                                    (* dgb: " 2-Jul-84 23:55")
                                                             (* Browse classes contained on the file)
    (SETQ fileName (U-CASE fileName))
    (PROG (classes (fileComs (FILECOMS fileName)))
          (←@
	    file fileName)
          (←@
	    file:,fileComs fileComs)
          [COND
	    ((NLISTP (GETTOPVAL fileComs))                   (* New file)
	      (SETTOPVAL fileComs (COPY (BQUOTE (            (* File Created by , (USERNAME NIL T))
						 (CLASSES)
						 (METHODS)
						 (FNS)
						 (VARS)
						 (INSTANCES]
          (SETQ classes (FILECLASSES fileName))
          (← self Show classes (CONCAT fileName " file browser")
	     classes
	     (QUOTE showEvenIfEmpty))
          (COND
	    ((NULL (FILECOMSLST fileName (QUOTE CLASSES)))   (* Need to move if no classes to intialize movement)
	      (← self Move)))
          (RETURN self])

(FileBrowser.NewItem
  [LAMBDA (self name)                                        (* dgb: "21-Jun-84 23:17")
                                                             (* Either add named class, or create a class by that 
							     Name)
    (OR name (SETQ name (PromptRead "Give name of item to be added")))
    (PROG (new (alreadyExistsFlg ($! name)))
          [SETQ new (OR alreadyExistsFlg (AND name (MOUSECONFIRM (CONCAT 
								   "About to create class named "
									 name)
								 NIL PROMPTWINDOW)
					      (← ($ Class)
						 New name]
          (AND new (NOT alreadyExistsFlg)
	       (ADDTOFILE (ClassName new)
			  (QUOTE CLASSES)
			  (@ file)))
          (AND new alreadyExistsFlg (PushNewValue self (QUOTE nonFileClasses)
						  new))
          (RETURN new])

(FileBrowser.Recompute
  [LAMBDA (self dontReshapeFlg)                              (* dgb: "28-May-84 10:20")
                                                             (* Recompute what the classes are on the file)
    [←@
      startingList
      (←@
	goodList
	(APPEND (@ nonFileClasses)
		(for C in (FILECLASSES (@ file)) collect ($! C]
    (←Super
      self Recompute dontReshapeFlg])

(FileBrowser.SaveFile
  [LAMBDA (self)                                             (* dgb: " 5-Jun-84 14:49")
                                                             (* Save file for file browser)
    (FILES?)
    (APPLY (QUOTE CLEANUP)
	   (LIST (@ file])

(FileBrowser.SetItNew
  [LAMBDA (self obj objName)                                 (* dgb: "21-Apr-84 14:48")
                                                             (* Save value in IT and in SavedValue of LoopsIcon.
							     Put UID on list of INSTANCES to be saved)
    (PROG (name)
          (←Super
	    self SetItNew obj objName)
          (SETQ name (PromptRead "New Instance name, or NIL for none."))
          (AND name (← IT SetName name))
          (ADDTOFILE (OR name (UID IT))
		     (QUOTE INSTANCES)
		     (@ file))
          (PutValue (← ($ LoopsIcon)
		       Prototype)
		    (QUOTE savedValue)
		    IT])

(InstanceBrowser.GetSubs
  [LAMBDA (self object)                                      (* dgb: "19-SEP-83 17:12")
                                                             (* Gets a set of subs from an object for browsing.)
    (COND
      ((AND (@ subIV)
	    (← object HasIV (@ subIV)))

          (* If the object has an IV named in (@ subIV) and that is an IV of object, then use that for following links)


	(GetValue object (@ subIV])

(InstanceBrowser.NewPath
  [LAMBDA (self subName)                                     (* dgb: "19-SEP-83 17:31")
                                                             (* Changes the name of the sub by which the lattice is 
							     computed, changes the title, and recomputes the graph)
    (PROG NIL
          [COND
	    ((NULL subName)
	      (OR (SETQ subName (PromptRead "Name of new IV for browsing: "))
		  (RETURN]
          (←@
	    subIV subName)
          (←@
	    title
	    (CONCAT subName " instance browser"))
          (AND (← self HasLispWindow)
	       (← self Recompute])

(LatticeBrowser.AddRoot
  [LAMBDA (self newItem)                                     (* ms: "28-Jun-84 10:33")
                                                             (* Add a named item to the starting list of the browser)
    (PROG ((sl (@ startingList)))
          (OR (Object? (SETQ newItem (← self NewItem newItem)))
	      (RETURN (PROMPTPRINT "Nothing Added To Browser")))
          (pushnew sl newItem)
          (←@
	    startingList sl)
          (AND (@ goodList)
	       (NOT (FMEMB newItem (@ goodList)))
	       (PushValue self (QUOTE goodList)
			  newItem))
          (←@
	    badList
	    (DREMOVE newItem (@ badList)))
          (← self Recompute])

(LatticeBrowser.BoxNode
  [LAMBDA (self object unboxPrevious)                        (* dgb: "21-Apr-84 10:59")
                                                             (* Puts a box around the node in the graph representing 
							     the object.)
    (PROG (bn)
          [COND
	    ((LITATOM object)
	      (SETQ object (OR (GetObjectRec object)
			       (ERROR object " is not a named object."]
          (BoxWindowNode object (@ window))
          (SETQ bn (@ boxedNode))                            (* Now remember new boxed node)
          (←@
	    boxedNode
	    (COND
	      ((NULL bn)
		object)
	      ((NEQ bn object)                               (* If there was a previously boxed node, remove the box 
							     from around it)
		(AND unboxPrevious (BoxWindowNode bn (@ window)))
		object)
	      (T NIL])

(LatticeBrowser.BrowserObjects
  [LAMBDA (self)                                             (* dgb: "28-May-84 12:58")
                                                             (* Return a list of all the objects shown in the 
							     browser)
    (for node in (fetch GRAPHNODES of (WINDOWPROP (@ window)
						  (QUOTE GRAPH)))
       when (NLISTP (CAR node)) collect (CAR node])

(LatticeBrowser.ChangeFontSize
  [LAMBDA (self size)                                        (* dgb: "13-DEC-83 21:48")
                                                             (* Change the font size from whatever it is to size)
    [OR size (SETQ size (MENU (COND
				((type? MENU (GETTOPVAL (QUOTE MenuSize)))
				  MenuSize)
				(T (SETTOPVAL (QUOTE MenuSize)
					      (create MENU
						      TITLE ← "Select Desired Size"
						      CHANGEOFFSETFLG ← T
						      ITEMS ←(QUOTE ((Abort NIL)
								      8 10 12 16]
    (COND
      (size [←@
	      browseFont
	      (FONTCREATE (LIST (@ browseFont:,FontFamily)
				size
				(@ browseFont:,FontFace]
	    (← self Recompute])

(LatticeBrowser.ChangeFormat
  [LAMBDA (self format)                                      (* dgb: "21-Apr-84 19:52")
                                                             (* Change format between Lattice and Tree)
    (COND
      ((LISTP format)
	(←@
	  graphFormat format))
      ([SETQ format (MENU (create MENU
				  ITEMS ←(@ graphFormat:,choices]
	(←@
	  graphFormat format)))
    (← self Recompute])

(LatticeBrowser.Clear
  [LAMBDA (self)                                             (* edited: " 2-Jul-84 13:43")
                                                             (* empty the window of active regions, return the 
							     window)
    (WINDOWPROP (@ window)
		(QUOTE GRAPH)
		NIL)
    (←Super
      self Clear)
    (@ window])

(LatticeBrowser.DoSelectedCommand
  [LAMBDA (self command obj objName)                         (* dgb: " 1-May-84 09:40")
                                                             (* does the selected command or forwards it to the 
							     object)
    (PROG (args)
          (COND
	    ((NULL command)
	      (RETURN NIL)))
          [COND
	    ((LISTP command)
	      (SETQ args (CDR command))
	      (SETQ command (CAR command]
          [COND
	    ((LISTP obj)

          (* Take care of being passed in a dummy node from browser in Lattice mode Dummy nodes are indicated by having the 
	  object in a list)


	      (SETQ obj (CAR obj))
	      (SETQ objName (GetObjectName obj]
          (COND
	    ((AND (NOT (FMEMB command (@@ LocalCommands)))
		  (← obj Understands command))
	      (SendInTtyProcess obj command args))
	    (T (SendInTtyProcess self command (CONS obj (CONS objName args])

(LatticeBrowser.EEObject
  [LAMBDA (self object objName)                              (* dgb: "10-Feb-84 13:38")
                                                             (* Call editor with EE on object)
    (← object Edit])

(LatticeBrowser.EditObject
  [LAMBDA (self object objName args)                         (* dgb: " 2-MAR-83 10:58")
                                                             (* Call editor with commands args)
    (← object Edit args])

(LatticeBrowser.FlashNode
  [LAMBDA (self node N flashTime)                            (* dgb: "22-NOV-82 23:35")
                                                             (* Flip node N times)
    (for i from 1 to (OR N 3)
       do (← self FlipNode node)
	  (DISMISS (OR flashTime 300))
	  (← self FlipNode node)
	  (DISMISS (OR flashTime 300])

(LatticeBrowser.FlipNode
  [LAMBDA (self object)                                      (* dgb: "14-Feb-84 16:07")
                                                             (* Inverts the video around the node in the graph 
							     representing the object)
    (PROG (node nodes (window (@ window)))
          [COND
	    ((LITATOM object)
	      (SETQ object (OR (GetObjectRec object)
			       (ERROR object " is not a named object."]
          [SETQ nodes (fetch GRAPHNODES of (WINDOWPROP window (QUOTE GRAPH]
          (COND
	    [(SETQ node (FASSOC object nodes))
	      (SETTOPVAL (QUOTE IT)
			 object)
	      (FLIPNODE node window)
	      (COND
		((AND (LISTP object)
		      (SETQ node (FASSOC (CAR object)
					 nodes)))
		  (FLIPNODE node window]
	    (T (PROMPTPRINT (CONCAT object " is not a node in this browser.
"])

(LatticeBrowser.GetLabel
  [LAMBDA (self object)                                      (* dgb: "26-SEP-82 15:51")
                                                             (* Get a label for an object to be displayed in the 
							     browser.)
    (GetObjectName object])

(LatticeBrowser.GetNodeList
  [LAMBDA (self browseList goodList)                         (* dgb: "12-DEC-83 16:14")

          (* Compute the node data structures of the tree starting at browseList. If goodList is given, only include 
	  elements of it. If goodList=T make it be browseList.)


    (COND
      ((EQ goodList T)
	(SETQ goodList browseList)))
    (PROG (subs pair (objList (CONS)))

          (* first make objList which is a list of pairs (object . objName). objName will be used as a title for a node in 
	  the browser. This structure will be replaced by a graphNode when it is processed. The nodeID of the graphNode will
	  be the object, and the label will be the name.)


          (for objOrName in browseList do (AND (SETQ pair (← self ObjNamePair objOrName))
					       (NOT (FASSOC (CAR pair)
							    (CAR objList)))
					       (TCONC objList pair)))

          (* * Now MAP ON list so pair can be replaced by graphNode)


          (for pair name obj subObjs on (CAR objList) when (NLISTP (SETQ name (CDAR pair)))
	     do (SETQ subObjs (CONS))
		[for sub objPair obj1 in (← self GetSubs (SETQ obj (CAAR pair)))
		   do                                        (* ObjNamePair returns NIL for destroyed objects.
							     include only members of goodList in subs if given.
							     Add to objList only once)
		      (COND
			((SETQ objPair (← self ObjNamePair sub))
			  (COND
			    ((NOT (FASSOC (SETQ obj1 (CAR objPair))
					  (CAR objList)))
			      (TCONC objList objPair)))
			  (TCONC subObjs obj1]
		(RPLACA pair (create GRAPHNODE
				     NODEID ← obj
				     TONODES ←(CAR subObjs)
				     NODELABEL ← name)))
          (RETURN (CAR objList])

(LatticeBrowser.GetSubs
  [LAMBDA (self object)                                      (* dgb: "26-SEP-82 17:17")
                                                             (* Gets a set of subs from an object for browsing)
    (COND
      ((← object HasIV (QUOTE subs))                         (* If the object has an IV called subs then use the 
							     contents of that)
	(%@ object subs])

(LatticeBrowser.HasObject
  [LAMBDA (self object)                                      (* dgb: "28-May-84 12:56")
                                                             (* Check object in grapher nodes, and return if it is 
							     one of them)
    (AND [FASSOC (GetObjectRec object)
		 (fetch GRAPHNODES of (WINDOWPROP (@ window)
						  (QUOTE GRAPH]
	 T])

(LatticeBrowser.LeftSelection
  [LAMBDA (self)                                             (* dgb: "14-Feb-84 16:17")

          (* * Move object if CTRL down. Do LeftShiftSelect if SHIFT down. Else choose from LeftButtonItems)


    (PROG (oldMode realObj (window (@ window)))
          (COND
	    ((KEYDOWNP (QUOTE CTRL))
	      (SETQ oldMode (DSPOPERATION NIL window))
	      (GETMOUSESTATE)                                (* Here to move a node.)
	      (DSPOPERATION (QUOTE INVERT)
			    window)
	      (EDITMOVENODE window)
	      (DSPOPERATION oldMode window))
	    (T                                               (* Here if left button depressed but not control.)
	       (PROG (selector items objName (latticeBrowser self)
			       (object (FindSelectedNode window)))
		     (DECLARE (SPECVARS object latticeBrowser))
                                                             (* SPECVARS for whenHeldFn)
		     (OR object (RETURN NIL))                (* Don't do anything unless an object selected)
		     (GETMOUSESTATE)
		     (SETQ objName (GetObjectName (OR (CAR (LISTP object))
						      object)))
		     (COND
		       ((KEYDOWNP (QUOTE LSHIFT))
			 (← latticeBrowser LeftShiftSelect (OR (CAR (LISTP object))
							       object)
			    objName))
		       (T (SETQ selector (OR (← self LeftChoice)
					     (RETURN NIL)))
			  (← latticeBrowser DoSelectedCommand selector (OR (CAR (LISTP object))
									   object)
			     objName])

(LatticeBrowser.LeftShiftSelect
  [LAMBDA (self object objname)                              (* dgb: "28-SEP-82 11:31")
                                                             (* Called when item is selected with left key and LSHIFT
							     is down)
    (← object PP!])

(LatticeBrowser.ListObjects
  [LAMBDA (self object)                                      (* dgb: "24-NOV-82 10:47")
                                                             (* return a list of the objects that are being displayed
							     in the browser)
    (AND (for node in (fetch GRAPHNODES of (WINDOWPROP (%@ window)
						       (QUOTE GRAPH)))
	    collect (CAR node])

(LatticeBrowser.MiddleSelection
  [LAMBDA (self)                                             (* dgb: " 1-May-84 09:13")

          (* This function called from the GRAPHER package when a node is selected with the middle mouse button.
	  If no node is selected then just returns.)


    (PROG (objName selection object (window (@ window))
		   (latticeBrowser self))
          (DECLARE (SPECVARS object latticeBrowser))
          (COND
	    ((NULL (SETQ object (FindSelectedNode window)))
	      (RETURN)))
          (SETQ objName (GetObjectName object))
          (←@
	    latticeBrowser lastSelectedObject object)
          (GETMOUSESTATE)
          (← self FlipNode object)
          (COND
	    ((KEYDOWNP (QUOTE LSHIFT))                       (* Invoke editor if Left Shift Key is down)
	      (← self FlipNode object)
	      (← latticeBrowser MiddleShiftSelect object objName))
	    (T (← self FlipNode object)
	       (SETQ selection (OR (← self MiddleChoice)
				   (RETURN NIL)))
	       (← latticeBrowser DoSelectedCommand selection object objName])

(LatticeBrowser.MiddleShiftSelect
  [LAMBDA (self object objname)                              (* dgb: " 1-May-84 09:15")
                                                             (* Called when item is selected with middle key and 
							     LSHIFT is down SendInTtyProcess is so this is done in 
							     the TTY process)
    (SendInTtyProcess self (QUOTE EditObject)
		      (LIST object])

(LatticeBrowser.NewItem
  [LAMBDA (self newItem)                                     (* ms: "28-Jun-84 10:49")
                                                             (* Return Object. Prompt for it if needed.)
    [COND
      ((NOT newItem)
	(SETQ newItem (PromptRead "Give name of item to be added"]
    (COND
      (newItem (COND
		 ((Object? newItem)
		   newItem)
		 ((LITATOM newItem)
		   ($! newItem])

(LatticeBrowser.ObjNamePair
  [LAMBDA (self objOrName)                                   (* dgb: "21-Apr-84 10:13")
                                                             (* Make a pair (object . objName) where objName is label
							     to be used in browser)
    (PROG (obj name)
          [COND
	    ((LITATOM objOrName)
	      (SETQ name objOrName)                          (* assume this is the name of the object.
							     RETURN NIL if it is not.)
	      (OR (SETQ obj (GetObjectRec objOrName))
		  (RETURN NIL))
	      (RETURN (CONS obj objOrName)))
	    (T                                               (* Assume it is an object)
	       (SETQ obj objOrName)
	       (SETQ name (← self GetLabel objOrName]
          (RETURN (COND
		    ((← obj InstOf!(QUOTE DestroyedObject))
		      NIL)
		    ([AND (@ goodList)
			  (NOT (FMEMB obj (@ goodList]
		      NIL)
		    ((FMEMB obj (@ badList))
		      NIL)
		    (T (CONS obj name])

(LatticeBrowser.Recompute
  [LAMBDA (self dontReshapeFlg)                              (* edited: "30-Jun-84 17:49")
                                                             (* Recompute the browseGraph in the same window)
    (← self Show (@ startingList))
    (COND
      [dontReshapeFlg (SCROLLW (@ window)
			       (WTODSX 0 (@ window))
			       (WTODSY 0 (@ window]
      (T (← self ShapeToHold)))
    self])

(LatticeBrowser.SaveInIT
  [LAMBDA (self)                                             (* dgb: "28-May-84 12:36")
                                                             (* save value in IT)
    (←Proto
      ($ LoopsIcon)
      Save
      (SETTOPVAL (QUOTE IT)
		 self])

(LatticeBrowser.ShapeToHold
  [LAMBDA (self margin)                                      (* dgb: "28-May-84 15:19")
                                                             (* Shape the browse window to just hold the nodes with 
							     (OR margin Browsemargin) to spare)
    (PROG [left bottom height width right top (region (WINDOWPROP (@ window)
								  (QUOTE REGION)))
		(nodes (fetch GRAPHNODES of (WINDOWPROP (@ window)
							(QUOTE GRAPH]
          (SETQ left (MIN/LEFT nodes))
          (SETQ bottom (MIN/BOTTOM nodes))
          (SETQ right (MAX/RIGHT nodes))
          (SETQ top (MAX/TOP nodes))
          (SETQ width (IMIN MaxLatticeWidth (WIDTHIFWINDOW (IDIFFERENCE right left)
							   4)))
          (SETQ height (IMIN MaxLatticeHeight (HEIGHTIFWINDOW (IDIFFERENCE top bottom)
							      T 4)))
          (AND (STRICTLY/BETWEEN (fetch WIDTH of region)
				 (SUB1 width)
				 (IPLUS 1 width (OR margin BrowserMargin)))
	       (STRICTLY/BETWEEN (fetch HEIGHT of region)
				 (SUB1 height)
				 (IPLUS 1 height (OR margin BrowserMargin)))
	       (PROGN (SCROLLW (@ window)
			       (WTODSX 0 (@ window))
			       (WTODSY 0 (@ window)))
		      (RETURN T)))
          [SHAPEW (@ window)
		  (SETQ region (create REGION
				       LEFT ←(fetch LEFT of region)
				       BOTTOM ←(fetch BOTTOM of region)
				       WIDTH ←(IPLUS width (OR margin BrowserMargin))
				       HEIGHT ←(IPLUS height (OR margin BrowserMargin]
          (← self SetRegion region T)
          (SCROLLW (@ window)
		   (WTODSX 0 (@ window))
		   (WTODSY 0 (@ window])

(LatticeBrowser.Show
  [LAMBDA (self browseList windowOrTitle goodList)           (* dgb: " 3-Jul-84 00:22")

          (* * Show the items and their subs on a browse window.)



          (* * If windowOrTitle is not a window it will be used as a title for a window which will be created.)


    (PROG (NODELST window)
          (COND
	    ((WINDOWP windowOrTitle)
	      (SETQ window windowOrTitle))
	    (windowOrTitle (←@
			     title windowOrTitle))
	    (T (SETQ window (@ window))                      (* create window if doesn't already exist;
							     see active-value)
	       ))
          [COND
	    ((AND browseList (NLISTP browseList))
	      (SETQ browseList (LIST browseList]
          (←@
	    startingList
	    (for C in browseList when (GetObjectRec C) collect (GetObjectRec C)))
          [AND goodList (←@
		 goodList
		 (for C in goodList when (GetObjectRec C) collect (GetObjectRec C]
          (COND
	    ((@ startingList)
	      (SETQ NODELST (← self GetNodeList (@ startingList)
			       (@ goodList)))
	      (WINDOWPROP (←@
			    window
			    (SHOWGRAPH (LAYOUTGRAPH NODELST (TreeRoots NODELST)
						    (@ graphFormat)
						    (@ browseFont))
				       window NIL NIL (@ topAlign)))
			  (QUOTE TITLE)
			  (@ title)))
	    (T (← self Clear)))
          (RETURN])

(LatticeBrowser.SubBrowser
  [LAMBDA (self obj objName)                                 (* dgb: "16-May-84 19:58")
                                                             (* Create a subbrowser on selected object)
    (←New
      (Class self)
      Show obj])

(LatticeBrowser.TitleSelection
  [LAMBDA (self)                                             (* dgb: " 1-May-84 09:51")

          (* Do TitleItems if selected in title area. Replaces TitleSelection in Window because this one does evaluation in 
	  TTY process, and saves events on history)


    (PROG (menu choice)
          (SETQ choice (OR (AND (SETQ menu (← self ChoiceMenu (QUOTE TitleItems)))
				(MENU menu))
			   (RETURN NIL)))
          (RETURN (SendInTtyProcess self choice])

(LatticeBrowser.Unread
  [LAMBDA (self object objName)                              (* dgb: "15-DEC-83 08:02")
                                                             (* Unread name into system buffer)
    (BKSYSBUF objName])

(MetaBrowser.GetSubs
  [LAMBDA (self elt)                                         (* dgb: "22-JUL-83 15:38")
                                                             (* Subs for meta browser is the meta class of the 
							     class.)
    (PROG [(meta (GetObjectRec (CAR (← (GetObjectRec elt)
				       List
				       (QUOTE Meta]
          (RETURN (COND
		    ((EQ meta (GetObjectRec elt))
		      NIL)
		    (T (CONS meta])

(PathBrowser.AddAndBox
  [LAMBDA (self obj objName)                                 (* dgb: "26-Apr-84 08:58")
                                                             (* Add selected object to path, and box it.)
    (← self AddToPath obj)
    (AND obj (← self BoxNode obj])

(PathBrowser.AddToPath
  [LAMBDA (self object)                                      (* dgb: "26-Apr-84 09:25")
                                                             (* Add a new object to the path)
    (PROG NIL
          (COND
	    ((NULL object)
	      (RETURN (← self Clear)))
	    ((FMEMB object (@ pathObjects))
	      (RETURN NIL)))
          (PushNewValue self (QUOTE pathObjects)
			object)
          (← self Recompute (QUOTE dontReshape)))
    object])

(PathBrowser.Clear
  [LAMBDA (self)                                             (* dgb: "24-Apr-84 10:15")
                                                             (* Empty PathBrowser)
    (←@
      pathObjects NIL)
    (←@
      lastSelectedObject NIL)
    (← self Recompute (QUOTE dontReshape])

(PathBrowser.GetSubs
  [LAMBDA (self obj)                                         (* dgb: " 7-FEB-84 18:03")
                                                             (* Only get subs for elements on the path)
    (COND
      ((FMEMB obj (@ pathObjects))
	(←Super
	  self GetSubs obj])

(PathBrowser.LeftShiftSelect
  [LAMBDA (self obj objName)                                 (* dgb: "14-Feb-84 15:11")
                                                             (* Add selected object to path, and box it)
    (QUOTE AddAndBox])

(PathBrowser.Recompute
  [LAMBDA (self dontReshapeFlg)                              (* dgb: "26-Apr-84 09:19")
                                                             (* Flip nodes which are on path)
    (←Super
      self Recompute dontReshapeFlg)
    (for pathObj in (@ pathObjects) do (← self FlipNode pathObj))
    self])

(SupersBrowser.GetSubs
  [LAMBDA (self object objName)                              (* dgb: "28-MAR-83 11:53")
                                                             (* Returns local supers)
    (Supers object])
)
(DEFINEQ

(BoxWindowNode
  [LAMBDA (nodeLabel window)                                 (* dgb: "26-Apr-84 09:34")

          (* Puts a box around the node with nodeLabel in the graph. A nodeLabel in browsers is an object.
	  Does nothing if node not found.)


    (PROG (node nodes)
          (COND
	    ((AND (WINDOWP window)
		  [SETQ nodes (fetch GRAPHNODES of (WINDOWPROP window (QUOTE GRAPH]
		  (SETQ node (FASSOC nodeLabel nodes)))
	      (DRAWAREABOX (fetch XCOORD of (fetch NODELEFT of node))
			   (fetch YCOORD of (fetch NODEBOTTOM of node))
			   (fetch NODEWIDTH of node)
			   (fetch NODEHEIGHT of node)
			   1
			   (QUOTE INVERT)
			   window])

(Browse
  [LAMBDA (classes title goodClasses)                        (* dgb: "12-DEC-83 10:13")
    (←New
      ($ ClassBrowser)
      Show classes title (COND
	((EQ goodClasses T)
	  classes)
	(T goodClasses])

(DoMenuMethod
  [LAMBDA (object items)                                     (* edited: "13-NOV-83 16:20")
    (PROG [(selector (AND items (DualMenu items]
          (AND selector (RETURN (←!
				  object selector])

(DualMenu
  [LAMBDA (items whenHeldFn)                                 (* dgb: " 9-FEB-84 16:17")
                                                             (* creates and pops up a menu which allows differential 
							     selection on left an middle buttons)
    (MENU (create MENU
		  ITEMS ← items
		  WHENSELECTEDFN ←(QUOTE SubItemSelection)
		  SUBITEMFN ←(QUOTE DualSubItems)
		  WHENHELDFN ← whenHeldFn
		  CHANGEOFFSETFLG ← T])

(DualSelection
  [LAMBDA (item menu button)                                 (* dgb: "29-MAR-83 17:57")

          (* A menu WHENSELECTEDFN which allows differential selection on left and middle button. For such differential 
	  selection item should be of form -
	  (itemSeenInMenu (leftValue midValue)) -
	  where midValue can be an atom which is directly returned when item is selected with middle, or midValue can be an 
	  itemList, which will be displayed in a subselection menu)


    (PROG (it it1)
          (RETURN (COND
		    ((NLISTP item)
		      item)
		    ((NLISTP (SETQ it (CADR item)))
		      it)
		    ((EQ (SETQ it1 (CAR it))
			 (QUOTE QUOTE))
		      (CADR it))
		    ((EQ it1 (QUOTE PROGN))
		      (EVAL it))
		    ((EQ button (QUOTE LEFT))
		      (COND
			((LISTP it1)
			  (EVAL it1))
			(T it1)))
		    ((NLISTP (SETQ it1 (CADR it)))
		      it1)
		    (T (DualMenu it1])

(DualSubItems
  [LAMBDA (menu item)                                        (* dgb: "13-DEC-83 21:07")

          (* A menu WHENSELECTEDFN which allows differential selection on left and middle button. For such differential 
	  selection item should be of form -
	  (itemSeenInMenu (leftValue midValue)) -
	  where midValue can be an atom which is directly returned when item is selected with middle, or midValue can be an 
	  itemList, which will be displayed in a subselection menu)


    (PROG (it it1)
          (RETURN (COND
		    ([OR (NLISTP item)
			 (NLISTP (SETQ it (CADR item)))
			 (EQ (SETQ it1 (CAR it))
			     (QUOTE QUOTE))
			 (EQ it1 (QUOTE PROGN))
			 (NLISTP (SETQ it1 (CADR it]
		      NIL)
		    (T it1])

(FILECLASSES
  [LAMBDA (FILE)                                             (* dgb: "13-DEC-83 09:32")
    (FILECOMSLST FILE (QUOTE CLASSES])

(FileBrowse
  [LAMBDA (fileName)                                         (* dgb: "17-Apr-84 22:37")
    (←New
      ($ FileBrowser)
      File fileName])

(FindSelectedNode
  [LAMBDA (WINDOW)                                           (* dgb: "15-Feb-84 14:08")

          (* Used in BUTTONEVENTFN and gets called whenever cursor moves or button is down. Adapted from APPLYTOSELECTEDNODE
	  in GRAPHER package; returns the selected item rather than applying a function on the inside of the button event 
	  fn.)


    (PROG ((loopsWindow (WINDOWPROP WINDOW (QUOTE LoopsWindow)))
	   [NODELST (fetch (GRAPH GRAPHNODES) of (WINDOWPROP WINDOW (QUOTE GRAPH]
	   (DS (WINDOWPROP WINDOW (QUOTE DSP)))
	   BUTTON OLDPOS REG NOW NEAR)                       (* note which button is down.)
                                                             (* get the region of this window.)
          (SETQ REG (WINDOWPROP WINDOW (QUOTE REGION)))
          (until (LASTMOUSESTATE (OR LEFT MIDDLE)) do (GETMOUSESTATE))
          [SETQ NEAR (NODELST/AS/MENU NODELST (SETQ OLDPOS (CURSORPOSITION NIL DS]
      FLIP(AND NOW (← loopsWindow FlipNode (fetch NODEID of NOW)))
          (AND NEAR (← loopsWindow FlipNode (fetch NODEID of NEAR)))
          (SETQ NOW NEAR)
      LP                                                     (* wait for a button up or move out of region)
          (GETMOUSESTATE)
          (COND
	    ((NOT (LASTMOUSESTATE (OR LEFT MIDDLE)))         (* button up, process it.)
	      (AND NOW (← loopsWindow FlipNode (fetch NODEID of NOW)))
                                                             (* NOW node has been selected.)
	      (RETURN (fetch NODEID of NOW)))
	    ((NOT (INSIDE? (WINDOWPROP WINDOW (QUOTE REGION))
			   LASTMOUSEX LASTMOUSEY))           (* outside of region, return)
	      (AND NOW (← loopsWindow FlipNode (fetch NODEID of NOW)))
	      (RETURN))
	    ([EQ NOW (SETQ NEAR (NODELST/AS/MENU NODELST (CURSORPOSITION NIL DS OLDPOS]
	      (GO LP))
	    (T (GO FLIP])

(GetMethodArgs
  [LAMBDA (fn)                                               (* dgb: " 4-Jun-84 17:38")
    (COND
      ([NOT (FMEMB fn (QUOTE (← ←Super ←New ←Proto SEND]
	NIL)
      (T (PROG (items sel meth evalObj obj class arglist (actuals (TTYIN.READ?=ARGS)))
	       (SETQ obj (CAR actuals))                      (* Fix up atoms starting with @ and $)
	       (AND (LITATOM obj)
		    (Fix@$ obj actuals)
		    (SETQ obj (CAR actuals)))
	       [SETQ evalObj (OR (Object? obj)
				 (AND (EQ (QUOTE $)
					  (CAR (LISTP obj)))
				      (GetObjectRec (CADR obj]
	       (OR [SETQ class (COND
		       ((EQ fn (QUOTE ←New))
			 evalObj)
		       (T (OR (AND evalObj (Class evalObj))
			      (GetClassRec (OR (PromptRead (CONCAT (CHARACTER 7)
								   
							     "
Please type in name of class for "
								   obj 
						"
or type ] to evaluate expression to find class"))
					       (Class (EVAL obj)))
					   T]
		   (RETURN NIL))
	       (OR (SETQ sel (CADR actuals))
		   (AND [SETQ sel (MENU (create MENU
						ITEMS ←(SETQ items (← class List (QUOTE Selectors)))
						MENUCOLUMNS ←(ADD1 (IQUOTIENT (ITIMES (FONTHEIGHT
											MENUFONT)
										      (LENGTH items))
									      750]
			(BKSYSBUF sel))
		   (RETURN NIL))
	       (COND
		 ((SETQ meth (FetchMethod class sel))
		   (SETQ arglist (ARGLIST meth))
		   (TTYIN.PRINTARGS (QUOTE ←)
				    (CONS (CAR arglist)
					  (CONS (QUOTE Method)
						(CDR arglist)))
				    (CONS obj (CONS meth (CDDR actuals)))
				    0)
		   (RETURN T)))
	       (RETURN NIL])

(LatticeBrowser.ButtonFn
  [LAMBDA (window)                                           (* dgb: " 1-May-84 09:24")

          (* * Invoked when a mouse button is depressed in the LatticeBrowser window.)


    (COND
      ((KEYDOWNP (QUOTE CTRL))
	(PROG ((oldMode (DSPOPERATION NIL window)))
	      (GETMOUSESTATE)                                (* Here to move a node.)
	      (DSPOPERATION (QUOTE INVERT)
			    window)
	      (EDITMOVENODE window)
	      (DSPOPERATION oldMode window)))
      ((NULL (INSIDEP (DSPCLIPPINGREGION NIL window)
		      (LASTMOUSEX window)
		      (LASTMOUSEY window)))                  (* In the title region)
	(← (WINDOWPROP window (QUOTE LatticeBrowser))
	   TitleSelection))
      (T (APPLYTOSELECTEDNODE window])

(LatticeBrowser.WhenHeldFn
  [LAMBDA (item menu key)                                    (* dgb: " 1-May-84 09:30")
                                                             (* Prints documentation for the method, either from the 
							     item list of from the class of object or latticeBrowser,
							     bound above)
    (DECLARE (SPECVARS object latticeBrowser))
    (PROMPTPRINT (COND
		   [(LITATOM item)                           (* Get method documentation from object or browser)
		     (COND
		       ((← object Understands item)
			 (GetMethod (Class object)
				    item
				    (QUOTE doc)))
		       (T (GetMethod (Class latticeBrowser)
				     item
				     (QUOTE doc]
		   ((AND (LISTP item)
			 (CDDR item))
		     (CADDR item))
		   (T "When released this item will be selected"])

(LispxSend
  [NLAMBDA (MSGFORM)                                         (* dgb: "11-May-84 11:24")
                                                             (* Send a message given, recording on history, protected
							     form errors I can't remember why we put in the RELSTK)
    (PROG ((\INSIDE.TTYIN))
          (DECLARE: (SPECVARS MSGFORM))
          (ERSETQ (LISPXEVAL MSGFORM))
          (AND (RELSTK (STKPOS (QUOTE DEDITL)))
	       (ERROR!])

(SavedValue
  [LAMBDA NIL                                                (* dgb: "18-Apr-84 13:36")
                                                             (* Function Comment)
    (GetValue (← ($ LoopsIcon)
		 Prototype)
	      (QUOTE savedValue])

(SendInTtyProcess
  [LAMBDA (obj selector args)                                (* dgb: " 1-May-84 09:52")
                                                             (* Used to invoke method in TTY process.
							     Called by DoSelectedCommand and by TitleFn)
    (EVAL.IN.TTY.PROCESS (BQUOTE (LispxSend (← , obj , selector ., (for x in args
								      collect (COND
										((Object? x)
										  x)
										(T (KWOTE x])

(SubItemSelection
  [LAMBDA (item menu button)                                 (* dgb: "13-DEC-83 21:03")

          (* A menu WHENSELECTEDFN which allows differential selection on left and middle button. For such differential 
	  selection item should be of form -
	  (itemSeenInMenu (leftValue midValue)) -
	  where midValue can be an atom which is directly returned when item is selected with middle, or midValue can be an 
	  itemList, which will be displayed in a subselection menu)


    (PROG (it it1)
          (RETURN (COND
		    ((NLISTP item)
		      item)
		    ((NLISTP (SETQ it (CADR item)))
		      it)
		    ((EQ (SETQ it1 (CAR it))
			 (QUOTE QUOTE))
		      (CADR it))
		    ((EQ it1 (QUOTE PROGN))
		      (EVAL it))
		    ((LISTP it1)
		      (EVAL it1))
		    (T it1])

(TreeRoots
  [LAMBDA (nodeLst)                                          (* dgb: "16-May-84 19:11")
                                                             (* Computes the set of root nodes for a lattice -- those
							     with no connections TO them in list of nodes.)
    (for ND in nodeLst
       bind (firstElt ←(CAAR nodeLst))
	    (ROOTLST ←(MAPCAR nodeLst (FUNCTION CAR)))
       do (for D in (TOLINKS ND) do (SETQ ROOTLST (DREMOVE D ROOTLST)))
       finally (RETURN (OR ROOTLST (LIST firstElt])
)

(RPAQQ BrowserMargin 20)

(RPAQQ MaxLatticeHeight 750)

(RPAQQ MaxLatticeWidth 900)

(RPAQQ NestedMenuFlg T)
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML LispxSend)

(ADDTOVAR LAMA )
)
(PUTPROPS LOOPSBROWSE COPYRIGHT ("Xerox Corporation" 1983 1984))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (19942 67677 (ClassBrowser.AddNewCV 19952 . 20862) (ClassBrowser.AddNewIV 20864 . 21684)
 (ClassBrowser.AddSuper 21686 . 22317) (ClassBrowser.BoxNode 22319 . 22584) (ClassBrowser.CVDoc 22586
 . 23312) (ClassBrowser.ClassDoc 23314 . 23761) (ClassBrowser.CopyTo 23763 . 25229) (
ClassBrowser.DefineSubclass 25231 . 25821) (ClassBrowser.DeleteCV 25823 . 26082) (
ClassBrowser.DeleteClass 26084 . 26342) (ClassBrowser.DeleteClassItem 26344 . 27668) (
ClassBrowser.DeleteFromBrowser 27670 . 27971) (ClassBrowser.DeleteIV 27973 . 28232) (
ClassBrowser.DeleteMethod 28234 . 28505) (ClassBrowser.DestroyAndRecompute 28507 . 28911) (
ClassBrowser.FindWhere 28913 . 29756) (ClassBrowser.GetMethodDoc 29758 . 30189) (ClassBrowser.GetSubs 
30191 . 30620) (ClassBrowser.IVDoc 30622 . 31338) (ClassBrowser.LeftShiftSelect 31340 . 31612) (
ClassBrowser.MoveTo 31614 . 33510) (ClassBrowser.NewItem 33512 . 34039) (ClassBrowser.Recompute 34041
 . 34384) (ClassBrowser.RenameCV 34386 . 35031) (ClassBrowser.RenameClass 35033 . 35459) (
ClassBrowser.RenameIV 35461 . 36110) (ClassBrowser.RenameMeth 36112 . 36759) (ClassBrowser.RenamePart 
36761 . 38123) (ClassBrowser.SetItNew 38125 . 38428) (ClassBrowser.WhereIsCV 38430 . 38676) (
ClassBrowser.WhereIsIV 38678 . 38950) (ClassBrowser.WhereIsMethod 38952 . 39211) (
FileBrowser.DefineSubclass 39213 . 39860) (FileBrowser.EditComs 39862 . 40119) (FileBrowser.EditFns 
40121 . 40932) (FileBrowser.EditInstances 40934 . 41432) (FileBrowser.EditVars 41434 . 41858) (
FileBrowser.File 41860 . 42847) (FileBrowser.NewItem 42849 . 43652) (FileBrowser.Recompute 43654 . 
44075) (FileBrowser.SaveFile 44077 . 44350) (FileBrowser.SetItNew 44352 . 45000) (
InstanceBrowser.GetSubs 45002 . 45460) (InstanceBrowser.NewPath 45462 . 46077) (LatticeBrowser.AddRoot
 46079 . 46766) (LatticeBrowser.BoxNode 46768 . 47631) (LatticeBrowser.BrowserObjects 47633 . 48060) (
LatticeBrowser.ChangeFontSize 48062 . 48770) (LatticeBrowser.ChangeFormat 48772 . 49200) (
LatticeBrowser.Clear 49202 . 49558) (LatticeBrowser.DoSelectedCommand 49560 . 50495) (
LatticeBrowser.EEObject 50497 . 50737) (LatticeBrowser.EditObject 50739 . 50987) (
LatticeBrowser.FlashNode 50989 . 51366) (LatticeBrowser.FlipNode 51368 . 52226) (
LatticeBrowser.GetLabel 52228 . 52520) (LatticeBrowser.GetNodeList 52522 . 54298) (
LatticeBrowser.GetSubs 54300 . 54716) (LatticeBrowser.HasObject 54718 . 55110) (
LatticeBrowser.LeftSelection 55112 . 56607) (LatticeBrowser.LeftShiftSelect 56609 . 56903) (
LatticeBrowser.ListObjects 56905 . 57323) (LatticeBrowser.MiddleSelection 57325 . 58410) (
LatticeBrowser.MiddleShiftSelect 58412 . 58832) (LatticeBrowser.NewItem 58834 . 59260) (
LatticeBrowser.ObjNamePair 59262 . 60240) (LatticeBrowser.Recompute 60242 . 60673) (
LatticeBrowser.SaveInIT 60675 . 60962) (LatticeBrowser.ShapeToHold 60964 . 62594) (LatticeBrowser.Show
 62596 . 63958) (LatticeBrowser.SubBrowser 63960 . 64236) (LatticeBrowser.TitleSelection 64238 . 64744
) (LatticeBrowser.Unread 64746 . 64988) (MetaBrowser.GetSubs 64990 . 65439) (PathBrowser.AddAndBox 
65441 . 65731) (PathBrowser.AddToPath 65733 . 66213) (PathBrowser.Clear 66215 . 66528) (
PathBrowser.GetSubs 66530 . 66830) (PathBrowser.LeftShiftSelect 66832 . 67088) (PathBrowser.Recompute 
67090 . 67444) (SupersBrowser.GetSubs 67446 . 67675)) (67678 79019 (BoxWindowNode 67688 . 68410) (
Browse 68412 . 68630) (DoMenuMethod 68632 . 68857) (DualMenu 68859 . 69319) (DualSelection 69321 . 
70252) (DualSubItems 70254 . 71008) (FILECLASSES 71010 . 71157) (FileBrowse 71159 . 71320) (
FindSelectedNode 71322 . 73262) (GetMethodArgs 73264 . 74821) (LatticeBrowser.ButtonFn 74823 . 75588) 
(LatticeBrowser.WhenHeldFn 75590 . 76425) (LispxSend 76427 . 76903) (SavedValue 76905 . 77170) (
SendInTtyProcess 77172 . 77639) (SubItemSelection 77641 . 78458) (TreeRoots 78460 . 79017)))))
STOP