home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lb091.zip / BUTTONS.BAS < prev    next >
BASIC Source File  |  1995-09-27  |  2KB  |  82 lines

  1.  
  2.     ' This is a turtle graphics demo,
  3.     ' this new version shows how to custom size buttons
  4.  
  5.     size$ = "100"
  6.     size = val(size$)
  7.     color$ = "black"
  8.  
  9.     button #1, Triangle, [triangle], LR, 230, 15, 65, 20
  10.     button #1, Square, [square], LR, 160, 15, 55, 20
  11.     button #1, Size, [size], LR, 100, 15, 45, 20
  12.     button #1, Quit, [quit], LR, 50, 15, 45, 20
  13.     button #1, Red, [colorRed], UL, 5, 5, 45, 20
  14.     button #1, Blue, [colorBlue], UL, 55, 5, 45, 20
  15.     button #1, Green, [colorGreen], UL, 105, 5, 45, 20
  16.     open "This is a turtle graphics window!" for graphics as #1
  17.  
  18.     print"Press one of the buttons in the graphics window"
  19.  
  20. [loop]
  21.     input a$
  22.     goto [loop]
  23.  
  24.  
  25. [triangle]
  26.  
  27.     print #1, "color "; color$
  28.     print #1, "cls ; home ; down ; north"
  29.  
  30.     for x = 1 to size
  31.         print #1, "turn 122 ; go "; str$(x*2)
  32.     next x
  33.  
  34.     print #1, "flush"
  35.     goto [loop]
  36.  
  37.  
  38. [square]
  39.  
  40.     print #1, "color "; color$
  41.     print #1, "cls ; home ; down ; north"
  42.  
  43.     for x = 1 to size
  44.         print #1, "turn 88 ; go "; str$(x*2)
  45.     next x
  46.  
  47.     print #1, "flush"
  48.     goto [loop]
  49.  
  50.  
  51. [colorRed]
  52.  
  53.     color$ = "red"
  54.     goto [loop]
  55.  
  56.  
  57. [colorBlue]
  58.  
  59.     color$ = "blue"
  60.     goto [loop]
  61.  
  62.  
  63. [colorGreen]
  64.  
  65.     color$ = "green"
  66.     goto [loop]
  67.  
  68. [size]
  69.  
  70.     prompt "What size figure?"; size$
  71.     size = val(size$)
  72.     if size < 1 then beep : goto [size]
  73.     goto [loop]
  74.  
  75.  
  76. [quit]
  77.     confirm "Do you want to quit?"; quit$
  78.     if quit$ = "no" then [loop]
  79.     close #1
  80.     end
  81.  
  82.