home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / devtools / files / lb202win.exe / LB202W.EXE / BUTTONS1.BAS < prev    next >
Encoding:
BASIC Source File  |  2000-12-09  |  1.8 KB  |  96 lines

  1.  
  2.     ' This is a turtle graphics demo for LB V2.0
  3.  
  4.     nomainwin ' open no main window
  5.  
  6.     size$ = "100"
  7.     size = val(size$)
  8.     color$ = "black"
  9.  
  10.     button #1, "Triangle", [triangle], LR, 170, 10
  11.     button #1, "Square", [square], LR, 90, 10
  12.     button #1, "Size", [size], LR, 25, 10
  13.     button #1, "Red", [colorRed], UL, 5, 5
  14.     button #1, "Blue", [colorBlue], UL, 46, 5
  15.     button #1, "Green", [colorGreen], UL, 95, 5
  16.     menu #1, &Colors, &red, [colorRed], &blue, [colorBlue], &green, [colorGreen]
  17.     menu #1, &Graph, &square, [square], &triangle, [triangle], &size, [size], |, &quit, [quit]
  18.     open "This is a turtle graphics window!" for graphics_nsb as #1
  19.  
  20.     print #1, "trapclose [quit]"
  21.  
  22.     'wait here for user interaction
  23.     wait
  24.  
  25.  
  26. [triangle]
  27.  
  28.     print #1, "color "; color$
  29.     print #1, "cls ; home ; down ; north"
  30.  
  31.     for x = 1 to size
  32.         print #1, "turn 122 ; go "; str$(x*2)
  33.     next x
  34.  
  35.     print #1, "flush"
  36.  
  37.     'wait here for user interaction
  38.     wait
  39.  
  40.  
  41. [square]
  42.  
  43.     print #1, "color "; color$
  44.     print #1, "cls ; home ; down ; north"
  45.  
  46.     for x = 1 to size
  47.         print #1, "turn 88 ; go "; str$(x*2)
  48.     next x
  49.  
  50.     print #1, "flush"
  51.  
  52.     'wait here for user interaction
  53.     wait
  54.  
  55.  
  56. [colorRed]
  57.  
  58.     color$ = "red"
  59.  
  60.     'wait here for user interaction
  61.     wait
  62.  
  63.  
  64. [colorBlue]
  65.  
  66.     color$ = "blue"
  67.  
  68.     'wait here for user interaction
  69.     wait
  70.  
  71.  
  72. [colorGreen]
  73.  
  74.     color$ = "green"
  75.  
  76.     'wait here for user interaction
  77.     wait
  78.  
  79. [size]
  80.  
  81.     prompt "What size figure?"; size$
  82.     size = val(size$)
  83.     if size > 0 then wait
  84.     beep
  85.     notice "Size must be > 0"
  86.     goto [size]
  87.  
  88.  
  89. [quit]
  90.     confirm "Do you want to quit Buttons?"; quit$
  91.     if quit$ = "no" then wait
  92.     close #1
  93.     end
  94.  
  95.  
  96.