home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / recipe.sit / Recipe / background_2785.txt < prev    next >
Text File  |  1990-12-14  |  15KB  |  676 lines

  1. -- background: 2785 from stack: in
  2. -- bmap block id: 3084
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Book
  6. ----- HyperTalk script -----
  7. on openBackground
  8.   push recent card
  9. end openBackground
  10.  
  11. on closeBackground
  12.   put item 3 of the screenRect into screenWidth
  13.   if screenWidth <= 512 then show menubar
  14.   hideCalculator
  15. end closeBackground
  16.  
  17. on openCard
  18.   if the short name of this card is "First Card" or the short name of this card is "ContentsCard" then
  19.     hideCalculator
  20.   end if
  21.   pass openCard
  22. end openCard
  23.  
  24. on closeCard
  25.   hide fld "Credits"
  26.   set lockText of field "Credits" to true
  27.   set lockText of field "Recipe" to true
  28.   set lockText of field "Title" to true
  29.   set lockText of field "Type" to true
  30.   set scroll of field "Recipe" to 0
  31.   set the icon of bkgnd btn "lockUnlock" to "Locked"
  32.   pass closeCard
  33. end closeCard
  34.  
  35. on showCalculator
  36.   get visible of bg button "Calc"
  37.   if it is true or the short name of this card is "First Card" or the short name of this card is "ContentsCard" then exit showCalculator
  38.  
  39.   lock screen
  40.   get hilite of bg button "┬╗Metric"
  41.   if it is false then
  42.     show bg button "ml ┬╗ cup"
  43.     show bg button "ml ┬╗ tbsp"
  44.     show bg button "ml ┬╗ tsp"
  45.     show bg button "g ┬╗ oz"
  46.     show bg button "g ┬╗ lb"
  47.   else
  48.     show bg button "cup ┬╗ ml"
  49.     show bg button "tbsp ┬╗ ml"
  50.     show bg button "tsp ┬╗ ml"
  51.     show bg button "oz ┬╗ g"
  52.     show bg button "lb ┬╗ g"
  53.   end if
  54.   show bg button "┬╗Metric"
  55.   show bg button "CalcClose"
  56.   show bg fld "CalcScr"
  57.   show bg button "Calc"
  58.   unlock screen
  59.   select line 1 of bg fld "CalcScr"
  60. end showCalculator
  61.  
  62. on hideCalculator
  63.   set hilite of bg button "CalcClose" to false
  64.   get visible of bg button "Calc"
  65.   if it is false then exit hideCalculator
  66.  
  67.   lock screen
  68.   get hilite of bg button "┬╗Metric"
  69.   if it is false then
  70.     hide bg button "ml ┬╗ cup"
  71.     hide bg button "ml ┬╗ tbsp"
  72.     hide bg button "ml ┬╗ tsp"
  73.     hide bg button "g ┬╗ oz"
  74.     hide bg button "g ┬╗ lb"
  75.   else
  76.     hide bg button "cup ┬╗ ml"
  77.     hide bg button "tbsp ┬╗ ml"
  78.     hide bg button "tsp ┬╗ ml"
  79.     hide bg button "oz ┬╗ g"
  80.     hide bg button "lb ┬╗ g"
  81.   end if
  82.   hide bg button "┬╗Metric"
  83.   hide bg button "CalcClose"
  84.   hide bg fld "CalcScr"
  85.   hide bg button "Calc"
  86. end hideCalculator
  87.  
  88.  
  89.  
  90. -- part 9 (button)
  91. -- low flags: 00
  92. -- high flags: 0000
  93. -- rect: left=237 top=301 right=326 bottom=264
  94. -- title width / last selected line: 0
  95. -- icon id / first selected line: 1014 / 1014
  96. -- text alignment: 1
  97. -- font id: 0
  98. -- text size: 12
  99. -- style flags: 0
  100. -- line height: 16
  101. -- part name: Prev
  102. ----- HyperTalk script -----
  103. on mouseUp
  104.   visual effect wipe right
  105.   lock screen
  106.   go to previous card
  107. end mouseUp
  108.  
  109.  
  110.  
  111. -- part 10 (button)
  112. -- low flags: 00
  113. -- high flags: 0000
  114. -- rect: left=276 top=301 right=326 bottom=303
  115. -- title width / last selected line: 0
  116. -- icon id / first selected line: 1013 / 1013
  117. -- text alignment: 1
  118. -- font id: 0
  119. -- text size: 12
  120. -- style flags: 0
  121. -- line height: 16
  122. -- part name: Next
  123. ----- HyperTalk script -----
  124. on mouseUp
  125.   visual effect wipe left
  126.   lock screen
  127.   go to next card
  128. end mouseUp
  129.  
  130.  
  131.  
  132. -- part 11 (button)
  133. -- low flags: 00
  134. -- high flags: 2000
  135. -- rect: left=39 top=301 right=325 bottom=68
  136. -- title width / last selected line: 0
  137. -- icon id / first selected line: 21700 / 21700
  138. -- text alignment: 1
  139. -- font id: 0
  140. -- text size: 12
  141. -- style flags: 0
  142. -- line height: 16
  143. -- part name: Home
  144. ----- HyperTalk script -----
  145. on mouseUp
  146.   visual effect iris open
  147.   go Home
  148. end mouseUp
  149.  
  150.  
  151.  
  152. -- part 12 (button)
  153. -- low flags: 00
  154. -- high flags: 0000
  155. -- rect: left=463 top=300 right=328 bottom=494
  156. -- title width / last selected line: 0
  157. -- icon id / first selected line: 1012 / 1012
  158. -- text alignment: 1
  159. -- font id: 0
  160. -- text size: 12
  161. -- style flags: 0
  162. -- line height: 16
  163. -- part name: Return
  164. ----- HyperTalk script -----
  165. on mouseUp
  166.   visual effect iris close
  167.   pop card
  168. end mouseUp
  169.  
  170.  
  171.  
  172. -- part 13 (field)
  173. -- low flags: 03
  174. -- high flags: 6007
  175. -- rect: left=41 top=56 right=301 bottom=493
  176. -- title width / last selected line: 0
  177. -- icon id / first selected line: 0 / 0
  178. -- text alignment: 0
  179. -- font id: 22
  180. -- text size: 12
  181. -- style flags: 0
  182. -- line height: 14
  183. -- part name: Recipe
  184. ----- HyperTalk script -----
  185. on mouseUp
  186.   if the short name of this card is "ContentsCard" then
  187.     push this card
  188.     set cursor to watch
  189.     markText the clickLoc
  190.   end if
  191. end mouseUp
  192.  
  193. on markText t1
  194.   if target is empty then exit to HyperCard
  195.   -- Figure out what line is selected and find the right card
  196.   put trunc((item 2 of t1 - top of target + scroll of target) div textHeight of target) + 1 into theLine
  197.  
  198.   select line theLine of field "Recipe"
  199.   get the selectedText
  200.   -- get the title
  201.   delete word 1 to 2 of it
  202.   if first word of it is "ΓÇó" then delete first word of it
  203.   find words it in field "Title"
  204. end markText
  205.  
  206.  
  207.  
  208. -- part 14 (field)
  209. -- low flags: 01
  210. -- high flags: 0000
  211. -- rect: left=41 top=31 right=54 bottom=493
  212. -- title width / last selected line: 0
  213. -- icon id / first selected line: 0 / 0
  214. -- text alignment: 1
  215. -- font id: 21
  216. -- text size: 18
  217. -- style flags: 0
  218. -- line height: 24
  219. -- part name: Title
  220.  
  221.  
  222. -- part 15 (field)
  223. -- low flags: 01
  224. -- high flags: 0000
  225. -- rect: left=307 top=305 right=326 bottom=463
  226. -- title width / last selected line: 0
  227. -- icon id / first selected line: 0 / 0
  228. -- text alignment: 0
  229. -- font id: 21
  230. -- text size: 14
  231. -- style flags: 256
  232. -- line height: 16
  233. -- part name: Type
  234. ----- HyperTalk script -----
  235. on mouseUp
  236.   get fld "Type"
  237.   find word it in fld "Type"
  238.   find word it in fld "Type"
  239. end mouseUp
  240.  
  241.  
  242. -- part 19 (button)
  243. -- low flags: 00
  244. -- high flags: 2000
  245. -- rect: left=67 top=302 right=324 bottom=91
  246. -- title width / last selected line: 0
  247. -- icon id / first selected line: 19678 / 19678
  248. -- text alignment: 1
  249. -- font id: 0
  250. -- text size: 12
  251. -- style flags: 0
  252. -- line height: 16
  253. -- part name: Show Credits
  254. ----- HyperTalk script -----
  255. on mouseUp
  256.   show fld "Credits"
  257. end mouseUp
  258.  
  259.  
  260.  
  261. -- part 20 (field)
  262. -- low flags: 81
  263. -- high flags: 2002
  264. -- rect: left=52 top=58 right=175 bottom=471
  265. -- title width / last selected line: 0
  266. -- icon id / first selected line: 0 / 0
  267. -- text alignment: 0
  268. -- font id: 3
  269. -- text size: 12
  270. -- style flags: 0
  271. -- line height: 16
  272. -- part name: Credits
  273. ----- HyperTalk script -----
  274. on MouseUp
  275.   hide fld "Credits"
  276. end MouseUp
  277.  
  278.  
  279.  
  280. -- part 21 (button)
  281. -- low flags: 00
  282. -- high flags: 2000
  283. -- rect: left=91 top=302 right=323 bottom=115
  284. -- title width / last selected line: 0
  285. -- icon id / first selected line: 24317 / 24317
  286. -- text alignment: 1
  287. -- font id: 0
  288. -- text size: 12
  289. -- style flags: 0
  290. -- line height: 16
  291. -- part name: 
  292. ----- HyperTalk script -----
  293. on mouseUp
  294.   go to card id 3631
  295. end mouseUp
  296.  
  297.  
  298.  
  299.  
  300. -- part 24 (button)
  301. -- low flags: 00
  302. -- high flags: 0000
  303. -- rect: left=0 top=0 right=12 bottom=512
  304. -- title width / last selected line: 0
  305. -- icon id / first selected line: 0 / 0
  306. -- text alignment: 1
  307. -- font id: 0
  308. -- text size: 12
  309. -- style flags: 0
  310. -- line height: 16
  311. -- part name: Menubar
  312. ----- HyperTalk script -----
  313. on mouseEnter
  314.   put item 3 of the screenRect into screenWidth
  315.   if screenWidth <= 512 then show menubar
  316. end mouseEnter
  317.  
  318. on mouseLeave
  319.   put item 3 of the screenRect into screenWidth
  320.   if screenWidth <= 512 then hide menubar
  321. end mouseLeave
  322.  
  323.  
  324. -- part 25 (button)
  325. -- low flags: 00
  326. -- high flags: 2000
  327. -- rect: left=115 top=302 right=324 bottom=145
  328. -- title width / last selected line: 0
  329. -- icon id / first selected line: 3430 / 3430
  330. -- text alignment: 1
  331. -- font id: 0
  332. -- text size: 12
  333. -- style flags: 0
  334. -- line height: 16
  335. -- part name: 
  336. ----- HyperTalk script -----
  337. on mouseUp
  338.   push this card
  339.   go to card id 12994
  340. end mouseUp
  341.  
  342.  
  343.  
  344.  
  345. -- part 26 (button)
  346. -- low flags: 00
  347. -- high flags: 0000
  348. -- rect: left=473 top=33 right=51 bottom=489
  349. -- title width / last selected line: 0
  350. -- icon id / first selected line: 104 / 104
  351. -- text alignment: 1
  352. -- font id: 0
  353. -- text size: 12
  354. -- style flags: 0
  355. -- line height: 16
  356. -- part name: lockUnlock
  357. ----- HyperTalk script -----
  358. on mouseUp
  359.   global saveText, saveID
  360.   set the icon of me to "Unlocked" --show unlocked padlock
  361.   set lockText of field "Recipe" to false
  362.   set lockText of field "Title" to false
  363.   set lockText of field "Type" to false
  364.   set lockText of field "Credits" to false
  365. end mouseUp
  366.  
  367.  
  368.  
  369. -- part 28 (button)
  370. -- low flags: 00
  371. -- high flags: 2000
  372. -- rect: left=168 top=302 right=325 bottom=193
  373. -- title width / last selected line: 0
  374. -- icon id / first selected line: 128 / 128
  375. -- text alignment: 1
  376. -- font id: 0
  377. -- text size: 12
  378. -- style flags: 0
  379. -- line height: 16
  380. -- part name: 
  381. ----- HyperTalk script -----
  382. on mouseUp
  383.   answer "Print this recipe?" with "Yes" or "No"
  384.   if it is "Yes" then
  385.     printOut
  386.   end if
  387. end mouseUp
  388.  
  389.  
  390.  
  391. -- part 30 (button)
  392. -- low flags: 00
  393. -- high flags: 2000
  394. -- rect: left=144 top=302 right=328 bottom=169
  395. -- title width / last selected line: 0
  396. -- icon id / first selected line: 129 / 129
  397. -- text alignment: 1
  398. -- font id: 0
  399. -- text size: 12
  400. -- style flags: 0
  401. -- line height: 16
  402. -- part name: 
  403. ----- HyperTalk script -----
  404. on mouseUp
  405.   showCalculator
  406. end mouseUp
  407.  
  408.  
  409.  
  410. -- part 36 (button)
  411. -- low flags: 80
  412. -- high flags: 0003
  413. -- rect: left=357 top=199 right=339 bottom=465
  414. -- title width / last selected line: 0
  415. -- icon id / first selected line: 0 / 0
  416. -- text alignment: 1
  417. -- font id: 0
  418. -- text size: 12
  419. -- style flags: 0
  420. -- line height: 16
  421. -- part name: Calc
  422.  
  423.  
  424. -- part 33 (button)
  425. -- low flags: 80
  426. -- high flags: A004
  427. -- rect: left=364 top=240 right=255 bottom=459
  428. -- title width / last selected line: 0
  429. -- icon id / first selected line: 0 / 0
  430. -- text alignment: 1
  431. -- font id: 0
  432. -- text size: 12
  433. -- style flags: 0
  434. -- line height: 16
  435. -- part name: ml ╚ cup
  436. ----- HyperTalk script -----
  437. -- 1 cup  = 250 ml
  438. -- 1 tbsp = 15 ml
  439. -- 1 tsp  = 4 ml
  440. -- 1 lb   = 454 g
  441. -- 1 ounce = 28.349 g
  442.  
  443. on mouseUp
  444.   get hilite of bg button "┬╗Metric"
  445.   if it is true then
  446.     set numberFormat to "0"
  447.     put first word of fld "CalcScr" * 250 into fld "CalcScr"
  448.   else
  449.     set numberFormat to "0.##"
  450.     put first word of fld "CalcScr" / 250 into fld "CalcScr"
  451.   end if
  452.   select line 1 of bg fld "CalcScr"
  453. end mouseUp
  454.  
  455.  
  456.  
  457. -- part 32 (field)
  458. -- low flags: 80
  459. -- high flags: 4002
  460. -- rect: left=363 top=217 right=236 bottom=460
  461. -- title width / last selected line: 0
  462. -- icon id / first selected line: 0 / 0
  463. -- text alignment: 65535
  464. -- font id: 3
  465. -- text size: 12
  466. -- style flags: 256
  467. -- line height: 16
  468. -- part name: CalcScr
  469.  
  470.  
  471. -- part 37 (button)
  472. -- low flags: 80
  473. -- high flags: A005
  474. -- rect: left=362 top=320 right=336 bottom=457
  475. -- title width / last selected line: 0
  476. -- icon id / first selected line: 0 / 0
  477. -- text alignment: 1
  478. -- font id: 0
  479. -- text size: 12
  480. -- style flags: 0
  481. -- line height: 16
  482. -- part name: ╚Metric
  483. ----- HyperTalk script -----
  484. on mouseUp
  485.   lock screen
  486.   get hilite of bg button "┬╗Metric"
  487.   if it is true then
  488.     set name of bg button "ml ┬╗ cup" to "cup ┬╗ ml"
  489.     set name of bg button "ml ┬╗ tbsp" to "tbsp ┬╗ ml"
  490.     set name of bg button "ml ┬╗ tsp" to "tsp ┬╗ ml"
  491.     set name of bg button "g ┬╗ oz" to "oz ┬╗ g"
  492.     set name of bg button "g ┬╗ lb" to "lb ┬╗ g"
  493.   else
  494.     set name of bg button "cup ┬╗ ml" to "ml ┬╗ cup"
  495.     set name of bg button "tbsp ┬╗ ml" to "ml ┬╗ tbsp"
  496.     set name of bg button "tsp ┬╗ ml" to "ml ┬╗ tsp"
  497.     set name of bg button "oz ┬╗ g" to "g ┬╗ oz"
  498.     set name of bg button "lb ┬╗ g" to "g ┬╗ lb"
  499.   end if
  500. end mouseUp
  501.  
  502.  
  503.  
  504. -- part 39 (button)
  505. -- low flags: 80
  506. -- high flags: A004
  507. -- rect: left=364 top=256 right=271 bottom=459
  508. -- title width / last selected line: 0
  509. -- icon id / first selected line: 0 / 0
  510. -- text alignment: 1
  511. -- font id: 0
  512. -- text size: 12
  513. -- style flags: 0
  514. -- line height: 16
  515. -- part name: ml ╚ tbsp
  516. ----- HyperTalk script -----
  517. -- 1 cup  = 250 ml
  518. -- 1 tbsp = 15 ml
  519. -- 1 tsp  = 4 ml
  520. -- 1 lb   = 454 g
  521. -- 1 ounce = 28.349 g
  522.  
  523. on mouseUp
  524.   get hilite of bg button "┬╗Metric"
  525.   if it is true then
  526.     set numberFormat to "0"
  527.     put first word of fld "CalcScr" * 15 into fld "CalcScr"
  528.   else
  529.     set numberFormat to "0.##"
  530.     put first word of fld "CalcScr" / 15 into fld "CalcScr"
  531.   end if
  532.   select line 1 of bg fld "CalcScr"
  533. end mouseUp
  534.  
  535.  
  536.  
  537. -- part 40 (button)
  538. -- low flags: 80
  539. -- high flags: A004
  540. -- rect: left=364 top=272 right=287 bottom=459
  541. -- title width / last selected line: 0
  542. -- icon id / first selected line: 0 / 0
  543. -- text alignment: 1
  544. -- font id: 0
  545. -- text size: 12
  546. -- style flags: 0
  547. -- line height: 16
  548. -- part name: ml ╚ tsp
  549. ----- HyperTalk script -----
  550. -- 1 cup  = 250 ml
  551. -- 1 tbsp = 15 ml
  552. -- 1 tsp  = 4 ml
  553. -- 1 lb   = 454 g
  554. -- 1 ounce = 28.349 g
  555.  
  556. on mouseUp
  557.   get hilite of bg button "┬╗Metric"
  558.   if it is true then
  559.     set numberFormat to "0"
  560.     put first word of fld "CalcScr" * 4 into fld "CalcScr"
  561.   else
  562.     set numberFormat to "0.##"
  563.     put first word of fld "CalcScr" / 4 into fld "CalcScr"
  564.   end if
  565.   select line 1 of bg fld "CalcScr"
  566. end mouseUp
  567.  
  568.  
  569.  
  570. -- part 41 (button)
  571. -- low flags: 80
  572. -- high flags: A004
  573. -- rect: left=364 top=288 right=303 bottom=459
  574. -- title width / last selected line: 0
  575. -- icon id / first selected line: 0 / 0
  576. -- text alignment: 1
  577. -- font id: 0
  578. -- text size: 12
  579. -- style flags: 0
  580. -- line height: 16
  581. -- part name: g ╚ oz
  582. ----- HyperTalk script -----
  583. -- 1 cup  = 250 ml
  584. -- 1 tbsp = 15 ml
  585. -- 1 tsp  = 4 ml
  586. -- 1 lb   = 454 g
  587. -- 1 ounce = 28.349 g
  588.  
  589. on mouseUp
  590.   get hilite of bg button "┬╗Metric"
  591.   if it is true then
  592.     set numberFormat to "0"
  593.     put first word of fld "CalcScr" * 28.349 into fld "CalcScr"
  594.   else
  595.     set numberFormat to "0.##"
  596.     put first word of fld "CalcScr" / 28.349 into fld "CalcScr"
  597.   end if
  598.   select line 1 of bg fld "CalcScr"
  599. end mouseUp
  600.  
  601.  
  602.  
  603. -- part 42 (button)
  604. -- low flags: 80
  605. -- high flags: A004
  606. -- rect: left=364 top=304 right=319 bottom=459
  607. -- title width / last selected line: 0
  608. -- icon id / first selected line: 0 / 0
  609. -- text alignment: 1
  610. -- font id: 0
  611. -- text size: 12
  612. -- style flags: 0
  613. -- line height: 16
  614. -- part name: g ╚ lb
  615. ----- HyperTalk script -----
  616. -- 1 cup  = 250 ml
  617. -- 1 tbsp = 15 ml
  618. -- 1 tsp  = 4 ml
  619. -- 1 lb   = 454 g
  620. -- 1 ounce = 28.349 g
  621.  
  622. on mouseUp
  623.   get hilite of bg button "┬╗Metric"
  624.   if it is true then
  625.     set numberFormat to "0"
  626.     put first word of fld "CalcScr" * 454 into fld "CalcScr"
  627.   else
  628.     set numberFormat to "0.##"
  629.     put first word of fld "CalcScr" / 454 into fld "CalcScr"
  630.   end if
  631.   select line 1 of bg fld "CalcScr"
  632. end mouseUp
  633.  
  634.  
  635.  
  636. -- part 43 (button)
  637. -- low flags: 80
  638. -- high flags: 2005
  639. -- rect: left=361 top=200 right=216 bottom=379
  640. -- title width / last selected line: 0
  641. -- icon id / first selected line: 0 / 0
  642. -- text alignment: 1
  643. -- font id: 0
  644. -- text size: 12
  645. -- style flags: 0
  646. -- line height: 16
  647. -- part name: CalcClose
  648. ----- HyperTalk script -----
  649. on mouseUp
  650.   hideCalculator
  651. end mouseUp
  652.  
  653.  
  654.  
  655. -- part 44 (button)
  656. -- low flags: 00
  657. -- high flags: 2000
  658. -- rect: left=195 top=302 right=331 bottom=229
  659. -- title width / last selected line: 0
  660. -- icon id / first selected line: 130 / 130
  661. -- text alignment: 1
  662. -- font id: 0
  663. -- text size: 12
  664. -- style flags: 0
  665. -- line height: 16
  666. -- part name: 
  667. ----- HyperTalk script -----
  668. on mouseUp
  669.   answer "Sort all cards of this stack according to:" with "Title" or "Category" or "Cancel"
  670.   if it is "Title"
  671.   then sort by first line of field "Title"
  672. else if it is "Category"
  673. then sort by first word of first line of field "Type"
  674. end mouseUp
  675.  
  676.