home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / autocad / sdikit.arj / DEMO.LSP next >
Encoding:
Text File  |  1991-07-18  |  6.0 KB  |  258 lines

  1. (if (not (tblsearch "APPID" "_SDI_SPEED_KIT_1_"))
  2.   (progn
  3.      (xload "SDIKIT")
  4.   )
  5. )
  6. (setq _BLACK 0
  7.   _BLUE 1
  8.   _GREEN 2
  9.   _CYAN 3
  10.   _RED 4
  11.   _MAGENTA 5
  12.   _BROWN 6
  13.   _LIGHTGRAY 7
  14.   _DARKGRAY 8
  15.   _LIGHTBLUE 9
  16.   _LIGHTGREEN 10
  17.   _LIGHTCYAN 11
  18.   _LIGHTRED 12
  19.   _LIGHTMAGENTA 13
  20.   _YELLOW 14
  21.   _WHITE 15
  22.   _F1            15104
  23.   _F10           17408
  24.   _ESCKEY        283
  25.   _ENTER         7181
  26.   _CANCEL        11779
  27.   _SPACE         14624
  28. )
  29.  
  30. (defun c:textmenu(/ ret one two thr fou fiv six)
  31. (screenblue3)
  32. (nocursor)
  33. (setq a
  34. (textmenu
  35. " CHOOSE ONE OF THESE or F10 ESC CANCEL to exit " 3 ;<< Default is the third choice!
  36.   (list
  37.      (setq one "This is the FIRST choice!")
  38.      (setq two "This is the SECOND choice!")
  39.      (setq thr "This is the THIRD choice")
  40.      (setq fou "and the FOURTH")
  41.      (setq fiv "and the FIFTH choice....")
  42.      (setq six "AND so on and so on and so on ... ")
  43.   )
  44. ))
  45. (nocursor)
  46. (setcurs 1 1)
  47. (setq ret "You've selected \"");
  48. (cond
  49.   ((= a 1)
  50.      (setq ret(strcat ret one))
  51.   )
  52.   ((= a 2)
  53.      (setq ret(strcat ret two))
  54.   )
  55.   ((= a 3)
  56.      (setq ret(strcat ret thr))
  57.   )
  58.   ((= a 4)
  59.      (setq ret(strcat ret fou))
  60.   )
  61.   ((= a 5)
  62.      (setq ret(strcat ret fiv))
  63.   )
  64.   ((= a 6)
  65.      (setq ret(strcat ret six))
  66.   )
  67.   ((= a _F10)
  68.      (setq ret(strcat ret " the F10 key"))
  69.   )
  70.   ((= a _ESCKEY)
  71.      (setq ret(strcat ret " the ESCAPE key"))
  72.   )
  73.   ((= a _CANCEL)
  74.      (setq ret(strcat ret " the CANCEL key <ouch!> "))
  75.   )
  76.   (t nil)
  77. )
  78. (setq ret (strcat ret "\""))
  79. (message ret 0)
  80. (prin1)
  81. )
  82.  
  83. (defun screenblue1()
  84. (setcolors 
  85.   (list
  86.   _WHITE        ;forward text color
  87.   _BLUE         ;background color
  88.   _RED          ;border background color
  89.   _WHITE        ;border text color
  90.   _BLACK        ;hilited text color
  91.   _CYAN         ;hilited background color
  92.   )
  93. )
  94. (princ)
  95. )
  96.  
  97. (defun screenblue2()
  98. (setcolors 
  99.   (list
  100.   _WHITE                  ;forward text color
  101.   _BLUE ;<<--- FOR CLS    ;background color
  102.   _RED                    ;border background color
  103.   _GREEN                  ;border text color
  104.   _BLACK                  ;hilited text color
  105.   _CYAN                   ;hilited background color
  106.   )
  107. )
  108. (princ)
  109. )
  110.  
  111. (defun screenblack()
  112. (setcolors 
  113.   (list
  114.   _WHITE                  ;forward text color
  115.   _BLACK;<<--- FOR CLS    ;background color
  116.   _CYAN                   ;border background color
  117.   _RED                    ;border text color
  118.   _BLACK                  ;hilited text color
  119.   _BLUE                   ;hilited background color
  120.   )
  121. )
  122. (princ)
  123. )
  124.  
  125. (defun screenblue3()
  126. (setcolors 
  127.   (list
  128.   _WHITE                  ;forward text color
  129.   _BLUE ;<<--- FOR CLS    ;background color
  130.   _RED                    ;border background color
  131.   _WHITE                  ;border text color
  132.   _BLACK                  ;hilited text color
  133.   _CYAN                   ;hilited background color
  134.   )
  135. )
  136. (princ)
  137. )
  138.  
  139. (defun screengray()
  140. (setcolors 
  141.   (list
  142.   _WHITE                     ;forward text color
  143.   _BLACK            ;<<--- FOR CLS  ;background color
  144.   _BLUE                      ;border background color
  145.   _WHITE                     ;border text color
  146.   _BLACK                     ;hilited text color
  147.   _CYAN                      ;hilited background color
  148.   )
  149. )
  150. (princ)
  151. )
  152.  
  153. (defun c:cls()(cls)(prin1))
  154.  
  155. (defun c:drawwindow()
  156. (nocursor)
  157. (screenblue1)
  158. (cls)
  159. (window 10 5 70 20 0 1)
  160. (display 1 25 "Window with no height and single border >>")
  161. (grread)
  162. (screenblue2)
  163. (cls)
  164. (window 10 5 70 20 1 1)
  165. (display 1 25 "Window with height = 1 and single border >>")
  166. (grread)
  167. (screenblue1)
  168. (cls)
  169. (screenblue2)
  170. (window 10 5 70 20 2 1)
  171. (display 1 25 "Window with height = 2 and single border >>")
  172. (grread)
  173. (screenblue3)
  174. (cls)
  175. (screenblack)
  176. (setspeed 300)
  177. (window 10 5 70 20 1 1)
  178. (display 1 25 "Window with height = 1, single border and speed of 300 >>")
  179. (grread)
  180. (screenblue1)
  181. (cls)
  182. (screenblack)
  183. (setspeed 50)
  184. (window 5 4 75 21 1 2)
  185. (display 1 25 "Window with height = 1, double border and speed of 50 >>")
  186. (grread)
  187. (setspeed 0)
  188. (screenblue3)
  189. (prin1)
  190. )
  191.  
  192. (defun nested()
  193. (screenblue1)
  194. (cls)
  195. (screengray)
  196. (window 5 5 50 15 1 1)
  197. (window 8 8 53 18 1 1)
  198. (window 11 11 56 21 1 1)
  199. (window 14 14 59 24 1 1)
  200. (setcurs 1 1)
  201. (display 28 1             "NESTED WINDOWS ARE PRETTY!");
  202. )
  203.  
  204.  
  205. (defun c:quicktext()
  206. (window 10 5 70 20 1 1)
  207. (display 11 6  "THIS IS THE FIRST LINE OF TEXT TO BE DISPLAYED!")
  208. (display 11 7  "THIS IS THE SECOND LINE OF TEXT TO BE DISPLAYED!")
  209. (display 11 8  "THIS IS THE THIRD LINE OF TEXT TO BE DISPLAYED!")
  210. (display 11 9  "THIS IS THE FOURTH LINE OF TEXT TO BE DISPLAYED!")
  211. (display 11 10 "THIS IS THE FIFTH LINE OF TEXT TO BE DISPLAYED!")
  212. (display 11 11 "THIS IS THE SIXTH LINE OF TEXT TO BE DISPLAYED!")
  213. (display 11 12 "THIS IS THE SEVENTH LINE OF TEXT TO BE DISPLAYED!")
  214. (display 11 13 "THIS IS THE EIGHTH LINE OF TEXT TO BE DISPLAYED!")
  215. (display 11 14 "THIS IS THE NINTH LINE OF TEXT TO BE DISPLAYED!")
  216. (display 11 15 "THIS IS THE TENTH LINE OF TEXT TO BE DISPLAYED!")
  217. (display 11 16 "THIS IS THE ELEVENTH LINE OF TEXT TO BE DISPLAYED!")
  218. (display 11 17 "THIS IS THE TWELFTH LINE OF TEXT TO BE DISPLAYED!")
  219. (display 11 18 "THIS IS THE THIRTEENTH LINE OF TEXT TO BE DISPLAYED!")
  220. (display 11 19 "THIS IS THE FOURTEENTH LINE OF TEXT TO BE DISPLAYED!")
  221. (princ)
  222. )
  223.  
  224. (defun c:demo()
  225. (textscr)
  226. (save_video 0)
  227. (setspeed 0)
  228. (setvar "cmdecho" 0)
  229. (cls)
  230. (nocursor)
  231. (message "Welcome to SDI'S SPEED-KITS VOLUME I" 0)
  232. (message "Hit any key to show window possibilities" 0)
  233. (c:drawwindow)
  234. (cls)
  235. (nested)
  236. (nocursor)
  237. (message "Hit any key to show the text menuing possibilities" 0)
  238. (c:textmenu)
  239. (nocursor)
  240. (message "Watch this for speed...50 iterations!" 0)
  241. (screenblue2)
  242. (setspeed 0)
  243. (repeat 50
  244.   (c:quicktext)
  245. )
  246. (nocursor)
  247. (message "Now that was quick!" 0)
  248. (cls)
  249. ;(c:sdidemo)
  250. (nocursor)
  251. (restore_video 0)
  252. (c:sdidemo); <<-- This is the stuff you get when Registered!
  253. (message "Register today to receive the full library for only $35.00!" 1)
  254. (setcurs 1 23)
  255. (oncursor)
  256. (prin1)
  257. )
  258.