(FILECREATED "20-Apr-87 12:54:42" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH242.;1 8968   

      changes to:  (VARS RHTPATCH242COMS)
		   (FNS NC.BrowserShrinkLabelFn NC.BrowserGrowLabelFn))


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

(PRETTYCOMPRINT RHTPATCH242COMS)

(RPAQQ RHTPATCH242COMS ((* * Fix to bug #524: Delete card&Node in empty browser causes break. Fixed 
			     all its relatives in the same way.)
			  (DECLARE: FIRST (P (LOAD? (NC.FindFile (QUOTE NCBROWSERCARD)))))
			  (* * Changes to NCBROWSERCARD)
			  (FNS NC.BrowserDeleteCardFn NC.BrowserRemoveNodeFn NC.BrowserDeleteLinkFn 
			       NC.BrowserRemoveEdgeFn NC.BrowserMoveNodeFn 
			       NC.BrowserMoveNodesInRegionFn NC.BrowserMoveSubtreeFn 
			       NC.BrowserCreateLinkFn NC.BrowserCreateGlobalLinkFn 
			       NC.BrowserAddEdgeFn NC.BrowserShrinkLabelFn NC.BrowserGrowLabelFn)))
(* * Fix to bug #524: Delete card&Node in empty browser causes break. Fixed all its relatives 
in the same way.)

(DECLARE: FIRST 
(LOAD? (NC.FindFile (QUOTE NCBROWSERCARD)))
)
(* * Changes to NCBROWSERCARD)

(DEFINEQ

(NC.BrowserDeleteCardFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:35")

          (* * Called from graph edit menu to delete card and node.)



          (* * rht 4/20/87: No longer calls NC.BrowserRemoveNode if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (replace (GRAPH GRAPH.DELETENODEFN) of Graph with NIL)
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (NC.BrowserRemoveNode Graph Window T)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't delete card/node: graph has no nodes.")))))

(NC.BrowserRemoveNodeFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:35")

          (* * Called from graph edit menu to delete a browser node.)



          (* * rht 4/20/87: No longer calls NC.BrowserRemoveNode if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (replace (GRAPH GRAPH.DELETENODEFN) of Graph with NIL)
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (NC.BrowserRemoveNode Graph Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't remove node: graph has no nodes.")))))

(NC.BrowserDeleteLinkFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:39")

          (* * Called from graph edit menu to delete link and edge.)



          (* * rht 4/20/87: No longer calls EDITMOVENODE if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITAPPLYTOLINK (FUNCTION NC.BrowserDeleteLink)
				       (QUOTE deleted)
				       (WINDOWPROP Window (QUOTE GRAPH))
				       Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't delete link/edge: graph has no nodes.")))))

(NC.BrowserRemoveEdgeFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:39")

          (* * Called from graph edit menu to remove browser edge.)



          (* * rht 4/20/87: No longer calls EDITAPPLYTOLINK if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITAPPLYTOLINK (FUNCTION NC.BrowserRemoveEdge)
				       (QUOTE removed)
				       (WINDOWPROP Window (QUOTE GRAPH))
				       Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't remove edges: graph has no nodes.")))))

(NC.BrowserMoveNodeFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:36")

          (* * Move a browser node)



          (* * rht 4/20/87: No longer calls EDITMOVENODE if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITMOVENODE Window)
		    (NC.MarkCardDirty (NC.CoerceToCard Window))
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't move nodes: graph has no nodes.")))))

(NC.BrowserMoveNodesInRegionFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:45")

          (* * Move all the browser nodes in a region.)



          (* * rht 4/20/87: No longer calls EDITMOVEREGION if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITMOVEREGION Window)
		    (NC.MarkCardDirty (NC.CoerceToCard Window))
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't move nodes: graph has no nodes.")))))

(NC.BrowserMoveSubtreeFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:45")

          (* * Move a browser node and all its descendents.)



          (* * rht 4/20/87: No longer calls EDITMOVESUBTREE if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITMOVESUBTREE Window)
		    (NC.MarkCardDirty (NC.CoerceToCard Window))
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't move nodes: graph has no nodes.")))))

(NC.BrowserCreateLinkFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:49")

          (* * Called from graph edit menu to create link and edge.)



          (* * rht 4/20/87: No longer calls EDITAPPLYTOLINK if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITAPPLYTOLINK (FUNCTION NC.BrowserAddLink)
				       (QUOTE added)
				       (WINDOWPROP Window (QUOTE GRAPH))
				       Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't create links: graph has no nodes.")))))

(NC.BrowserCreateGlobalLinkFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:50")

          (* * Called from graph edit menu to create a global link and edge.)



          (* * rht 4/20/87: No longer calls EDITAPPLYTOLINK if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITAPPLYTOLINK (FUNCTION NC.BrowserAddGlobalLink)
				       (QUOTE added)
				       (WINDOWPROP Window (QUOTE GRAPH))
				       Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't create global links: graph has no nodes.")))))

(NC.BrowserAddEdgeFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:51")

          (* * Called from graph edit menu to create edge.)



          (* * rht 4/20/87: No longer calls EDITAPPLYTOLINK if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITAPPLYTOLINK (FUNCTION NC.BrowserAddEdge)
				       (QUOTE added)
				       (WINDOWPROP Window (QUOTE GRAPH))
				       Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't add edges: graph has no nodes.")))))

(NC.BrowserShrinkLabelFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:52")

          (* * Shrink a browser label font.)



          (* * rht 4/20/87: No longer calls EDITCHANGEFONT if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITCHANGEFONT (QUOTE SMALLER)
				      Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't shrink label: graph has no nodes.")))))

(NC.BrowserGrowLabelFn
  (LAMBDA (Window)                                           (* rht: "20-Apr-87 12:52")

          (* * Increase a browser label font.)



          (* * rht 4/20/87: No longer calls EDITCHANGEFONT if graph has no nodes.)


    (LET ((Graph (WINDOWPROP Window (QUOTE GRAPH))))
         (if (fetch (GRAPH GRAPHNODES) of Graph)
	     then (EDITCHANGEFONT (QUOTE LARGER)
				      Window)
	   else (FLASHW PROMPTWINDOW)
		  (NC.PrintMsg NIL T "Can't expand label: graph has no nodes.")))))
)
(PUTPROPS RHTPATCH242 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1108 8886 (NC.BrowserDeleteCardFn 1118 . 1781) (NC.BrowserRemoveNodeFn 1783 . 2440) (
NC.BrowserDeleteLinkFn 2442 . 3139) (NC.BrowserRemoveEdgeFn 3141 . 3836) (NC.BrowserMoveNodeFn 3838 . 
4418) (NC.BrowserMoveNodesInRegionFn 4420 . 5033) (NC.BrowserMoveSubtreeFn 5035 . 5649) (
NC.BrowserCreateLinkFn 5651 . 6342) (NC.BrowserCreateGlobalLinkFn 6344 . 7063) (NC.BrowserAddEdgeFn 
7065 . 7741) (NC.BrowserShrinkLabelFn 7743 . 8313) (NC.BrowserGrowLabelFn 8315 . 8884)))))
STOP