home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / TIPI2A / HELPGRAF.TPI < prev    next >
Text File  |  1994-09-13  |  7KB  |  309 lines

  1. define menu
  2. # ( -- choice)
  3. # ( valid$ -- )
  4. # Returns the chosen key or 0 if the user escapes from this menu
  5.  0 cursor
  6.  ucase$
  7.  27 chr$ swap$ +$
  8.  begin
  9.   inkey$ ucase$ # valid$ key$
  10.   len instr *
  11.   dup
  12.   if dup drop$ endif drop$
  13.  until
  14.  1 -
  15.  1 cursor
  16. enddef
  17.  
  18. define wait
  19.  begin key until cls
  20. enddef
  21.  
  22.  begin cls
  23. |
  24. |   ╔════════════════════════════════════════════════╗
  25. |   ║ G R A P H I C S    I N S T R U C T I O N S     ║
  26. |   ╠══════════════╦═══════════════╦═════════════════╣
  27. |   ║              ║               ║                 ║
  28. |   ║ [A] DRAWLINE ║ [G] PLOTPOINT ║ [M] SETLINETYPE ║
  29. |   ║              ║               ║                 ║
  30. |   ║ [B] DRAWRECT ║ [H] PLOTTEXT  ║ [N] SETLOGORG   ║
  31. |   ║              ║               ║                 ║
  32. |   ║ [C] GETFONT  ║ [I] SCREEN    ║ [O] SETPENCOLOR ║
  33. |   ║              ║               ║                 ║
  34. |   ║ [D] GETPOINT ║ [J] SCROLL    ║ [P] SETREPRULE  ║
  35. |   ║              ║               ║                 ║
  36. |   ║ [E] MOVEPEN  ║ [K] SETCLIP   ║ [Q] SETVMODE    ║
  37. |   ║              ║               ║                 ║
  38. |   ║ [F] PLOTICON ║ [L] SETFONT   ║ [R] ZOOM        ║
  39. |   ╚══════════════╩═══════════════╩═════════════════╝
  40.  "abcdefghijklmnopqr" menu dup cls
  41.  case 0 of endof
  42.       1 of
  43. |
  44. |   DRAWLINE
  45. |
  46. |   Data Stack:          row col --
  47. |   String Stack:                --
  48. |
  49. |   Draws a line from the current pen location to
  50. |   row, col.
  51. |
  52.         wait
  53.         endof
  54.       2 of
  55. |
  56. |   DRAWRECT
  57. |
  58. |   Data Stack:        fill row col --
  59. |   String Stack:                   --
  60. |
  61. |   Draws a rectangle from the current pen location
  62. |   to row, col. If fill is 1 the rectangle is drawn
  63. |   filled. If not the rectangle will be drawn
  64. |   unfilled.
  65. |
  66.         wait
  67.         endof
  68.       3 of
  69. |
  70. |   GETFONT
  71. |
  72. |   Data Stack:           height width -- HiFontID LoFontID
  73. |   String Stack:                      --
  74. |
  75. |   Returns the font ID of a font whose characters
  76. |   are height * width pixels.
  77. |
  78.         wait
  79.         endof
  80.       4 of
  81. |
  82. |   GETPOINT
  83. |
  84. |   Data Stack:                row col -- color
  85. |   String Stack:                      --
  86. |
  87. |   Returns the color of the point at row, col.
  88. |
  89.         wait
  90.         endof
  91.       5 of
  92. |
  93. |   MOVEPEN
  94. |
  95. |   Data Stack:                row col --
  96. |   String Stack:                      --
  97. |
  98. |   Moves the pen to row col.
  99. |
  100.         wait
  101.         endof
  102.       6 of
  103. |
  104. |   PLOTICON
  105. |
  106. |   Data Stack:            rule row col --
  107. |   String Stack:                 icon$ --
  108. |
  109. |   Plots an HP icon (.icn) file at location row,
  110. |   col according to rule. The screen should have
  111. |   been set to a graphics mode and row and col are
  112. |   given in pixels. Row and col are the locations
  113. |   of the top left corner of the icon and rule
  114. |   should be set according to the following table.
  115. |
  116. |   0 FORCE
  117. |   1 AND
  118. |   2 OR
  119. |   3 XOR
  120. |   4 Invert the image and then FORCE
  121. |   5 Invert the image and then AND
  122. |   6 Invert the image and then OR
  123. |   7 Invert the image and then XOR
  124. |
  125.         wait
  126.         endof
  127.       7 of
  128. |
  129. |   PLOTPOINT
  130. |
  131. |   Data Stack:                  row col --
  132. |   String Stack:                        --
  133. |
  134. |   Plots a point at row, col.
  135. |
  136.         wait
  137.         endof
  138.       8 of
  139. |
  140. |   PLOTTEXT
  141. |
  142. |   Data Stack:             Rflag Row Col --
  143. |   String Stack:                   Text$ --
  144. |
  145. |   Plots Text$ at Row, Col in the current font. If
  146. |   Rflag is 0, text is plotted horizontally. If
  147. |   Rflag is 1, text is rotatated 90 degrees.
  148. |
  149.         wait
  150.         endof
  151.       9 of
  152. |
  153. |   SCREEN
  154. |
  155. |   Data Stack:               Mode --
  156. |   String Stack:                  --
  157. |
  158. |   Sets the screen mode of a PC according to Mode.
  159. |   The following table gives values for mode.
  160. |
  161. |   Mode  Graphics Res.   Text Res.   Adapters
  162. |   ----  -------------   ---------   --------
  163. |    0    None            25*80*16    Any
  164. |    1    200*320*4       25*40*4     CGA/EGA/VGA
  165. |    2    200*640*2       25*80*2     CGA/EGA/VGA
  166. |    7    200*320*16      25*40*16    EGA/VGA
  167. |    9    350*640*16      25*80*16    EGA/VGA
  168. |    13   200*320*256     25*40*16    VGA
  169. |
  170.         wait
  171.         endof
  172.      10 of
  173. |
  174. |   SCROLL
  175. |
  176. |   Data Stack:        Dir Row Col Color Distance --
  177. |   String Stack:                                 --
  178. |
  179. |   Scrolls a rectangular region of the screen.
  180. |   The region is defined from the current pen
  181. |   position to Row, Col. Distance is the number
  182. |   of pixels to scroll. Dir controls the direction
  183. |   of the scroll and Color controls whether bits
  184. |   scrolled "in" are set or cleared.
  185. |
  186.         wait
  187.         endof
  188.      11 of
  189. |
  190. |   SETCLIP
  191. |
  192. |   Data Stack:       MinRow MinCol MaxRow MaxCol --
  193. |   String Stack:                                 --
  194. |
  195. |   Sets the graphics clipping region.
  196. |
  197.         wait
  198.         endof
  199.      12 of
  200. |
  201. |   SETFONT
  202. |
  203. |   Data Stack:       HiFontID LoFontID --
  204. |   String Stack:                       --
  205. |
  206. |   Sets a font for use in graphics modes.
  207. |
  208.         wait
  209.         endof
  210.      13 of
  211. |
  212. |   SETLINETYPE
  213. |
  214. |   Data Stack:             Type --
  215. |   String Stack:                --
  216. |
  217. |   Sets a line type for graphics plotting.
  218. |
  219.         wait
  220.         endof
  221.      14 of
  222. |
  223. |   SETLOGORG
  224. |
  225. |   Data Stack:            Row Col --
  226. |   String Stack:                  --
  227. |
  228. |   Sets the logical origin to Row, Col. The logical
  229. |   coordinates are set off the actual physical
  230. |   screen. Any future coordinate operations are
  231. |   given relative to the logical origin. SETLOGORG
  232. |   resets the CLIP REGION to the entire physical
  233. |   screen.
  234. |
  235.         wait
  236.         endof
  237.      15 of
  238. |
  239. |   SETPENCOLOR
  240. |
  241. |   Data Stack:              Color --
  242. |   String Stack:                  --
  243. |
  244. |   Sets the pen color for graphics drawing commands.
  245. |
  246.         wait
  247.         endof
  248.      16 of
  249. |
  250. |   SETREPRULE
  251. |
  252. |   Data Stack:               Rule --
  253. |   String Stack:                  --
  254. |
  255. |   Sets the graphics replacement rule according to
  256. |   the following table:
  257. |
  258. |      0 = FORCE
  259. |      1 = AND
  260. |      2 = OR
  261. |      3 = XOR
  262. |      8 = FORCETEXT
  263. |
  264.         wait
  265.         endof
  266.      17 of
  267. |
  268. |   SETVMODE
  269. |
  270. |   Data Stack:              Mode --
  271. |   String Stack:                 --
  272. |
  273. |   Sets the current video mode to alpha or graphics
  274. |   and clears the display. Mode should be set
  275. |   according to the following table:
  276. |
  277. |      3  = CGA alpha mode
  278. |      6  = CGA graphics mode 640*200
  279. |      7  = HP95LX alpha
  280. |      32 = HP95LX graphics
  281. |
  282.         wait
  283.         endof
  284.      18 of
  285. |
  286. |   ZOOM
  287. |
  288. |   Data Stack:             Z --
  289. |   String Stack:             --
  290. |
  291. |   Changes the zoom mode of the HP100LX. Z should
  292. |   be set according to the following table:
  293. |
  294. |      2   = 80*25 BW
  295. |      3   = 80*25 Color
  296. |      7   = 40*16 BW Zoomed
  297. |      33  = 80*25 BW
  298. |      128 = 64*18 BW Zoomed
  299. |      129 = 64*18 Color Zoomed
  300. |      130 = 40*25 BW Zoomed
  301. |      131 = 40*25 Color Zoomed
  302. |      132 = 40*16 BW Zoomed
  303. |      133 = 40*16 Color Zoomed
  304. |
  305.         wait
  306.         endof
  307.   endcase
  308.  not until
  309.