home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / drdobbs / 1988 / 04 / krute / krute.lst < prev   
File List  |  1979-12-31  |  18KB  |  678 lines

  1.  
  2.  
  3.  
  4.  
  5. -------------------------------------------------------------
  6.  
  7. Scouting Toolkit¬
  8. A Hypercard Project
  9.  
  10. Programmed and ⌐1988 by Stan Krute
  11. All rights reserved 
  12.  
  13. -------------------------------------------------------------
  14.  
  15. Description Of Objects 
  16.  
  17. -------------------------------------------------------------
  18.  
  19. The Stack
  20. Description
  21. The stack's name is "Scouting Toolkit¬"
  22. It contains 1 background
  23. It contains 1 card
  24. The size of the stack is 20K
  25. Script
  26. The stack has no script
  27.  
  28. -------------------------------------------------------------
  29.  
  30. Background 1
  31. Description
  32. The background has no name
  33. It's used by 1 card
  34. Script
  35. The background has no script
  36.  
  37. -------------------------------------------------------------
  38.  
  39. Card 1
  40. Description
  41. The card's name is "Scouting Toolkit"
  42. It contains 17 buttons
  43. It contains 2 fields
  44. Script
  45. ---------------------------- openCard --------------------------
  46. on openCard
  47.   -- hide the menubar, and initialize a state variable for it
  48.   global menubarState
  49.   hide menubar
  50.   put "hidden" into menubarState
  51.   
  52.   -- hide some windows
  53.   hide message box
  54.   hide tool window
  55.   hide pattern window
  56. end openCard
  57.  
  58. ---------------------------- mouseUp --------------------------
  59. on mouseUp
  60.   -- redraw the toolkit buttons, in case some are hidden
  61.   repeat with buttonNumber = 2 to 13
  62.     show button buttonNumber
  63.   end repeat
  64. end mouseUp
  65.  
  66. -------------------------------------------------------------
  67.  
  68. Button 1
  69. Description
  70. The button's name is "Delete Scouting Toolkit"
  71. Its Show name property is false
  72. Its Auto hilite property is true
  73. Its style is shadow
  74. It has an icon, ID# 30010
  75. Its rectangle is 42 units wide, 42 unitshigh
  76. The button's located at card location (36,292)  
  77. Its text properties are: System Font 12, Height 16, Align center
  78. Script
  79. ------------------------------ mouseUp ------------------------------
  80. on mouseUp
  81.   -- make sure we don't mess up the supply card
  82.   if short name of this card is not "Scouting Toolkit" then
  83.     
  84.     -- save and set the user level
  85.     get userLevel
  86.     put it into entryUserLevel
  87.     set userLevel to 5
  88.     
  89.     -- show the watch cursor
  90.     set cursor to 4
  91.     
  92.     -- make sure the kit buttons are showing
  93.     show button "Scouting Toolkit Icon"
  94.     click at loc of button "Scouting Toolkit Icon"
  95.     
  96.     -- set the tool
  97.     choose button tool
  98.     
  99.     -- get rid of our toolkit
  100.     click at loc of button "Home"
  101.     doMenu "Clear Button"
  102.     
  103.     click at loc of button "Back"
  104.     doMenu "Clear Button"
  105.     
  106.     click at loc of button "Next"
  107.     doMenu "Clear Button"
  108.     
  109.     click at loc of button "Previous"
  110.     doMenu "Clear Button"
  111.     
  112.     click at loc of button "Toggle Pattern Window"
  113.     doMenu "Clear Button"
  114.     
  115.     click at loc of button "Toggle Tool Window"
  116.     doMenu "Clear Button"
  117.     
  118.     click at loc of button "Toggle Message Box"
  119.     doMenu "Clear Button"
  120.     
  121.     click at loc of button "Toggle Menubar"
  122.     doMenu "Clear Button"
  123.     
  124.     choose field tool
  125.     show card field "Copyright"
  126.     click at loc of card field "Copyright"
  127.     doMenu "Clear Field"
  128.     choose button tool
  129.     
  130.     click at loc of button "Scouting Toolkit About"
  131.     doMenu "Clear Button"
  132.     
  133.     click at loc of button "Scouting Toolkit¬"
  134.     doMenu "Clear Button"
  135.     
  136.     click at loc of button "Scouting Toolkit Window"
  137.     doMenu "Clear Button"
  138.     
  139.     show button "Scouting Toolkit Icon"
  140.     click at loc of button "Scouting Toolkit Icon"
  141.     doMenu "Clear Button"
  142.     
  143.     -- snake swallows tail
  144.     click at loc of button "Delete Scouting Toolkit"
  145.     doMenu "Clear Button"
  146.     
  147.     -- set the tool
  148.     choose browse tool
  149.     
  150.     -- restore the cursor
  151.     set cursor to 0
  152.     
  153.     -- restore the user level
  154.     set userLevel to entryUserLevel
  155.     
  156.   else
  157.     -- we're on the supply card, so it would be bad form to delete
  158.     
  159.     -- send a signal
  160.     show card field "No Delete Here"
  161.     
  162.     -- wait a moment
  163.     wait 1 seconds
  164.     
  165.     -- hide the signal
  166.     hide card field "No Delete Here"
  167.   end if
  168. end mouseUp
  169.  
  170. -------------------------------------------------------------
  171.  
  172.  Button 2
  173. Description
  174. The button's name is "Scouting Toolkit Window"
  175. Its Show name property is false
  176. Its Auto hilite property is true
  177. Its style is shadow
  178. It has no icon
  179. Its rectangle is 300 units wide, 182 units high
  180. The button's located at card location (197,144)     
  181. Its text properties are: System Font 12, Height 16, Align center
  182. Script
  183. ---------------------------- mouseUp ----------------------------
  184. on mouseUp
  185.   -- make a noise
  186.   play "boing" "c"
  187.   
  188.   -- close the kit
  189.   hideScoutingToolkit
  190.   
  191.   -- show the trigger
  192.   show button "Scouting Toolkit Icon"
  193. end mouseUp
  194.  
  195.  
  196. ----------------------- hideScoutingToolkit -----------------------
  197. on hideScoutingToolkit
  198.   -- hide the kit's buttons
  199.   hide button "Home"
  200.   hide button "Back"
  201.   hide button "Next"
  202.   hide button "Previous"
  203.   hide button "Toggle Pattern Window"
  204.   hide button "Toggle Tool Window"
  205.   hide button "Toggle Message Box"
  206.   hide button "Toggle Menubar"
  207.   hide button "Scouting Toolkit About"
  208.   hide button "Scouting Toolkit¬"
  209.   hide button "Scouting Toolkit Window"
  210. end hideScoutingToolkit
  211.  
  212. -------------------------------------------------------------
  213.  
  214.  Button 3
  215. Description
  216. The button's name is "Scouting Toolkit¬"
  217. Its Show name property is true
  218. Its Auto hilite property is true
  219. Its style is opaque
  220. It has no icon
  221. Its rectangle is 120 units wide, 20 units high
  222. The button's located at card location (296,160)     
  223. Its text properties are: System Font 12, Height 16, Align center
  224. Script
  225. ------------------------------ mouseUp ------------------------------
  226. on mouseUp
  227.   -- pass the message through
  228.   send mouseUp to button "Scouting Toolkit Window"
  229. end mouseUp
  230.  
  231. -------------------------------------------------------------
  232.  
  233.  Button 4
  234. Description
  235. The button's name is "Scouting Toolkit About"
  236. Its Show name property is false
  237. Its Auto hilite property is true
  238. Its style is transparent
  239. It has an icon, ID# 30011
  240. Its rectangle is 24 units wide, 22 units high
  241. The button's located at card location (466,150)     
  242. Its text properties are: System Font 12, Height 16, Align center
  243. Script
  244. ------------------------------- mouseUp -------------------------------
  245. on mouseUp
  246.   -- show the copyright notice
  247.   show card field "Copyright"
  248.   
  249.   -- a little sound effect
  250.   play "harpsichord" "c e g"
  251.   
  252.   -- wait for a mouse click
  253.   wait until the mouseClick
  254.   
  255.   -- a little sound effect
  256.   play "harpsichord" "g e c"
  257.   
  258.   -- hide the copyright notice
  259.   hide card field "Copyright"
  260. end mouseUp
  261.  
  262. -------------------------------------------------------------
  263.  
  264.  Button 5
  265. Description
  266. The button's name is "Toggle Menubar"
  267. Its Show name property is false
  268. Its Auto hilite property is true
  269. Its style is shadow
  270. It has an icon, ID# 30009
  271. Its rectangle is 42 units wide, 42 units high
  272. The button's located at card location (225,193)     
  273. Its text properties are: System Font 12, Height 16, Align center
  274. Script
  275. ---------------------------- mouseUp ----------------------------
  276. on mouseUp
  277.   -- no built-in check for visibility, so╔
  278.   global menubarState
  279.   
  280.   -- toggle the menubar's visibility
  281.   if menubarState is "hidden" then
  282.     show menubar
  283.     put "showing" into menubarState
  284.   else
  285.     hide menubar
  286.     put "hidden" into menubarState
  287.   end if
  288. end mouseUp
  289.  
  290. -------------------------------------------------------------
  291.  
  292.  Button 6
  293. Description
  294. The button's name is "Toggle Message Box"
  295. Its Show name property is false
  296. Its Auto hilite property is true
  297. Its style is shadow
  298. It has an icon, ID# 30008
  299. Its rectangle is 42 units wide, 42 units high
  300. The button's located at card location (292,193)     
  301. Its text properties are: System Font 12, Height 16, Align center
  302. Script
  303. ---------------------------- mouseUp ----------------------------
  304. on mouseUp
  305.   -- toggle the message window's visibility
  306.   if the visible of message box is true then
  307.     hide the message box
  308.   else
  309.     show the message box
  310.   end if
  311. end mouseUp
  312.  
  313. -------------------------------------------------------------
  314.  
  315.  Button 7
  316. Description
  317. The button's name is "Toggle Tool Window"
  318. Its Show name property is false
  319. Its Auto hilite property is true
  320. Its style is shadow
  321. It has an icon, ID# 30007
  322. Its rectangle is 42 units wide, 42 units high
  323. The button's located at card location (359,193)     
  324. Its text properties are: System Font 12, Height 16, Align center
  325. Script
  326. ---------------------------- mouseUp ----------------------------
  327. on mouseUp
  328.   -- toggle the tool palette window's visibility
  329.   if the visible of tool window is true then
  330.     hide tool window
  331.   else
  332.     show tool window
  333.   end if
  334. end mouseUp
  335.  
  336. -------------------------------------------------------------
  337.  
  338. Button 8
  339. Description
  340. The button's name is "Toggle Pattern Window"
  341. Its Show name property is false
  342. Its Auto hilite property is true
  343. Its style is shadow
  344. It has an icon, ID# 30006
  345. Its rectangle is 42 units wide, 42 units high
  346. The button's located at card location (426,193)     
  347. Its text properties are: System Font 12, Height 16, Align center
  348. Script
  349. ---------------------------- mouseUp ----------------------------
  350. on mouseUp
  351.   -- toggle the pattern palette's window's visibility
  352.   if the visible of pattern window is true then
  353.     hide pattern window
  354.   else
  355.     show pattern window
  356.   end if
  357. end mouseUp
  358.  
  359. -------------------------------------------------------------
  360.  
  361. Button 9
  362. Description
  363. The button's name is "Previous"
  364. Its Show name property is false
  365. Its Auto hilite property is true
  366. Its style is shadow
  367. It has an icon, ID# 30001
  368. Its rectangle is 42 units wide, 42 units high
  369. The button's located at card location (225,259)     
  370. Its text properties are: System Font 12, Height 16, Align center
  371. Script
  372. ---------------------------- mouseUp ----------------------------
  373. on mouseUp
  374.   -- move to the previous card
  375.   doMenu "Prev"
  376. end mouseUp
  377.  
  378. -------------------------------------------------------------
  379.  
  380. Button 10
  381. Description
  382. The button's name is "Next"
  383. Its Show name property is false
  384. Its Auto hilite property is true
  385. Its style is shadow
  386. It has an icon, ID# 30002
  387. Its rectangle is 42 units wide, 42 units high
  388. The button's located at card location (292,259)     
  389. Its text properties are: System Font 12, Height 16, Align center
  390. Script
  391. ---------------------------- mouseUp ----------------------------
  392. on mouseUp
  393.   -- move to the next card
  394.   doMenu "Next"
  395. end mouseUp
  396.  
  397. -------------------------------------------------------------
  398.  
  399. Button 11
  400. Description
  401. The button's name is "Back"
  402. Its Show name property is false
  403. Its Auto hilite property is true
  404. Its style is shadow
  405. It has an icon, ID# 30003
  406. Its rectangle is 42 units wide, 42 units high
  407. The button's located at card location (359,259)     
  408. Its text properties are: System Font 12, Height 16, Align center
  409. Script
  410. ---------------------------- mouseUp ----------------------------
  411. on mouseUp
  412.   -- go to the last card visited
  413.   doMenu "Back"
  414. end mouseUp
  415.  
  416. -------------------------------------------------------------
  417.  
  418. Button 12
  419. Description
  420. The button's name is "Home"
  421. Its Show name property is false
  422. Its Auto hilite property is true
  423. Its style is shadow
  424. It has an icon, ID# 30005
  425. Its rectangle is 42 units wide, 42 units high
  426. The button's located at card location (426,259)     
  427. Its text properties are: System Font 12, Height 16, Align center
  428. Script
  429. ---------------------------- mouseUp ----------------------------
  430. on mouseUp
  431.   -- go home
  432.   visual effect iris close
  433.   doMenu "Home"
  434. end mouseUp
  435.  
  436. -------------------------------------------------------------
  437.  
  438. Button 13
  439. Description
  440. The button's name is "Scouting Toolkit Icon"
  441. Its Show name property is false
  442. Its Auto hilite property is true
  443. Its style is shadow
  444. It has an icon, ID# 30004
  445. Its rectangle is 42 units wide, 42 units high
  446. The button's located at card location (178,83)     
  447. Its text properties are: System Font 12, Height 16, Align center
  448. Script
  449. ------------------------------- mouseUp -------------------------------
  450. on mouseUp
  451.   -- make a noise
  452.   play "boing" "e"
  453.   
  454.   -- hide this button
  455.   hide button "Scouting Toolkit Icon"
  456.   
  457.   -- show the toolkit
  458.   showScoutingToolkit
  459. end mouseUp
  460.  
  461.  
  462. ------------------------- showScoutingToolkit -------------------------
  463. on showScoutingToolkit
  464.   -- show the toolkit's buttons
  465.   show button "Toggle Menubar"
  466.   show button "Scouting Toolkit Window"
  467.   show button "Scouting Toolkit About"
  468.   show button "Scouting Toolkit¬"
  469.   show button "Toggle Message Box"
  470.   show button "Toggle Tool Window"
  471.   show button "Toggle Pattern Window"
  472.   show button "Previous"
  473.   show button "Next"
  474.   show button "Back"
  475.   show button "Home"
  476. end showScoutingToolkit
  477.  
  478. -------------------------------------------------------------
  479.  
  480. Button 14
  481. Description
  482. The button's name is "Duplicate Scouting Toolkit"
  483. Its Show name property is false
  484. Its Auto hilite property is true
  485. Its style is shadow
  486. It has an icon, ID# 30000
  487. Its rectangle is 42 units wide, 42 units high
  488. The button's located at card location (460,12)     
  489. Its text properties are: System Font 12, Height 16, Align center
  490. Script
  491. ------------------------------ newButton ------------------------------
  492. on newButton
  493.   -- make sure we don't mess up the supply card
  494.   if short name of this card is not "Scouting Toolkit" then
  495.     
  496.     -- save and set the user level
  497.     get userLevel
  498.     put it into entryUserLevel
  499.     set userLevel to 5
  500.     
  501.     -- set the cursor to the watch
  502.     set cursor to 4
  503.     
  504.     -- set the tool
  505.     choose button tool
  506.     
  507.     -- for all the buttons in the set
  508.     repeat with buttonNumber = 1 to 13
  509.       
  510.       -- remember where we are (the target card)
  511.       push card
  512.       
  513.       -- hide screen commotion
  514.       set lockScreen to true
  515.       
  516.       -- go to the supply card
  517.       go to card "Scouting Toolkit" of stack "Scouting Toolkit¬"
  518.       
  519.       -- select the button
  520.       click at loc of button buttonNumber
  521.       
  522.       -- copy the button
  523.       doMenu "Copy Button"
  524.       
  525.       -- return to the target card
  526.       pop card
  527.       
  528.       -- show screen commotion
  529.       set lockScreen to false
  530.       
  531.       -- paste the button
  532.       doMenu "Paste Button"
  533.       
  534.     end repeat
  535.     
  536.     -- copy the copyright notice
  537.     copyCopyrightField
  538.     
  539.     -- get rid of this duplication button
  540.     choose button tool
  541.     click at loc of button "Duplicate Scouting Toolkit"
  542.     doMenu "Cut Button"
  543.     
  544.     -- move two buttons
  545.     drag from loc of button "Scouting Toolkit Icon" to loc of button "Back"
  546.     hide button "Scouting Toolkit Icon"
  547.     drag from loc of button "Delete Scouting Toolkit" to loc of button "Home"
  548.     
  549.     -- hide the toolkit
  550.     choose browse tool
  551.     click at loc of button "Scouting Toolkit Window"
  552.     
  553.     -- restore the user level
  554.     set userLevel to entryUserLevel
  555.   end if
  556. end newButton
  557.  
  558. -------------------------- copyCopyrightField --------------------------
  559. on copyCopyrightField
  560.   -- save our location
  561.   push card
  562.   
  563.   -- hide screen commotion
  564.   set lockScreen to true
  565.   
  566.   -- go to the supply card
  567.   go to card "Scouting Toolkit" of stack "Scouting Toolkit¬"
  568.   
  569.   -- set tool
  570.   choose field tool
  571.   
  572.   -- select the field
  573.   show card field "Copyright"
  574.   click at loc of card field "Copyright"
  575.   
  576.   -- copy the button
  577.   doMenu "Copy Field"
  578.   
  579.   -- hide the field
  580.   hide card field "Copyright"
  581.   
  582.   -- and get the field's contents
  583.   get card field "Copyright"
  584.   
  585.   -- return to the target card
  586.   pop card
  587.   
  588.   -- show screen commotion
  589.   set lockScreen to false
  590.   
  591.   -- paste the field, fill it up, and hide it
  592.   doMenu "Paste Field"
  593.   put It into card field "Copyright"
  594.   hide card field "Copyright"
  595. end copyCopyrightField
  596.  
  597. -------------------------------- mouseUp --------------------------------
  598. on mouseUp
  599.   -- make sure we're at the supply card
  600.   if short name of this card is "Scouting Toolkit" then
  601.     
  602.     -- show the watch cursor
  603.     set cursor to 4
  604.     
  605.     -- copy the button
  606.     choose button tool
  607.     click at loc of button "Duplicate Scouting Toolkit"
  608.     doMenu "Copy Button"
  609.     
  610.     -- restore tool
  611.     choose browse tool
  612.   end if
  613. end mouseUp
  614.  
  615. -------------------------------------------------------------
  616.  
  617. Button 15
  618. Description
  619. The button's name is "Copyright"
  620. Its Show name property is false
  621. Its Auto hilite property is true
  622. Its style is transparent
  623. It has an icon, ID# 30000
  624. Its rectangle is 70 units wide, 13 units high
  625. The button's located at card location (0,52)     
  626. Its text properties are: System Font 12, Height 16, Align center
  627. Script
  628. ------------------------------- mouseUp -------------------------------
  629. on mouseUp
  630.   -- pass message on to the toolkit's About button
  631.   send mouseUp to button "Scouting Toolkit About"
  632. end mouseUp
  633.  
  634. -------------------------------------------------------------
  635.  
  636.  Card Field 1
  637. Description
  638. The field's name is "Copyright"
  639. It's hiddden
  640. Its Lock text property is true
  641. Its Show lines property is false
  642. Its Wide margins property is false
  643. Its style is rectangle
  644. Its rectangle is 286 units wide, 129 units high
  645. The field's located at card location (204,190)     
  646. Its text properties are: Geneva 12, Height 16, Align center
  647. Contents
  648. "⌐1987 by Stan Krute's Camp Creek Institute. 
  649. All rights reserved.
  650. Call or write for details:
  651. 18617 Camp Creek Road
  652. Hornbrook, California96044
  653. [916] 475-3428"
  654. Script
  655. The field has no script
  656.  
  657. -------------------------------------------------------------
  658.  
  659. Card Field 2
  660. Description
  661. The field's name is "No Delete Here"
  662. It's hiddden
  663. Its Lock text property is true
  664. Its Show lines property is false
  665. Its Wide margins property is false
  666. Its style is opaque
  667. Its rectangle is 39 units wide, 39 units high
  668. The field's located at card location (37,293)     
  669. Its text properties are: Geneva 9, Height 12, Align center
  670. Contents
  671. "Not Here,
  672. Though."
  673. Script
  674. The field has no script
  675.  
  676. -------------------------------------------------------------
  677.  
  678.