home *** CD-ROM | disk | FTP | other *** search
/ Better Homes & Gardens: …oking for Today - Chicken / Image.iso / pc / recipes.dxr / 00001_movie.ls next >
Encoding:
Text File  |  1995-11-20  |  24.5 KB  |  846 lines

  1. on startMovie
  2.   global gOldPage1, gOldPage2, gOldPage4, gNotesAllSpr, gNotesCurrentSpr, gShowCurrentNote, gBeautySprite, gMaskSprite, gBlurbSprite, gInstructionSprite, gIngredientSprite, gTitleSprite, gChapterSprite, gPageNumSprite, gServingsSprite, gPrepTimeSprite, gTipSprite1, gTipSprite2, gTipTextSprite, gZoomSprite, gZoomBox, gNutritionSprite, gLinked, gHyperTerm, gHelpSprite, gCurrentBook, gCurrentRecipe, gCurrentRecipeFrame, gRecipeIDDB, gPersonalIDDB, gCFTBook, gBrowserMin, gBrowserMax, gCurrentBrowser, gBrowserNum, gBrowseChooser, gPersonalBrowser, gRecipesFoundBrowser, gPastaBrowser, gVegiBrowser, gStirBrowser, gChickBrowser, gWantGeneralInfo
  3.   set gFirstRecipeRun to 0
  4.   set the textHeight of field "servings" to 16
  5.   set the textSize of field "servings" to 12
  6.   set the textStyle of field "servings" to "plain"
  7.   set the textHeight of field "prep time" to 16
  8.   set the textSize of field "prep time" to 12
  9.   set the textStyle of field "prep time" to "plain"
  10.   set the textHeight of field "instructions" to 14
  11.   set the textSize of field "instructions" to 12
  12.   set the textStyle of field "instructions" to "plain"
  13.   set the textHeight of field "ingredients" to 14
  14.   set the textSize of field "ingredients" to 12
  15.   set the textStyle of field "ingredients" to "bold"
  16.   set the textHeight of field "blurb" to 14
  17.   set the textSize of field "blurb" to 12
  18.   set the textStyle of field "blurb" to "bold"
  19.   set the backColor of cast 121 to 243
  20.   set the textHeight of field "notes scroll" to 14
  21.   set the textStyle of field "notes scroll" to "plain"
  22.   set the textSize of field "notes scroll" to 12
  23.   if the machineType = 256 then
  24.     set the textFont of field "servings" to "arial"
  25.     set the textFont of field "prep time" to "arial"
  26.     set the textFont of field "instructions" to "arial"
  27.     set the textFont of field "ingredients" to "arial"
  28.     set the textFont of field "blurb" to "arial"
  29.     set the textFont of field "notes scroll" to "arial"
  30.   else
  31.     set the textFont of field "servings" to "helvetica"
  32.     set the textFont of field "prep time" to "helvetica"
  33.     set the textFont of field "instructions" to "helvetica"
  34.     set the textFont of field "ingredients" to "helvetica"
  35.     set the textFont of field "blurb" to "helvetica"
  36.     set the textFont of field "notes scroll" to "helvetica"
  37.   end if
  38.   set gNotesCurrentSpr to 4
  39.   set gNotesAllSpr to 5
  40.   set gShowCurrentNote to 1
  41.   set gBeautySprite to 16
  42.   set gBlurbSprite to 45
  43.   set gMaskSprite to 24
  44.   set gInstructionSprite to 2
  45.   set gIngredientSprite to 3
  46.   set gTitleSprite to 44
  47.   set gChapterSprite to 30
  48.   set gPageNumSprite to 31
  49.   set gServingsSprite to 32
  50.   set gPrepTimeSprite to 33
  51.   set gTipTextSprite to 2
  52.   set gZoomSprite to 47
  53.   set gZoomBox to 48
  54.   set gNutritionSprite to 27
  55.   set gLinked to 0
  56.   set gHyperTerm to 0
  57.   set gHelpSprite to 46
  58.   helpOff()
  59.   if gCurrentBook = "personal" then
  60.     put "Personal Recipes" into field "book"
  61.     if gBrowseChooser = 1 then
  62.       set gBrowserMin to 1
  63.       set gBrowserMax to count(gRecipesFoundBrowser)
  64.       set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  65.       set gBrowserNum to getProp(gRecipesFoundBrowser, recipeName)
  66.       set gCurrentBrowser to gRecipesFoundBrowser
  67.       set gBrowseChooser to 0
  68.     else
  69.       set gBrowserMin to 1
  70.       set gBrowserMax to count(gPersonalBrowser)
  71.       put gCurrentRecipe
  72.       set recipeName to getOne(gPersonalIDDB, gCurrentRecipe)
  73.       put recipeName
  74.       if recipeName = 0 then
  75.         set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  76.       end if
  77.       set gCurrentRecipe to getProp(gPersonalIDDB, recipeName)
  78.       set gBrowserNum to getProp(gPersonalBrowser, recipeName)
  79.       set gCurrentBrowser to gPersonalBrowser
  80.     end if
  81.     recipe4()
  82.   else
  83.     if gCurrentBook = "Pasta" then
  84.       put "Cooking for Today - Pasta" into field "book"
  85.       if gBrowseChooser = 1 then
  86.         set gBrowserMin to 1
  87.         set gBrowserMax to count(gRecipesFoundBrowser)
  88.         set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  89.         set gBrowserNum to getProp(gRecipesFoundBrowser, recipeName)
  90.         set gCurrentBrowser to gRecipesFoundBrowser
  91.         set gBrowseChooser to 0
  92.       else
  93.         set gBrowserMin to 1
  94.         set gBrowserMax to 71
  95.         set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  96.         set gBrowserNum to getProp(gPastaBrowser, recipeName)
  97.         set gCurrentBrowser to gPastaBrowser
  98.       end if
  99.       do(gCurrentRecipeFrame)
  100.     else
  101.       if gCurrentBook = "Vegi" then
  102.         put "Cooking for Today - Vegetarian" into field "book"
  103.         if gBrowseChooser = 1 then
  104.           set gBrowserMin to 1
  105.           set gBrowserMax to count(gRecipesFoundBrowser)
  106.           set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  107.           set gBrowserNum to getProp(gRecipesFoundBrowser, recipeName)
  108.           set gCurrentBrowser to gRecipesFoundBrowser
  109.           set gBrowseChooser to 0
  110.         else
  111.           set gBrowserMin to 1
  112.           set gBrowserMax to 68
  113.           set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  114.           set gBrowserNum to getProp(gVegiBrowser, recipeName)
  115.           set gCurrentBrowser to gVegiBrowser
  116.         end if
  117.         do(gCurrentRecipeFrame)
  118.       else
  119.         if gCurrentBook = "Stir" then
  120.           put "Cooking for Today - Stir Fries" into field "book"
  121.           if gBrowseChooser = 1 then
  122.             set gBrowserMin to 1
  123.             set gBrowserMax to count(gRecipesFoundBrowser)
  124.             set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  125.             set gBrowserNum to getProp(gRecipesFoundBrowser, recipeName)
  126.             set gCurrentBrowser to gRecipesFoundBrowser
  127.             set gBrowseChooser to 0
  128.           else
  129.             set gBrowserMin to 1
  130.             set gBrowserMax to 68
  131.             set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  132.             set gBrowserNum to getProp(gStirBrowser, recipeName)
  133.             set gCurrentBrowser to gStirBrowser
  134.           end if
  135.           do(gCurrentRecipeFrame)
  136.         else
  137.           if gCurrentBook = "Chick" then
  138.             put "Cooking for Today - Chicken" into field "book"
  139.             if gBrowseChooser = 1 then
  140.               set gBrowserMin to 1
  141.               set gBrowserMax to count(gRecipesFoundBrowser)
  142.               set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  143.               set gBrowserNum to getProp(gRecipesFoundBrowser, recipeName)
  144.               set gCurrentBrowser to gRecipesFoundBrowser
  145.               set gBrowseChooser to 0
  146.             else
  147.               set gBrowserMin to 1
  148.               set gBrowserMax to 68
  149.               set recipeName to getOne(gRecipeIDDB, gCurrentRecipe)
  150.               set gBrowserNum to getProp(gChickBrowser, recipeName)
  151.               set gCurrentBrowser to gChickBrowser
  152.             end if
  153.             do(gCurrentRecipeFrame)
  154.           end if
  155.         end if
  156.       end if
  157.     end if
  158.   end if
  159. end
  160.  
  161. on stopMovie
  162.   unLoadCast()
  163.   helpOff()
  164.   cleanLegos()
  165. end
  166.  
  167. on recipe
  168.   global gCurrentBook, gCFTBook
  169.   if gCurrentBook = "personal" then
  170.     recipe4()
  171.   else
  172.     if gCurrentBook = gCFTBook then
  173.       recipe2()
  174.     else
  175.       if gCFTBook = "Bundle" then
  176.         recipe2()
  177.       end if
  178.     end if
  179.   end if
  180. end
  181.  
  182. on recipe1
  183.   helpOff()
  184.   beautyOff()
  185.   blurbOff()
  186.   titleOff()
  187.   cleanLegos()
  188.   go("recipe1")
  189.   makeButtons1()
  190.   updateDB()
  191. end
  192.  
  193. on recipe2
  194.   helpOff()
  195.   zoomOff()
  196.   titleOff()
  197.   textOff()
  198.   nutritionOff()
  199.   cleanLegos()
  200.   go("recipe2")
  201.   makeScroll2()
  202.   makeButtons2()
  203.   updateDB()
  204. end
  205.  
  206. on recipe4
  207.   titleOff()
  208.   textOff()
  209.   cleanLegos()
  210.   go("recipe4")
  211.   makeScroll2()
  212.   makeButtons2()
  213.   updateDB()
  214. end
  215.  
  216. on browseRight
  217.   global gCurrentBook, gCurrentRecipe, gRecipeIDDB, gPersonalIDDB, gBrowserNum, gBrowserMin, gBrowserMax, gCurrentBrowser, gBrowseChooser
  218.   if gBrowserNum < gBrowserMax then
  219.     set gBrowserNum to gBrowserNum + 1
  220.   else
  221.     set gBrowserNum to gBrowserMin
  222.   end if
  223.   set recipeName to getOne(gCurrentBrowser, gBrowserNum)
  224.   if gCurrentBook = "personal" then
  225.     set gCurrentRecipe to getProp(gPersonalIDDB, recipeName)
  226.   else
  227.     set gCurrentRecipe to getProp(gRecipeIDDB, recipeName)
  228.   end if
  229.   pageInvisible()
  230.   updateDB()
  231. end
  232.  
  233. on browseLeft
  234.   global gCurrentBook, gCurrentRecipe, gRecipeIDDB, gPersonalIDDB, gBrowserNum, gBrowserMin, gBrowserMax, gCurrentBrowser
  235.   if gBrowserNum > gBrowserMin then
  236.     set gBrowserNum to gBrowserNum - 1
  237.   else
  238.     set gBrowserNum to gBrowserMax
  239.   end if
  240.   set recipeName to getOne(gCurrentBrowser, gBrowserNum)
  241.   if gCurrentBook = "personal" then
  242.     set gCurrentRecipe to getProp(gPersonalIDDB, recipeName)
  243.   else
  244.     set gCurrentRecipe to getProp(gRecipeIDDB, recipeName)
  245.   end if
  246.   pageInvisible()
  247.   updateDB()
  248. end
  249.  
  250. on pageInvisible
  251.   if the frame = label("recipe1") then
  252.     beautyOff()
  253.     blurbOff()
  254.     titleOff()
  255.   else
  256.     if the frame = label("recipe2") then
  257.       titleOff()
  258.       textOff()
  259.     else
  260.       if the frame = label("recipe4") then
  261.         titleOff()
  262.         textOff()
  263.       end if
  264.     end if
  265.   end if
  266. end
  267.  
  268. on updateDB
  269.   global gHypertextButton, gCurrentRecipe, gOldPage1, gOldPage2, gOldPage3, gOldPage4, gOldPage5, gScroll1, gScroll2, gScroll3
  270.   unSelect(gHypertextButton)
  271.   unHyperLink()
  272.   if the frame = label("recipe1") then
  273.     DBrecipePage1()
  274.     beautyOn()
  275.     blurbOn()
  276.     titleOn()
  277.     set gOldPage1 to gCurrentRecipe
  278.   else
  279.     if the frame = label("recipe2") then
  280.       controlPosition(gScroll1, 0.0)
  281.       controlPosition(gScroll2, 0.0)
  282.       DBRecipePage2()
  283.       titleOn()
  284.       textOn()
  285.       nutritionOn()
  286.       set gOldPage2 to gCurrentRecipe
  287.     else
  288.       if the frame = label("recipe4") then
  289.         controlPosition(gScroll1, 0.0)
  290.         controlPosition(gScroll2, 0.0)
  291.         DBRecipePage4()
  292.         titleOn()
  293.         textOn()
  294.         set gOldPage4 to gCurrentRecipe
  295.       end if
  296.     end if
  297.   end if
  298. end
  299.  
  300. on setCurrentBook
  301.   global gCurrentRecipe, gCurrentBook
  302.   if (gCurrentRecipe > 1700) and (gCurrentRecipe < 1773) then
  303.     set gCurrentBook to "Pasta"
  304.   else
  305.     if (gCurrentRecipe > 1800) and (gCurrentRecipe < 1869) then
  306.       set gCurrentBook to "Vegi"
  307.     else
  308.       if (gCurrentRecipe > 1900) and (gCurrentRecipe < 1969) then
  309.         set gCurrentBook to "Stir"
  310.       else
  311.         if (gCurrentRecipe > 2000) and (gCurrentRecipe < 2069) then
  312.           set gCurrentBook to "Chick"
  313.         end if
  314.       end if
  315.     end if
  316.   end if
  317. end
  318.  
  319. on updateBeauty fileName
  320.   global gCurrentBook, gBeautySprite, gBlurbSprite
  321.   setCurrentBook()
  322.   if gCurrentBook = "Pasta" then
  323.     set aFolder to "PASTA"
  324.     updateStage()
  325.     loadPIC("BEAUTY", aFolder, fileName, "beauty")
  326.   else
  327.     if gCurrentBook = "Vegi" then
  328.       set aFolder to "VEGI"
  329.       updateStage()
  330.       loadPIC("BEAUTY", aFolder, fileName, "beauty")
  331.     else
  332.       if gCurrentBook = "Stir" then
  333.         set aFolder to "STIR"
  334.         updateStage()
  335.         loadPIC("BEAUTY", aFolder, fileName, "beauty")
  336.       else
  337.         if gCurrentBook = "Chick" then
  338.           set aFolder to "CHICK"
  339.           updateStage()
  340.           loadPIC("BEAUTY", aFolder, fileName, "beauty")
  341.         end if
  342.       end if
  343.     end if
  344.   end if
  345.   set the visible of sprite gBlurbSprite to 1
  346.   set the visible of sprite gBeautySprite to 1
  347. end
  348.  
  349. on updateMethod1
  350. end
  351.  
  352. on updateMethod2
  353. end
  354.  
  355. on updateTip1
  356. end
  357.  
  358. on updateTip2
  359. end
  360.  
  361. on makeScroll2
  362.   global gCurrentBook, gScroll1, gScroll2, gInstructionSprite, gIngredientSprite, gMethodSprite1, gMethodSprite2
  363.   set track to new("Button", [#spriteChan: 16])
  364.   set ball to new("Button", [#spriteChan: 17, #pressedCast: 56])
  365.   set up to new("Button", [#spriteChan: 18, #pressedCast: 58])
  366.   set down to new("Button", [#spriteChan: 19, #pressedCast: 60])
  367.   set gScroll1 to new("ScrollBar", [#scrollSprite: gIngredientSprite, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  368.   set links to [gMethodSprite1, gMethodSprite2]
  369.   set track to new("Button", [#spriteChan: 20])
  370.   set ball to new("Button", [#spriteChan: 21, #pressedCast: 56])
  371.   set up to new("Button", [#spriteChan: 22, #pressedCast: 58])
  372.   set down to new("Button", [#spriteChan: 23, #pressedCast: 60])
  373.   set gScroll2 to new("ScrollBar", [#scrollSprite: gInstructionSprite, #scrollLinks: links, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  374. end
  375.  
  376. on makeScroll3
  377.   global gScroll3, gTipSprite1, gTipSprite2, gTipTextSprite
  378.   set links to [gTipSprite1, gTipSprite2]
  379.   set track to new("Button", [#spriteChan: 16])
  380.   set ball to new("Button", [#spriteChan: 17, #pressedCast: 56])
  381.   set up to new("Button", [#spriteChan: 18, #pressedCast: 58])
  382.   set down to new("Button", [#spriteChan: 19, #pressedCast: 60])
  383.   set gScroll3 to new("ScrollBar", [#scrollSprite: gTipTextSprite, #scrollLinks: links, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  384. end
  385.  
  386. on zoomRoll2
  387. end
  388.  
  389. on zoomRoll3
  390. end
  391.  
  392. on zoomMethod1
  393. end
  394.  
  395. on zoomMethod2
  396. end
  397.  
  398. on zoomTip1
  399. end
  400.  
  401. on zoomTip2
  402. end
  403.  
  404. on zoomOn
  405. end
  406.  
  407. on zoomToggle
  408. end
  409.  
  410. on zoomOff
  411. end
  412.  
  413. on titleOn
  414.   global gTitleSprite, gChapterSprite
  415.   set the visible of sprite gTitleSprite to 1
  416.   set the visible of sprite gChapterSprite to 1
  417. end
  418.  
  419. on titleOff
  420.   global gTitleSprite, gChapterSprite
  421.   set the visible of sprite gTitleSprite to 0
  422.   set the visible of sprite gChapterSprite to 0
  423. end
  424.  
  425. on beautyOn
  426.   global gBeautySprite
  427.   set the visible of sprite gBeautySprite to 1
  428. end
  429.  
  430. on beautyOff
  431.   global gBeautySprite
  432.   set the visible of sprite gBeautySprite to 0
  433. end
  434.  
  435. on blurbOn
  436.   global gBlurbSprite
  437.   set the visible of sprite gBlurbSprite to 1
  438. end
  439.  
  440. on blurbOff
  441.   global gBlurbSprite
  442.   set the visible of sprite gBlurbSprite to 0
  443. end
  444.  
  445. on setMethods
  446. end
  447.  
  448. on methodsOn
  449. end
  450.  
  451. on methodsOff
  452. end
  453.  
  454. on setTips
  455. end
  456.  
  457. on tipOn
  458. end
  459.  
  460. on tipOff
  461. end
  462.  
  463. on textOn
  464.   global gInstructionSprite, gIngredientSprite, gServingsSprite, gPrepTimeSprite
  465.   set the visible of sprite gInstructionSprite to 1
  466.   set the visible of sprite gIngredientSprite to 1
  467.   set the visible of sprite gServingsSprite to 1
  468.   set the visible of sprite gPrepTimeSprite to 1
  469.   set the visible of sprite 26 to 1
  470. end
  471.  
  472. on textOff
  473.   global gInstructionSprite, gIngredientSprite, gServingsSprite, gPrepTimeSprite
  474.   set the visible of sprite gInstructionSprite to 0
  475.   set the visible of sprite gIngredientSprite to 0
  476.   set the visible of sprite gServingsSprite to 0
  477.   set the visible of sprite gPrepTimeSprite to 0
  478.   set the visible of sprite 26 to 0
  479. end
  480.  
  481. on nutritionOn
  482.   global gCurrentBook, gNutritionSprite
  483.   set the visible of sprite gNutritionSprite to 1
  484. end
  485.  
  486. on nutritionOff
  487.   global gNutritionSprite
  488.   set the visible of sprite gNutritionSprite to 0
  489. end
  490.  
  491. on notes
  492.   global gCurrentRecipe, gDBResult
  493.   cleanLegos()
  494.   DBBeginSaveSession()
  495.   DBGetSetRecord(gCurrentRecipe, 0)
  496.   if gDBResult = 0 then
  497.     set note to DBGetSetField(20000)
  498.   end if
  499.   put note into field "notes"
  500.   put note into field "save notes"
  501.   put note into field "notes scroll"
  502.   go("notes")
  503.   makeNotesScroll()
  504.   makeNotesButtons()
  505.   DBEndSession()
  506. end
  507.  
  508. on getnotes
  509.   global gCurrentRecipe, gDBResult, gCurrentNote
  510.   set gCurrentNote to EMPTY
  511.   DBBeginSaveSession()
  512.   DBGetSetRecord(gCurrentRecipe, 0)
  513.   if gDBResult = 0 then
  514.     set gCurrentNote to DBGetSetField(20000)
  515.   end if
  516.   DBEndSession()
  517. end
  518.  
  519. on currentnote
  520.   global gCurrentRecipe, gDBResult
  521.   DBBeginSaveSession()
  522.   DBGetSetRecord(gCurrentRecipe, 0)
  523.   if gDBResult = 0 then
  524.     set note to DBGetSetField(20000)
  525.   end if
  526.   put note into field "notes"
  527.   put note into field "save notes"
  528.   put note into field "notes scroll"
  529.   controlPosition(gNotesScroll, 0.0)
  530.   DBEndSession()
  531. end
  532.  
  533. on showAllNotes
  534.   global gCurrentRecipe, gDBResult, gShowCurrentNote, gRecipeIDDB, gPersonalIDDB, gRecipesAvailableList
  535.   DBBeginSaveSession()
  536.   put EMPTY into field "allnotes"
  537.   cursor(4)
  538.   put field "notes" into field "save notes"
  539.   repeat with i in gRecipesAvailableList
  540.     DBGetSetRecord(i, 0)
  541.     if gDBResult = 0 then
  542.       set note to DBGetSetField(20000)
  543.       put getOne(gRecipeIDDB, i) after field "allnotes"
  544.       put ":" after field "allnotes"
  545.       put RETURN after field "allnotes"
  546.       put RETURN after field "allnotes"
  547.       put note after field "allnotes"
  548.       put RETURN after field "allnotes"
  549.       put RETURN after field "allnotes"
  550.       put RETURN after field "allnotes"
  551.       next repeat
  552.     end if
  553.     nothing()
  554.   end repeat
  555.   repeat with i in gPersonalIDDB
  556.     DBGetSetRecord(i, 0)
  557.     if gDBResult = 0 then
  558.       set note to DBGetSetField(20000)
  559.       put getOne(gPersonalIDDB, i) after field "allnotes"
  560.       put ":" after field "allnotes"
  561.       put RETURN after field "allnotes"
  562.       put RETURN after field "allnotes"
  563.       put note after field "allnotes"
  564.       put RETURN after field "allnotes"
  565.       put RETURN after field "allnotes"
  566.       put RETURN after field "allnotes"
  567.       next repeat
  568.     end if
  569.     nothing()
  570.   end repeat
  571.   cursor(-1)
  572.   if field "allnotes" <> EMPTY then
  573.     put field "allnotes" into field "notes scroll"
  574.     put field "allnotes" into field "notes"
  575.   else
  576.     nothing()
  577.   end if
  578.   controlPosition(gNotesScroll, 0.0)
  579.   DBEndSession()
  580. end
  581.  
  582. on makeNotesButtons
  583.   global gNotesAllSpr, gNotesCurrentSpr, gShowCurrentNote
  584.   puppetSprite(gNotesCurrentSpr, 1)
  585.   puppetSprite(gNotesAllSpr, 1)
  586.   if gShowCurrentNote then
  587.     set the castNum of sprite gNotesCurrentSpr to 117
  588.     set the castNum of sprite gNotesAllSpr to 114
  589.   else
  590.     set the castNum of sprite gNotesCurrentSpr to 116
  591.     set the castNum of sprite gNotesAllSpr to 115
  592.   end if
  593.   updateStage()
  594. end
  595.  
  596. on radioButton spriteNum
  597.   puppetSprite(spriteNum, 1)
  598.   set buttonList to []
  599.   set myCast to the castNum of sprite spriteNum
  600.   set pressedCast to myCast + 1
  601.   add(buttonList, spriteNum)
  602.   add(buttonList, myCast)
  603.   add(buttonList, pressedCast)
  604.   return buttonList
  605. end
  606.  
  607. on radioDown buttonList
  608.   set mySprite to getAt(buttonList, 1)
  609.   set myCast to getAt(buttonList, 2)
  610.   set pressedCast to getAt(buttonList, 3)
  611.   set the castNum of sprite mySprite to pressedCast
  612.   repeat while the mouseDown
  613.     if rollOver(mySprite) then
  614.       set the castNum of sprite mySprite to pressedCast
  615.     else
  616.       set the castNum of sprite mySprite to myCast
  617.     end if
  618.     updateStage()
  619.   end repeat
  620. end
  621.  
  622. on radioUp buttonList
  623.   global gLastRadioButton
  624.   set mySprite to getAt(buttonList, 1)
  625.   set myCast to getAt(buttonList, 2)
  626.   set pressedCast to getAt(buttonList, 3)
  627.   if the castNum of sprite mySprite = pressedCast then
  628.     if objectp(gLastRadioButton) then
  629.       unSelect(gLastRadioButton)
  630.     end if
  631.     set gLastRadioButton to buttonList
  632.     return 1
  633.   else
  634.     return 0
  635.   end if
  636. end
  637.  
  638. on radioSelect buttonList
  639.   global gLastRadioButton
  640.   set gLastRadioButton to EMPTY
  641.   radioDown(buttonList)
  642.   radioUp(buttonList)
  643. end
  644.  
  645. on radioUnselect buttonList
  646.   set mySprite to getAt(buttonList, 1)
  647.   set myCast to getAt(buttonList, 2)
  648.   set the castNum of sprite mySprite to myCast
  649. end
  650.  
  651. on saveNotes
  652.   global gCurrentRecipe
  653.   put field "save notes"
  654.   put field "notes"
  655.   DBBeginSaveSession()
  656.   set note to removeCarrots(field "save notes")
  657.   put note
  658.   if removeSpace(note) <> EMPTY then
  659.     set note to gCurrentRecipe & "^" & note
  660.     put note
  661.     DBSetRecord(0, note)
  662.   else
  663.     DBDeleteRecord(0, gCurrentRecipe)
  664.   end if
  665.   put " " into field "notes"
  666.   put " " into field "save notes"
  667.   put " " into field "notes scroll"
  668.   DBEndSession()
  669. end
  670.  
  671. on makeNotesScroll
  672.   global gNotesScroll, gNotesDoneButton
  673.   set track to new("Button", [#spriteChan: 7])
  674.   set ball to new("Button", [#spriteChan: 8, #pressedCast: 126])
  675.   set up to new("Button", [#spriteChan: 9, #pressedCast: 128])
  676.   set down to new("Button", [#spriteChan: 10, #pressedCast: 130])
  677.   set gNotesScroll to new("ScrollBar", [#scrollField: "notes", #scrollFieldOut: 6, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  678.   set gNotesDoneButton to birth(script "CFTButton", 11)
  679. end
  680.  
  681. on send
  682.   global gShoppingButton, gPersonalButton, gPlannerButton, gOKButton, gCancelButton, gSendShopping, gSendPersonal, gSendPlanner
  683.   cleanLegos()
  684.   go("send")
  685.   set gOKButton to birth(script "checkButton", 7)
  686.   set gCancelButton to birth(script "checkButton", 8)
  687.   set gShoppingButton to birth(script "checkButton", 9)
  688.   set gPersonalButton to birth(script "checkButton", 10)
  689.   set gPlannerButton to birth(script "checkButton", 11)
  690.   if gSendShopping then
  691.     select(gShoppingButton)
  692.   end if
  693.   if gSendPersonal then
  694.     select(gPersonalButton)
  695.   end if
  696.   if gSendPlanner then
  697.     select(gPlannerButton)
  698.   end if
  699. end
  700.  
  701. on sendIt
  702.   global gCurrentRecipe, gSendShopping, gSendPersonal, gSendPlanner, gShoppingTitles, gShoppingIngredients, gShoppingServings, gPersonalRecipes, gPlannerRecipes
  703.   cursor(4)
  704.   set flap to 0
  705.   if gSendShopping and not getPos(gShoppingTitles, field "title") then
  706.     add(gShoppingTitles, field "title")
  707.     add(gShoppingIngredients, DBShopping(gCurrentRecipe))
  708.     add(gShoppingServings, field "servings")
  709.     set flap to 1
  710.   end if
  711.   if gSendPersonal and not getPos(gPersonalRecipes, field "title") then
  712.     add(gPersonalRecipes, field "title")
  713.     set flap to 1
  714.   end if
  715.   if gSendPlanner and not getPos(gPlannerRecipes, field "title") then
  716.     add(gPlannerRecipes, field "title")
  717.     set flap to 1
  718.   end if
  719.   if flap then
  720.     updateStage()
  721.   end if
  722.   cursor(-1)
  723.   recipe()
  724. end
  725.  
  726. on hyperLink
  727.   global gLinked, gRecipeTerms
  728.   if gLinked then
  729.     unHyperLink()
  730.   else
  731.     if not gLinked then
  732.       set gLinked to 1
  733.       set gRecipeTerms to DBRecipeTerms()
  734.       cursor(4)
  735.       repeat with i in gRecipeTerms
  736.         set startPlace to offset(i, field "instructions")
  737.         set endPlace to startPlace + length(i) - 1
  738.         if startPlace <> 0 then
  739.           set the textStyle of char startPlace to endPlace of field "instructions" to "underline"
  740.         end if
  741.       end repeat
  742.       cursor(-1)
  743.     end if
  744.   end if
  745. end
  746.  
  747. on unHyperLink
  748.   global gLinked, gHyperTerm
  749.   set gLinked to 0
  750.   set gHyperTerm to 0
  751.   set the textStyle of field "instructions" to "plain"
  752. end
  753.  
  754. on useHyperLink
  755.   global gHyperTerm
  756.   set aWord to the mouseWord
  757.   if the textStyle of word aWord of field "instructions" = "underline" then
  758.     set termBegin to offset(word aWord of field "instructions", field "instructions")
  759.     set termEnd to termBegin
  760.     repeat while 1
  761.       set termBegin to termBegin - 1
  762.       if the textStyle of char termBegin of field "instructions" <> "underline" then
  763.         set termBegin to termBegin + 1
  764.         exit repeat
  765.       end if
  766.     end repeat
  767.     repeat while 1
  768.       set termEnd to termEnd + 1
  769.       if the textStyle of char termEnd of field "instructions" <> "underline" then
  770.         set gHyperTerm to char termBegin to termEnd - 1 of field "instructions"
  771.         exit repeat
  772.       end if
  773.     end repeat
  774.     toUtility()
  775.   end if
  776. end
  777.  
  778. on makeButtons1
  779.   global gPhotoButton, gRecipeButton
  780.   set gPhotoButton to birth(script "CFTButton", 24)
  781.   set gRecipeButton to birth(script "CFTButton", 28)
  782.   allPageButtons()
  783. end
  784.  
  785. on makeButtons2
  786.   global gHypertextButton, gSendButton, gNotesButton, gPrintButton, gPhotoButton, gRecipeButton
  787.   set gHypertextButton to birth(script "checkButton", 34)
  788.   set gSendButton to birth(script "CFTButton", 35)
  789.   set gNotesButton to birth(script "CFTButton", 36)
  790.   set gPrintButton to birth(script "CFTButton", 37)
  791.   set gPhotoButton to birth(script "CFTButton", 24)
  792.   set gRecipeButton to birth(script "CFTButton", 28)
  793.   allPageButtons()
  794. end
  795.  
  796. on makeButtons3
  797.   global gPhotoButton, gRecipeButton
  798.   set gPhotoButton to birth(script "CFTButton", 24)
  799.   set gRecipeButton to birth(script "CFTButton", 28)
  800.   allPageButtons()
  801. end
  802.  
  803. on allPageButtons
  804.   global gMainButton, gHelpButton, gBackButton, gChooserButton, gPlannerButton, gShoppingButton, gPersonalButton, gUtilityButton, gVideoButton, gCurrentBook, gBrowseLeftButton, gBrowseRightButton, gPhotoButton, gRecipeButton
  805.   set gMainButton to birth(script "CFTButton", 7)
  806.   set gHelpButton to birth(script "CFTButton", 15)
  807.   set gBackButton to birth(script "CFTButton", 8)
  808.   set gChooserButton to birth(script "CFTButton", 9)
  809.   set gPlannerButton to birth(script "CFTButton", 10)
  810.   set gShoppingButton to birth(script "CFTButton", 11)
  811.   set gPersonalButton to birth(script "CFTButton", 12)
  812.   set gUtilityButton to birth(script "CFTButton", 13)
  813.   set gVideoButton to birth(script "CFTButton", 14)
  814.   set gBrowseLeftButton to birth(script "CFTButton", 25)
  815.   set gBrowseRightButton to birth(script "CFTButton", 26)
  816. end
  817.  
  818. on helpOn
  819.   global gLastHelp, gHelpLinks, gHelpActive, gHelpSprite, gCurrentBook
  820.   if gHelpActive then
  821.     helpOff()
  822.   else
  823.     set gHelpActive to 1
  824.     set gLastHelp to 0
  825.     set gHelpLinks to [7: 19, 8: 23, 9: 12, 10: 13, 11: 14, 12: 5, 13: 16, 14: 17, 15: 1, 25: 21, 26: 21, 29: 21, 30: 21]
  826.     if the frame = label("recipe1") then
  827.       addProp(gHelpLinks, 18, 22)
  828.     else
  829.       if the frame = label("recipe2") then
  830.         addProp(gHelpLinks, 32, 101)
  831.         addProp(gHelpLinks, 33, 102)
  832.         addProp(gHelpLinks, 34, 103)
  833.         addProp(gHelpLinks, 35, 25)
  834.         addProp(gHelpLinks, 36, 29)
  835.         addProp(gHelpLinks, 37, 26)
  836.       else
  837.         if the frame = label("recipe4") then
  838.           addProp(gHelpLinks, 36, 29)
  839.           addProp(gHelpLinks, 37, 26)
  840.         end if
  841.       end if
  842.     end if
  843.     puppetSprite(gHelpSprite, 1)
  844.   end if
  845. end
  846.