gevcrt.sl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. % GEVCRT.SL.9 07 April 83
  2. % derived from <NOVAK>GEVCRT.PSL.1 20-Mar-83 12:41:24
  3. % Written by Gordon Novak Jr.
  4. % Copyright (c) Hewlett-Packard 1983
  5. (fluid '(n p))
  6. (GLOBAL '(GEVMENUWINDOW GEVSAVEESC GEVSAVEGLQUIET GEVSAVEGCGAG GEVMOUSEAREA
  7. glquietflg gllispdialect gevtypenames gluserstrnames mouse terminal
  8. ))
  9. (DE GEVENTER NIL
  10. (setq gevsavegcgag !*GC)
  11. (setq !*GC nil)
  12. (SETQ GEVSAVEGLQUIET GLQUIETFLG)
  13. (SETQ GLQUIETFLG T)
  14. (echooff))
  15. (DE GEVEXIT NIL
  16. (setq !*GC gevsavegcgag)
  17. (SETQ GLQUIETFLG GEVSAVEGLQUIET)
  18. (echoon))
  19. % edited: 19-Mar-83 22:41
  20. (DG GEVINITEDITWINDOW NIL
  21. (PROG NIL (GEVWINDOW _ (A WINDOW WITH START =
  22. (A VECTOR WITH X = 0 Y = 3)
  23. SIZE =
  24. (A VECTOR WITH X = 46 Y = 20)
  25. TITLE = "GEV Structure Inspector"))
  26. (RETURN GEVWINDOW)))
  27. % edited: 19-Mar-83 21:12
  28. % Wait in a loop for mouse actions within the edit window.
  29. (DG GEVMOUSELOOP NIL
  30. (PROG (INP N TMP)
  31. LP
  32. (SEND GEVWINDOW MOVETOXY 0 -1)
  33. (SEND TERMINAL ERASEEOL)
  34. (SEND GEVWINDOW MOVETOXY 0 -1)
  35. (SEND TERMINAL PRINTSTRING "GEV: ")
  36. (echoon)
  37. (INP _ (READ))
  38. (echooff)
  39. (SEND TERMINAL ERASEEOL)
  40. (IF INP=T AND (N _ (READ))
  41. IS NUMERIC THEN (GEVNSELECT N NIL)
  42. (GO LP)
  43. ELSEIF INP IS NUMERIC THEN (GEVNSELECT INP T)
  44. (GO LP)
  45. ELSEIF
  46. (TMP _ (ASSOC INP '((Q QUIT)
  47. (POP POP)
  48. (E EDIT)
  49. (PR PROGRAM)
  50. (P PROP)
  51. (A ADJ)
  52. (I ISA)
  53. (M MSG))))
  54. THEN
  55. (GEVCOMMANDFN (CADR TMP))
  56. (IF (CADR TMP)
  57. ='QUIT OR ~GEVACTIVEFLG THEN (SEND GEVWINDOW MOVETOXY 0 -1)
  58. (SEND TERMINAL ERASEEOL)
  59. (RETURN NIL)
  60. ELSE
  61. (GO LP))
  62. ELSEIF INP = 'R
  63. THEN
  64. (SEND GEVWINDOW OPEN)
  65. (GEVFILLWINDOW)
  66. (GO LP)
  67. ELSE
  68. (PRIN1 "? Quit POP Edit PRogram Prop Adj Isa Msg Redraw")
  69. (TERPRI)
  70. (GO LP))))
  71. % edited: 19-Mar-83 21:42
  72. % Select the Nth item in the display and push down to zoom in on it.
  73. (DG GEVNSELECT (N:INTEGER FLAG:BOOLEAN)
  74. (PROG (L TOP SUBLIST GROUP ITEM)
  75. (GROUP _ 0)
  76. (TOP _ GEVEDITCHAIN:TOPFRAME)
  77. LP
  78. (IF ~TOP THEN (RETURN NIL))
  79. (SUBLIST -_ TOP)
  80. (GROUP _+ 1)
  81. (IF GROUP=1 AND (L _ (LENGTH SUBLIST))
  82. >=N THEN (ITEM _ (CAR (PNth SUBLIST (L + 1 - N))))
  83. ELSEIF ~ (ITEM _ (GEVNTHITEM SUBLIST))
  84. THEN
  85. (GO LP))
  86. (IF ITEM:NODETYPE <= '(STRUCTURE SUBTREE LISTOF)
  87. THEN
  88. (RETURN NIL)
  89. ELSE
  90. (RETURN (GEVITEMEVENTFN ITEM GROUP FLAG)))))
  91. % edited: 19-Mar-83 22:15
  92. % Find the Nth item in a tree structure of items.
  93. (DG GEVNTHITEM (L: (LISTOF GSEITEM))
  94. (GLOBAL N:INTEGER)(PROG (TMP RES)
  95. (IF N<=0 THEN (ERROR 0 NIL)
  96. ELSEIF ~L THEN (RETURN NIL)
  97. ELSEIF N=1 THEN (RETURN (CAR L))
  98. ELSE
  99. (N _- 1)
  100. (TMP -_ L)
  101. (IF TMP:NODETYPE <= '(STRUCTURE SUBTREE LISTOF)
  102. AND
  103. (RES _ (GEVNTHITEM TMP:SUBVALUES))
  104. THEN
  105. (RETURN RES)
  106. ELSE
  107. (RETURN (GEVNTHITEM L))))))
  108. (GLISPCONSTANTS
  109. (GEVNUMBERCHARS 2 INTEGER)
  110. (GEVNUMBERPOS 1 INTEGER)
  111. )
  112. (SETQ GEVMENUWINDOW NIL)
  113. (SETQ GEVMOUSEAREA NIL)