home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 February / 1993-02.d64 / button.demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  164 lines

  1. 10 rem load and activate program:
  2. 20 if x=0 then x=1:load"button64.ml",8,1
  3. 30 sys 49152:poke 53280,0:poke 53281,15
  4. 40 rem setup screen and menus
  5. 50 printchr$(14)"[147][205][197][206][213][160][212][197][205][208][204][193][212][197]                           ";
  6. 60 print"[198]ile   [167][204]ayout [167][212]ools  [167][207]ptions         [146]";
  7. 70 print"     [144]^[157][221][157][157][157][195]lick on these to test menus."
  8. 80 print"[195]lick on these":print"to test buttons [144][192][192]>"
  9. 90 printtab(21)"[145][145][159][176][192][192][192][192][192][192][192][192][192][192][192][174]"
  10. 100 printtab(21)"[159][221][144][164][146] [194]utton #1[159][221]"
  11. 110 printtab(21)"[159][221][144][164][146] [194]utton #2[159][221]"
  12. 120 printtab(21)"[159][221][144][164][146] [194]utton #3[159][221]"
  13. 130 printtab(21)"[159][173][192][192][192][192][192][192][192][192][192][192][192][189]"
  14. 140 print"  [159][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  15. 150 print"  [159][221] [144]<[146][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][192][144]>[146] 15[159][221]"
  16. 160 print"  [159][173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][144]"
  17. 170 print"^[157][221][157][221][157][157][157][195]lick on this to test slider."
  18. 180 sl=15
  19. 190 sys 49653 : rem save screen to buffer
  20. 200 gosub 1570 : rem get a point
  21. 210 rem test for known points
  22. 220 if y<>1 then 270
  23. 230 if x<8 then 320:rem files
  24. 240 if x>7 and x<16 then 840:rem layout
  25. 250 if x>15 and x<24 then 990:rem tools
  26. 260 if x>23 then 1070:rem options
  27. 270 if x=22 and y=9 then 1150:rem b1
  28. 280 if x=22 and y=10 then 1230:rem b2
  29. 290 if x=22 and y=11 then 1310:rem b3
  30. 300 if y=17 then 1390 : rem slider
  31. 310 goto 190
  32. 320 rem file menu was chosen
  33. 330 print"[204]oad    [157][157][157][157][157][157][157][157][211]ave    [144] [157][157][157][157][157][157][157][157][157]";
  34. 340 print"[206]ew     [144] [157][157][157][157][157][157][157][157][157][196]ir     [144] [157][157][157][157][157][157][157][157][157]";
  35. 350 print"[209]uit    [144] [157][157][157][157][157][157][157][157][157]";
  36. 360 print"[144]        [146]"
  37. 370 gosub 1570
  38. 380 if x<1 or x>8 then 440
  39. 390 if y=2 then 450 : rem load routine
  40. 400 if y=3 then 520 : rem save routine
  41. 410 if y=4 then 590 : rem new routine
  42. 420 if y=5 then 660 : rem dir routine
  43. 430 if y=6 then 730 : rem quit routine
  44. 440 sys 49709 : goto 190
  45. 450 gosub 1500
  46. 460 print"[217]ou pressed the"
  47. 470 print"[204][207][193][196] routine."
  48. 480 print"[144] [195][207][206][212][201][206][213][197] "
  49. 490 gosub 1570
  50. 500 if y<>11 or x<19 or x>28 then 490
  51. 510 sys 49709:goto 190
  52. 520 gosub 1500
  53. 530 print"[217]ou pressed the"
  54. 540 print"[211][193][214][197] routine."
  55. 550 print"[144] [195][207][206][212][201][206][213][197] "
  56. 560 gosub 1570
  57. 570 if y<>11 or x<19 or x>28 then 490
  58. 580 sys 49709:goto 190
  59. 590 gosub 1500
  60. 600 print"[217]ou pressed the"
  61. 610 print"[206][197][215] routine."
  62. 620 print"[144] [195][207][206][212][201][206][213][197] "
  63. 630 gosub 1570
  64. 640 if y<>11 or x<19 or x>28 then 490
  65. 650 sys 49709:goto 190
  66. 660 gosub 1500
  67. 670 print"[217]ou pressed the"
  68. 680 print"[196][201][210] routine."
  69. 690 print"[144] [195][207][206][212][201][206][213][197] "
  70. 700 gosub 1570
  71. 710 if y<>11 or x<19 or x>28 then 490
  72. 720 sys 49709:goto 190
  73. 730 gosub 1500
  74. 740 print"[193]re you sure you"
  75. 750 print"want to quit the"
  76. 760 print"program?"
  77. 770 print"[144] [217][197][211]  [206][207] "
  78. 780 gosub 1570
  79. 790 if y<>11 then 780
  80. 800 if x>10 and x<16 then 830
  81. 810 if x>24 and x<29 then sys49709:goto 190
  82. 820 goto 780
  83. 830 sys 49633:poke 53280,14:poke 53281,6:print"[147][154]"chr$(142);:end
  84. 840 rem layout menu
  85. 850 print"[204]ayout 1[157][157][157][157][157][157][157][157][204]ayout 2[144] [157][157][157][157][157][157][157][157][157][204]ayout 3[144] ";
  86. 860 print"[157][157][157][157][157][157][157][157][157][204]ayout 4[144] [157][157][157][157][157][157][157][157][157][204]ayout 5[144] [157][157][157][157][157][157][157][157][157][204]ayout 6[144] ";
  87. 870 print"[157][157][157][157][157][157][157][157][157][204]ayout 7[144] [157][157][157][157][157][157][157][157][157][204]ayout 8[144] [157][157][157][157][157][157][157][157]        "
  88. 880 gosub 1570
  89. 890 if x<9 or x>16 then 980
  90. 900 if y<2 or y>9 then 980
  91. 910 l=y-1
  92. 920 gosub 1500
  93. 930 print"[204]ayout #"l
  94. 940 print"was selected."
  95. 950 print"[144] [195][207][206][212][201][206][213][197] "
  96. 960 gosub 1570
  97. 970 if y<>11 or x<19 or x>28 then 960
  98. 980 sys 49709:goto 190
  99. 990 rem tools menu
  100. 1000 gosub 1500
  101. 1010 print"[212]he [212]ools menu"
  102. 1020 print"was selected."
  103. 1030 print"[144] [195][207][206][212][201][206][213][197] "
  104. 1040 gosub 1570
  105. 1050 if y<>11 or x<19 or x>28 then 960
  106. 1060 sys 49709:goto 190
  107. 1070 rem options menu
  108. 1080 gosub 1500
  109. 1090 print"[212]he [207]ptions menu"
  110. 1100 print"was selected."
  111. 1110 print"[144] [195][207][206][212][201][206][213][197] "
  112. 1120 gosub 1570
  113. 1130 if y<>11 or x<19 or x>28 then 960
  114. 1140 sys 49709:goto 190
  115. 1150 rem button #1 was pressed
  116. 1160 gosub 1500
  117. 1170 print"[217]ou pressed"
  118. 1180 print"[194]utton #1."
  119. 1190 print"[144] [195][207][206][212][201][206][213][197] "
  120. 1200 gosub 1570
  121. 1210 if y<>11 or x<19 or x>28 then 960
  122. 1220 sys 49709:goto 190
  123. 1230 rem button #2 was pressed
  124. 1240 gosub 1500
  125. 1250 print"[217]ou pressed"
  126. 1260 print"[194]utton #2."
  127. 1270 print"[144] [195][207][206][212][201][206][213][197] "
  128. 1280 gosub 1570
  129. 1290 if y<>11 or x<19 or x>28 then 960
  130. 1300 sys 49709:goto 190
  131. 1310 rem button #3 was pressed
  132. 1320 gosub 1500
  133. 1330 print"[217]ou pressed"
  134. 1340 print"[194]utton #3."
  135. 1350 print"[144] [195][207][206][212][201][206][213][197] "
  136. 1360 gosub 1570
  137. 1370 if y<>11 or x<19 or x>28 then 960
  138. 1380 sys 49709:goto 190
  139. 1390 rem slider
  140. 1400 gosub1450
  141. 1410 if x=4 and sl>0 then gosub 1460:sl=sl-1:gosub1470:goto 1480
  142. 1420 if x=32 and sl<26 then gosub 1460:sl=sl+1:gosub1470:goto 1480
  143. 1430 if x>4 and x<32 then gosub1460:sl=x-5:gosub1470:goto1480
  144. 1440 goto 190
  145. 1450 print"";:return
  146. 1460 gosub1450:fort=0to sl+1:print"";:next:print"[192]";:return
  147. 1470 gosub1450:fort=0to sl+1:print"";:next:print"[219]";:return
  148. 1480 gosub1450:print"[157][157][157][157][157][157][157][157][157][157]";:if sl>9 then printsl"[157][159][221]":goto 190
  149. 1490 print" "sl"[157][159][221]":goto 190
  150. 1500 rem draw dialog box
  151. 1510 sys 49709 : rem load screen
  152. 1520 print"                    "
  153. 1530 for t=1 to 6:print"                    [144] ":next
  154. 1540 print"[144]                    "
  155. 1550 return
  156. 1560 rem ---------------------------
  157. 1570 rem get a screen coord from ml
  158. 1580 poke 49572,0
  159. 1590 if peek(49572)=0 then 1590
  160. 1600 x=peek(49571):y=peek(49570)
  161. 1610 poke 54296,15:poke 54296,0
  162. 1620 if peek(56320)<>127 then 1620
  163. 1630 return
  164.