-- background: 2785 from stack: in -- bmap block id: 3084 -- flags: 4000 -- background id: 0 -- name: Book ----- HyperTalk script ----- on openBackground push recent card end openBackground on closeBackground put item 3 of the screenRect into screenWidth if screenWidth <= 512 then show menubar hideCalculator end closeBackground on openCard if the short name of this card is "First Card" or the short name of this card is "ContentsCard" then hideCalculator end if pass openCard end openCard on closeCard hide fld "Credits" set lockText of field "Credits" to true set lockText of field "Recipe" to true set lockText of field "Title" to true set lockText of field "Type" to true set scroll of field "Recipe" to 0 set the icon of bkgnd btn "lockUnlock" to "Locked" pass closeCard end closeCard on showCalculator get visible of bg button "Calc" 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 lock screen get hilite of bg button "»Metric" if it is false then show bg button "ml » cup" show bg button "ml » tbsp" show bg button "ml » tsp" show bg button "g » oz" show bg button "g » lb" else show bg button "cup » ml" show bg button "tbsp » ml" show bg button "tsp » ml" show bg button "oz » g" show bg button "lb » g" end if show bg button "»Metric" show bg button "CalcClose" show bg fld "CalcScr" show bg button "Calc" unlock screen select line 1 of bg fld "CalcScr" end showCalculator on hideCalculator set hilite of bg button "CalcClose" to false get visible of bg button "Calc" if it is false then exit hideCalculator lock screen get hilite of bg button "»Metric" if it is false then hide bg button "ml » cup" hide bg button "ml » tbsp" hide bg button "ml » tsp" hide bg button "g » oz" hide bg button "g » lb" else hide bg button "cup » ml" hide bg button "tbsp » ml" hide bg button "tsp » ml" hide bg button "oz » g" hide bg button "lb » g" end if hide bg button "»Metric" hide bg button "CalcClose" hide bg fld "CalcScr" hide bg button "Calc" end hideCalculator -- part 9 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=237 top=301 right=326 bottom=264 -- title width / last selected line: 0 -- icon id / first selected line: 1014 / 1014 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev ----- HyperTalk script ----- on mouseUp visual effect wipe right lock screen go to previous card end mouseUp -- part 10 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=276 top=301 right=326 bottom=303 -- title width / last selected line: 0 -- icon id / first selected line: 1013 / 1013 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp visual effect wipe left lock screen go to next card end mouseUp -- part 11 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=39 top=301 right=325 bottom=68 -- title width / last selected line: 0 -- icon id / first selected line: 21700 / 21700 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Home ----- HyperTalk script ----- on mouseUp visual effect iris open go Home end mouseUp -- part 12 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=463 top=300 right=328 bottom=494 -- title width / last selected line: 0 -- icon id / first selected line: 1012 / 1012 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Return ----- HyperTalk script ----- on mouseUp visual effect iris close pop card end mouseUp -- part 13 (field) -- low flags: 03 -- high flags: 6007 -- rect: left=41 top=56 right=301 bottom=493 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 22 -- text size: 12 -- style flags: 0 -- line height: 14 -- part name: Recipe ----- HyperTalk script ----- on mouseUp if the short name of this card is "ContentsCard" then push this card set cursor to watch markText the clickLoc end if end mouseUp on markText t1 if target is empty then exit to HyperCard -- Figure out what line is selected and find the right card put trunc((item 2 of t1 - top of target + scroll of target) div textHeight of target) + 1 into theLine select line theLine of field "Recipe" get the selectedText -- get the title delete word 1 to 2 of it if first word of it is "•" then delete first word of it find words it in field "Title" end markText -- part 14 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=41 top=31 right=54 bottom=493 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 18 -- style flags: 0 -- line height: 24 -- part name: Title -- part 15 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=307 top=305 right=326 bottom=463 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 16 -- part name: Type ----- HyperTalk script ----- on mouseUp get fld "Type" find word it in fld "Type" find word it in fld "Type" end mouseUp -- part 19 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=67 top=302 right=324 bottom=91 -- title width / last selected line: 0 -- icon id / first selected line: 19678 / 19678 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Show Credits ----- HyperTalk script ----- on mouseUp show fld "Credits" end mouseUp -- part 20 (field) -- low flags: 81 -- high flags: 2002 -- rect: left=52 top=58 right=175 bottom=471 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Credits ----- HyperTalk script ----- on MouseUp hide fld "Credits" end MouseUp -- part 21 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=91 top=302 right=323 bottom=115 -- title width / last selected line: 0 -- icon id / first selected line: 24317 / 24317 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp go to card id 3631 end mouseUp -- part 24 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=0 top=0 right=12 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Menubar ----- HyperTalk script ----- on mouseEnter put item 3 of the screenRect into screenWidth if screenWidth <= 512 then show menubar end mouseEnter on mouseLeave put item 3 of the screenRect into screenWidth if screenWidth <= 512 then hide menubar end mouseLeave -- part 25 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=115 top=302 right=324 bottom=145 -- title width / last selected line: 0 -- icon id / first selected line: 3430 / 3430 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp push this card go to card id 12994 end mouseUp -- part 26 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=473 top=33 right=51 bottom=489 -- title width / last selected line: 0 -- icon id / first selected line: 104 / 104 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: lockUnlock ----- HyperTalk script ----- on mouseUp global saveText, saveID set the icon of me to "Unlocked" --show unlocked padlock set lockText of field "Recipe" to false set lockText of field "Title" to false set lockText of field "Type" to false set lockText of field "Credits" to false end mouseUp -- part 28 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=168 top=302 right=325 bottom=193 -- title width / last selected line: 0 -- icon id / first selected line: 128 / 128 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp answer "Print this recipe?" with "Yes" or "No" if it is "Yes" then printOut end if end mouseUp -- part 30 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=144 top=302 right=328 bottom=169 -- title width / last selected line: 0 -- icon id / first selected line: 129 / 129 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp showCalculator end mouseUp -- part 36 (button) -- low flags: 80 -- high flags: 0003 -- rect: left=357 top=199 right=339 bottom=465 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Calc -- part 33 (button) -- low flags: 80 -- high flags: A004 -- rect: left=364 top=240 right=255 bottom=459 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ml È cup ----- HyperTalk script ----- -- 1 cup = 250 ml -- 1 tbsp = 15 ml -- 1 tsp = 4 ml -- 1 lb = 454 g -- 1 ounce = 28.349 g on mouseUp get hilite of bg button "»Metric" if it is true then set numberFormat to "0" put first word of fld "CalcScr" * 250 into fld "CalcScr" else set numberFormat to "0.##" put first word of fld "CalcScr" / 250 into fld "CalcScr" end if select line 1 of bg fld "CalcScr" end mouseUp -- part 32 (field) -- low flags: 80 -- high flags: 4002 -- rect: left=363 top=217 right=236 bottom=460 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 3 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: CalcScr -- part 37 (button) -- low flags: 80 -- high flags: A005 -- rect: left=362 top=320 right=336 bottom=457 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ÈMetric ----- HyperTalk script ----- on mouseUp lock screen get hilite of bg button "»Metric" if it is true then set name of bg button "ml » cup" to "cup » ml" set name of bg button "ml » tbsp" to "tbsp » ml" set name of bg button "ml » tsp" to "tsp » ml" set name of bg button "g » oz" to "oz » g" set name of bg button "g » lb" to "lb » g" else set name of bg button "cup » ml" to "ml » cup" set name of bg button "tbsp » ml" to "ml » tbsp" set name of bg button "tsp » ml" to "ml » tsp" set name of bg button "oz » g" to "g » oz" set name of bg button "lb » g" to "g » lb" end if end mouseUp -- part 39 (button) -- low flags: 80 -- high flags: A004 -- rect: left=364 top=256 right=271 bottom=459 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ml È tbsp ----- HyperTalk script ----- -- 1 cup = 250 ml -- 1 tbsp = 15 ml -- 1 tsp = 4 ml -- 1 lb = 454 g -- 1 ounce = 28.349 g on mouseUp get hilite of bg button "»Metric" if it is true then set numberFormat to "0" put first word of fld "CalcScr" * 15 into fld "CalcScr" else set numberFormat to "0.##" put first word of fld "CalcScr" / 15 into fld "CalcScr" end if select line 1 of bg fld "CalcScr" end mouseUp -- part 40 (button) -- low flags: 80 -- high flags: A004 -- rect: left=364 top=272 right=287 bottom=459 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ml È tsp ----- HyperTalk script ----- -- 1 cup = 250 ml -- 1 tbsp = 15 ml -- 1 tsp = 4 ml -- 1 lb = 454 g -- 1 ounce = 28.349 g on mouseUp get hilite of bg button "»Metric" if it is true then set numberFormat to "0" put first word of fld "CalcScr" * 4 into fld "CalcScr" else set numberFormat to "0.##" put first word of fld "CalcScr" / 4 into fld "CalcScr" end if select line 1 of bg fld "CalcScr" end mouseUp -- part 41 (button) -- low flags: 80 -- high flags: A004 -- rect: left=364 top=288 right=303 bottom=459 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: g È oz ----- HyperTalk script ----- -- 1 cup = 250 ml -- 1 tbsp = 15 ml -- 1 tsp = 4 ml -- 1 lb = 454 g -- 1 ounce = 28.349 g on mouseUp get hilite of bg button "»Metric" if it is true then set numberFormat to "0" put first word of fld "CalcScr" * 28.349 into fld "CalcScr" else set numberFormat to "0.##" put first word of fld "CalcScr" / 28.349 into fld "CalcScr" end if select line 1 of bg fld "CalcScr" end mouseUp -- part 42 (button) -- low flags: 80 -- high flags: A004 -- rect: left=364 top=304 right=319 bottom=459 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: g È lb ----- HyperTalk script ----- -- 1 cup = 250 ml -- 1 tbsp = 15 ml -- 1 tsp = 4 ml -- 1 lb = 454 g -- 1 ounce = 28.349 g on mouseUp get hilite of bg button "»Metric" if it is true then set numberFormat to "0" put first word of fld "CalcScr" * 454 into fld "CalcScr" else set numberFormat to "0.##" put first word of fld "CalcScr" / 454 into fld "CalcScr" end if select line 1 of bg fld "CalcScr" end mouseUp -- part 43 (button) -- low flags: 80 -- high flags: 2005 -- rect: left=361 top=200 right=216 bottom=379 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: CalcClose ----- HyperTalk script ----- on mouseUp hideCalculator end mouseUp -- part 44 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=195 top=302 right=331 bottom=229 -- title width / last selected line: 0 -- icon id / first selected line: 130 / 130 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp answer "Sort all cards of this stack according to:" with "Title" or "Category" or "Cancel" if it is "Title" then sort by first line of field "Title" else if it is "Category" then sort by first word of first line of field "Type" end mouseUp