gevhrd.sl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. % GEVHRD.SL.4 07 April 83
  2. % derived from <NOVAK>GEVCRT.PSL.1 20-Mar-83 12:41:24
  3. (fluid '(n))
  4. (GLOBAL '(GEVMENUWINDOW GEVSAVEESC GEVSAVEGLQUIET GEVSAVEGCGAG GEVMOUSEAREA
  5. glquietflg gllispdialect gevtypenames gluserstrnames mouse terminal
  6. ))
  7. % TTY input replacement for mouse operations.
  8. % GSN 07 March 83
  9. (dg gevmouseloop ()
  10. (prog (input n tmp)
  11. lp (prin2 "GEV: ")
  12. (input _ (read))
  13. (if input='t and (n _ (read))
  14. is numeric then (gevnselect n nil)
  15. (go lp)
  16. elseif input is numeric
  17. then (gevnselect input t) (go lp)
  18. elseif (tmp _ (assoc input
  19. '((q quit)(pop pop)(e edit)(pr program)
  20. (p prop)(a adj)(i isa)(m msg))))
  21. then (gevcommandfn (cadr tmp))
  22. (if (cadr tmp)='quit or ~gevactiveflg
  23. then (return nil)
  24. else (go lp)))
  25. err (prin2 "? Quit POP Edit PRogram Prop Adj Isa Msg")
  26. (terpri)
  27. (go lp) ))
  28. (DE GEVENTER NIL
  29. (setq gevsavegcgag !*GC)
  30. (setq !*GC nil)
  31. (SETQ GEVSAVEGLQUIET GLQUIETFLG)
  32. (SETQ GLQUIETFLG T))
  33. (DE GEVEXIT NIL
  34. (setq !*GC gevsavegcgag)
  35. (SETQ GLQUIETFLG GEVSAVEGLQUIET))
  36. % edited: 19-Mar-83 22:41
  37. (DG GEVINITEDITWINDOW NIL
  38. (PROG NIL (GEVWINDOW _ (A WINDOW WITH START =
  39. (A VECTOR WITH X = 0 Y = 0)
  40. SIZE =
  41. (A VECTOR WITH X = 400 Y = 500)
  42. TITLE = "GEV Structure Inspector"))
  43. (RETURN GEVWINDOW)))
  44. % edited: 19-Mar-83 21:42
  45. % Select the Nth item in the display and push down to zoom in on it.
  46. (DG GEVNSELECT (N:INTEGER FLAG:BOOLEAN)
  47. (PROG (L TOP SUBLIST GROUP ITEM)
  48. (GROUP _ 0)
  49. (TOP _ GEVEDITCHAIN:TOPFRAME)
  50. LP
  51. (IF ~TOP THEN (RETURN NIL))
  52. (SUBLIST -_ TOP)
  53. (GROUP _+ 1)
  54. (IF GROUP=1 AND (L _ (LENGTH SUBLIST))
  55. >=N THEN (ITEM _ (CAR (PNth SUBLIST (L + 1 - N))))
  56. ELSEIF ~ (ITEM _ (GEVNTHITEM SUBLIST))
  57. THEN
  58. (GO LP))
  59. (IF ITEM:NODETYPE <= '(STRUCTURE SUBTREE LISTOF)
  60. THEN
  61. (RETURN NIL)
  62. ELSE
  63. (RETURN (GEVITEMEVENTFN ITEM GROUP FLAG)))))
  64. % edited: 19-Mar-83 22:15
  65. % Find the Nth item in a tree structure of items.
  66. (DG GEVNTHITEM (L: (LISTOF GSEITEM))
  67. (GLOBAL N:INTEGER)(PROG (TMP RES)
  68. (IF N<=0 THEN (ERROR 0 NIL)
  69. ELSEIF ~L THEN (RETURN NIL)
  70. ELSEIF N=1 THEN (RETURN (CAR L))
  71. ELSE
  72. (N _- 1)
  73. (TMP -_ L)
  74. (IF TMP:NODETYPE <= '(STRUCTURE SUBTREE LISTOF)
  75. AND
  76. (RES _ (GEVNTHITEM TMP:SUBVALUES))
  77. THEN
  78. (RETURN RES)
  79. ELSE
  80. (RETURN (GEVNTHITEM L))))))
  81. (GLISPCONSTANTS
  82. (GEVNUMBERCHARS 2 INTEGER)
  83. (GEVNUMBERPOS 1 INTEGER)
  84. )
  85. (SETQ GEVMENUWINDOW NIL)
  86. (SETQ GEVMOUSEAREA NIL)