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

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