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

  1. on startMovie
  2.   global gCFTBook, gIngredientButtons, gAlphaRange, gHelpSprite, gCurrentOrAll
  3.   if the machineType = 256 then
  4.     set the textHeight of field ("a-e textcurrent" & gCFTBook) to 14
  5.     set the textSize of field ("a-e textcurrent" & gCFTBook) to 12
  6.     set the textStyle of field ("a-e textcurrent" & gCFTBook) to "plain"
  7.     set the textFont of field ("a-e textcurrent" & gCFTBook) to "arial"
  8.     set the textHeight of field ("f-k textcurrent" & gCFTBook) to 14
  9.     set the textSize of field ("f-k textcurrent" & gCFTBook) to 12
  10.     set the textStyle of field ("f-k textcurrent" & gCFTBook) to "plain"
  11.     set the textFont of field ("f-k textcurrent" & gCFTBook) to "arial"
  12.     set the textHeight of field ("l-o textcurrent" & gCFTBook) to 14
  13.     set the textSize of field ("l-o textcurrent" & gCFTBook) to 12
  14.     set the textStyle of field ("l-o textcurrent" & gCFTBook) to "plain"
  15.     set the textFont of field ("l-o textcurrent" & gCFTBook) to "arial"
  16.     set the textHeight of field ("p-s textcurrent" & gCFTBook) to 14
  17.     set the textSize of field ("p-s textcurrent" & gCFTBook) to 12
  18.     set the textStyle of field ("p-s textcurrent" & gCFTBook) to "plain"
  19.     set the textFont of field ("p-s textcurrent" & gCFTBook) to "arial"
  20.     set the textHeight of field ("t-z textcurrent" & gCFTBook) to 14
  21.     set the textSize of field ("t-z textcurrent" & gCFTBook) to 12
  22.     set the textStyle of field ("t-z textcurrent" & gCFTBook) to "plain"
  23.     set the textFont of field ("t-z textcurrent" & gCFTBook) to "arial"
  24.     set the textHeight of field "a-e textAll" to 14
  25.     set the textSize of field "a-e textAll" to 12
  26.     set the textStyle of field "a-e textAll" to "plain"
  27.     set the textFont of field "a-e textAll" to "arial"
  28.     set the textHeight of field "f-k textAll" to 14
  29.     set the textSize of field "f-k textAll" to 12
  30.     set the textStyle of field "f-k textAll" to "plain"
  31.     set the textFont of field "f-k textAll" to "arial"
  32.     set the textHeight of field "l-o textAll" to 14
  33.     set the textSize of field "l-o textAll" to 12
  34.     set the textStyle of field "l-o textAll" to "plain"
  35.     set the textFont of field "l-o textAll" to "arial"
  36.     set the textHeight of field "p-s textAll" to 14
  37.     set the textSize of field "p-s textAll" to 12
  38.     set the textStyle of field "p-s textAll" to "plain"
  39.     set the textFont of field "p-s textAll" to "arial"
  40.     set the textHeight of field "t-z textAll" to 14
  41.     set the textSize of field "t-z textAll" to 12
  42.     set the textStyle of field "t-z textAll" to "plain"
  43.     set the textFont of field "t-z textAll" to "arial"
  44.     set the textHeight of field "scroll1" to 14
  45.     set the textSize of field "scroll1" to 12
  46.     set the textStyle of field "scroll1" to "plain"
  47.     set the textFont of field "scroll1" to "arial"
  48.     set the textHeight of field "scroll2" to 14
  49.     set the textSize of field "scroll2" to 12
  50.     set the textStyle of field "scroll2" to "plain"
  51.     set the textFont of field "scroll2" to "arial"
  52.     set the textHeight of field "scroll3" to 14
  53.     set the textSize of field "scroll3" to 12
  54.     set the textStyle of field "scroll3" to "plain"
  55.     set the textFont of field "scroll3" to "arial"
  56.     set the textHeight of field "recipes found" to 14
  57.     set the textSize of field "recipes found" to 12
  58.     set the textStyle of field "recipes found" to "plain"
  59.     set the textFont of field "recipes found" to "arial"
  60.   else
  61.     set the textHeight of field ("a-e textcurrent" & gCFTBook) to 14
  62.     set the textSize of field ("a-e textcurrent" & gCFTBook) to 12
  63.     set the textStyle of field ("a-e textcurrent" & gCFTBook) to "plain"
  64.     set the textFont of field ("a-e textcurrent" & gCFTBook) to "helvetica"
  65.     set the textHeight of field ("f-k textcurrent" & gCFTBook) to 14
  66.     set the textSize of field ("f-k textcurrent" & gCFTBook) to 12
  67.     set the textStyle of field ("f-k textcurrent" & gCFTBook) to "plain"
  68.     set the textFont of field ("f-k textcurrent" & gCFTBook) to "helvetica"
  69.     set the textHeight of field ("l-o textcurrent" & gCFTBook) to 14
  70.     set the textSize of field ("l-o textcurrent" & gCFTBook) to 12
  71.     set the textStyle of field ("l-o textcurrent" & gCFTBook) to "plain"
  72.     set the textFont of field ("l-o textcurrent" & gCFTBook) to "helvetica"
  73.     set the textHeight of field ("p-s textcurrent" & gCFTBook) to 14
  74.     set the textSize of field ("p-s textcurrent" & gCFTBook) to 12
  75.     set the textStyle of field ("p-s textcurrent" & gCFTBook) to "plain"
  76.     set the textFont of field ("p-s textcurrent" & gCFTBook) to "helvetica"
  77.     set the textHeight of field ("t-z textcurrent" & gCFTBook) to 14
  78.     set the textSize of field ("t-z textcurrent" & gCFTBook) to 12
  79.     set the textStyle of field ("t-z textcurrent" & gCFTBook) to "plain"
  80.     set the textFont of field ("t-z textcurrent" & gCFTBook) to "helvetica"
  81.     set the textHeight of field "a-e textAll" to 14
  82.     set the textSize of field "a-e textAll" to 12
  83.     set the textStyle of field "a-e textAll" to "plain"
  84.     set the textFont of field "a-e textAll" to "helvetica"
  85.     set the textHeight of field "f-k textAll" to 14
  86.     set the textSize of field "f-k textAll" to 12
  87.     set the textStyle of field "f-k textAll" to "plain"
  88.     set the textFont of field "f-k textAll" to "helvetica"
  89.     set the textHeight of field "l-o textAll" to 14
  90.     set the textSize of field "l-o textAll" to 12
  91.     set the textStyle of field "l-o textAll" to "plain"
  92.     set the textFont of field "l-o textAll" to "helvetica"
  93.     set the textHeight of field "p-s textAll" to 14
  94.     set the textSize of field "p-s textAll" to 12
  95.     set the textStyle of field "p-s textAll" to "plain"
  96.     set the textFont of field "p-s textAll" to "helvetica"
  97.     set the textHeight of field "t-z textAll" to 14
  98.     set the textSize of field "t-z textAll" to 12
  99.     set the textStyle of field "t-z textAll" to "plain"
  100.     set the textFont of field "t-z textAll" to "helvetica"
  101.     set the textHeight of field "scroll1" to 14
  102.     set the textSize of field "scroll1" to 12
  103.     set the textStyle of field "scroll1" to "plain"
  104.     set the textFont of field "scroll1" to "helvetica"
  105.     set the textHeight of field "scroll2" to 14
  106.     set the textSize of field "scroll2" to 12
  107.     set the textStyle of field "scroll2" to "plain"
  108.     set the textFont of field "scroll2" to "helvetica"
  109.     set the textHeight of field "scroll3" to 14
  110.     set the textSize of field "scroll3" to 12
  111.     set the textStyle of field "scroll3" to "plain"
  112.     set the textFont of field "scroll3" to "helvetica"
  113.     set the textHeight of field "recipes found" to 14
  114.     set the textSize of field "recipes found" to 12
  115.     set the textStyle of field "recipes found" to "plain"
  116.     set the textFont of field "recipes found" to "helvetica"
  117.   end if
  118.   DBBeginSearchSession()
  119.   set gIngredientButtons to 8
  120.   set gAlphaRange to "a-e text"
  121.   set gHelpSprite to 48
  122.   helpOff()
  123.   chooser()
  124.   puppetSprite(gIngredientButtons, 1)
  125.   puppetSprite(2, 1)
  126.   puppetSprite(3, 1)
  127.   if gCurrentOrAll = "current" then
  128.     set the castNum of sprite 3 to 83
  129.   else
  130.     set the castNum of sprite 3 to 81
  131.   end if
  132. end
  133.  
  134. on stopMovie
  135.   unLoadCast()
  136.   saveSearchResults()
  137.   DBEndSession()
  138.   cleanLegos()
  139. end
  140.  
  141. on searchAll
  142.   global gScroll1, gAlphaRange, gSearchList, gRecipesAvailableList, gCurrentOrAll
  143.   clearChooser()
  144.   chooserOff()
  145.   set gCurrentOrAll to "All"
  146.   set fieldName to gAlphaRange & "All"
  147.   newScrollField(gScroll1, fieldName)
  148.   controlPosition(gScroll1, 0.0)
  149.   set gSearchList to gRecipesAvailableList
  150.   chooserOn()
  151. end
  152.  
  153. on searchCurrent
  154.   global gScroll1, gAlphaRange, gSearchList, gMyRecipesList, gCurrentOrAll, gCFTBook
  155.   clearChooser()
  156.   chooserOff()
  157.   set gCurrentOrAll to "Current"
  158.   set fieldName to gAlphaRange & "Current" & gCFTBook
  159.   newScrollField(gScroll1, fieldName)
  160.   controlPosition(gScroll1, 0.0)
  161.   set gSearchList to gMyRecipesList
  162.   chooserOn()
  163. end
  164.  
  165. on chooser
  166.   chooserOff()
  167.   go("chooser")
  168.   dishesMenu()
  169.   timesMenu()
  170.   fatMenu()
  171.   saturatedMenu()
  172.   sodiumMenu()
  173.   caloriesMenu()
  174.   carbohydratesMenu()
  175.   cholesterolMenu()
  176.   potassiumMenu()
  177.   makeScrolls()
  178.   makeButtons()
  179.   loadSearchResults()
  180.   chooserOn()
  181. end
  182.  
  183. on clearChooser
  184.   global gIngredientButtons, gScroll1, gScroll2, gScroll3, gDBSearchIngredients, gCurrentOrAll, gAlphaRange, gCFTBook
  185.   set gDBSearchIngredients to []
  186.   chooserOff()
  187.   updateStage()
  188.   set gDBStartSearch to 1
  189.   dishesMenu()
  190.   timesMenu()
  191.   fatMenu()
  192.   saturatedMenu()
  193.   sodiumMenu()
  194.   caloriesMenu()
  195.   carbohydratesMenu()
  196.   cholesterolMenu()
  197.   potassiumMenu()
  198.   put "No Ingredients Selected" into field "ingredients selected"
  199.   put "No Ingredients Selected" into field "scroll2"
  200.   put "0" into field "number found"
  201.   put "No Recipes Found" into field "recipes found"
  202.   put "No Recipes Found" into field "scroll3"
  203.   set the castNum of sprite gIngredientButtons to 21
  204.   set gAlphaRange to "a-e text"
  205.   if gCurrentOrAll = "All" then
  206.     newScrollField(gScroll1, gAlphaRange & gCurrentOrAll)
  207.   else
  208.     newScrollField(gScroll1, gAlphaRange & gCurrentOrAll & gCFTBook)
  209.   end if
  210.   controlPosition(gScroll1, 0.0)
  211.   controlPosition(gScroll2, 0.0)
  212.   controlPosition(gScroll3, 0.0)
  213.   chooserOn()
  214. end
  215.  
  216. on ingredientButtons
  217.   global gIngredientButtons, gScroll1, gCurrentOrAll, gAlphaRange, gCFTBook
  218.   set which to the mouseV
  219.   if which < 93 then
  220.     set the castNum of sprite gIngredientButtons to 21
  221.     set gAlphaRange to "a-e text"
  222.     if gCurrentOrAll = "All" then
  223.       newScrollField(gScroll1, gAlphaRange & gCurrentOrAll)
  224.     else
  225.       newScrollField(gScroll1, gAlphaRange & gCurrentOrAll & gCFTBook)
  226.     end if
  227.   else
  228.     if which < 114 then
  229.       set the castNum of sprite gIngredientButtons to 22
  230.       set gAlphaRange to "f-k text"
  231.       if gCurrentOrAll = "All" then
  232.         newScrollField(gScroll1, gAlphaRange & gCurrentOrAll)
  233.       else
  234.         newScrollField(gScroll1, gAlphaRange & gCurrentOrAll & gCFTBook)
  235.       end if
  236.     else
  237.       if which < 135 then
  238.         set the castNum of sprite gIngredientButtons to 23
  239.         set gAlphaRange to "l-o text"
  240.         if gCurrentOrAll = "All" then
  241.           newScrollField(gScroll1, gAlphaRange & gCurrentOrAll)
  242.         else
  243.           newScrollField(gScroll1, gAlphaRange & gCurrentOrAll & gCFTBook)
  244.         end if
  245.       else
  246.         if which < 156 then
  247.           set the castNum of sprite gIngredientButtons to 24
  248.           set gAlphaRange to "p-s text"
  249.           if gCurrentOrAll = "All" then
  250.             newScrollField(gScroll1, gAlphaRange & gCurrentOrAll)
  251.           else
  252.             newScrollField(gScroll1, gAlphaRange & gCurrentOrAll & gCFTBook)
  253.           end if
  254.         else
  255.           if which < 177 then
  256.             set the castNum of sprite gIngredientButtons to 25
  257.             set gAlphaRange to "t-z text"
  258.             if gCurrentOrAll = "All" then
  259.               newScrollField(gScroll1, gAlphaRange & gCurrentOrAll)
  260.             else
  261.               newScrollField(gScroll1, gAlphaRange & gCurrentOrAll & gCFTBook)
  262.             end if
  263.           end if
  264.         end if
  265.       end if
  266.     end if
  267.   end if
  268.   controlPosition(gScroll1, 0.0)
  269. end
  270.  
  271. on navigationButtons
  272.   set which to the mouseV
  273.   if which < 386 then
  274.     repeat while the mouseDown
  275.       if rollOver(2) then
  276.         set the castNum of sprite 2 to 72
  277.       else
  278.         set the castNum of sprite 2 to 71
  279.       end if
  280.       updateStage()
  281.     end repeat
  282.     if the castNum of sprite 2 <> 71 then
  283.       set the castNum of sprite 2 to 71
  284.       goBack()
  285.     end if
  286.   else
  287.     if which < 430 then
  288.       repeat while the mouseDown
  289.         if rollOver(2) then
  290.           set the castNum of sprite 2 to 73
  291.         else
  292.           set the castNum of sprite 2 to 71
  293.         end if
  294.         updateStage()
  295.       end repeat
  296.       if the castNum of sprite 2 <> 71 then
  297.         set the castNum of sprite 2 to 71
  298.         helpOn()
  299.       end if
  300.     else
  301.       if which < 473 then
  302.         repeat while the mouseDown
  303.           if rollOver(2) then
  304.             set the castNum of sprite 2 to 74
  305.           else
  306.             set the castNum of sprite 2 to 71
  307.           end if
  308.           updateStage()
  309.         end repeat
  310.         if the castNum of sprite 2 <> 71 then
  311.           set the castNum of sprite 2 to 71
  312.           goMain()
  313.         end if
  314.       end if
  315.     end if
  316.   end if
  317. end
  318.  
  319. on addIngredient
  320.   global gScroll2
  321.   set aLine to the mouseLine
  322.   if aLine < 1 then
  323.     exit
  324.   end if
  325.   set theRecipe to line aLine of field "scroll1"
  326.   if theRecipe = EMPTY then
  327.     exit
  328.   end if
  329.   set selectedNum to the number of lines in field "ingredients selected"
  330.   repeat with i = i to selectedNum
  331.     if line i of field "ingredients selected" = theRecipe then
  332.       exit
  333.     end if
  334.   end repeat
  335.   if field "ingredients selected" = "No Ingredients Selected" then
  336.     put theRecipe into field "ingredients selected"
  337.   else
  338.     put theRecipe & RETURN before field "ingredients selected"
  339.   end if
  340.   controlPosition(gScroll2, 0.0)
  341.   DBChooser()
  342. end
  343.  
  344. on deleteIngredient
  345.   if field "ingredients selected" = "No Ingredients Selected" then
  346.     exit
  347.   end if
  348.   set aLine to the mouseLine
  349.   if aLine < 1 then
  350.     exit
  351.   end if
  352.   set theRecipe to line aLine of field "scroll2"
  353.   if theRecipe = EMPTY then
  354.     exit
  355.   end if
  356.   set selectedNum to the number of lines in field "ingredients selected"
  357.   repeat with i = i to selectedNum
  358.     if line i of field "ingredients selected" = theRecipe then
  359.       delete line i of field "ingredients selected"
  360.     end if
  361.   end repeat
  362.   if field "ingredients selected" = EMPTY then
  363.     put "No Ingredients Selected" into field "ingredients selected"
  364.   end if
  365.   controlPosition(gScroll2, 0.0)
  366.   DBChooser()
  367. end
  368.  
  369. on selectRecipe
  370.   global gCurrentBook, gCurrentRecipe, gCurrentRecipeFrame, gBrowseChooser, gRecipeIDDB, gPreCFTRecipeIDDB, gCFTBook
  371.   if field "recipes found" = "Click here to view list" then
  372.     showRecipes()
  373.     exit
  374.   end if
  375.   if field "recipes found" = "No Recipes Found" then
  376.     exit
  377.   end if
  378.   set aLine to the mouseLine
  379.   if aLine < 1 then
  380.     exit
  381.   end if
  382.   set theRecipe to line aLine of field "scroll3"
  383.   if theRecipe = "Click here to see more recipes" then
  384.     put field "second half" into field "recipes Found"
  385.     controlPosition(gScroll3, 0.0)
  386.     exit
  387.   end if
  388.   if theRecipe = "Click here to see more recipes " then
  389.     put field "first half" into field "recipes Found"
  390.     controlPosition(gScroll3, 0.0)
  391.     exit
  392.   end if
  393.   if theRecipe = EMPTY then
  394.     exit
  395.   end if
  396.   if theRecipe = "‚Ä¢ Cooking For Today - Pasta:" then
  397.     exit
  398.   end if
  399.   if theRecipe = "‚Ä¢ Cooking For Today - Vegetarian:" then
  400.     exit
  401.   end if
  402.   if theRecipe = "‚Ä¢ Cooking For Today - Stir Fries:" then
  403.     exit
  404.   end if
  405.   if theRecipe = "‚Ä¢ Cooking For Today - Chicken:" then
  406.     exit
  407.   end if
  408.   if theRecipe = "‚Ä¢ Great American Cooking:" then
  409.     exit
  410.   end if
  411.   if theRecipe = "‚Ä¢ Healthy Cooking:" then
  412.     exit
  413.   end if
  414.   if theRecipe = "‚Ä¢ Food and Wine:" then
  415.     exit
  416.   end if
  417.   set the textStyle of line aLine of field "scroll3" to "bold"
  418.   set recipeNumber to getProp(gRecipeIDDB, theRecipe)
  419.   if recipeNumber > 2069 then
  420.     play movie "noFW"
  421.     exit
  422.   end if
  423.   if recipeNumber < 1701 then
  424.     if recipeNumber < 428 then
  425.       play movie "noHC"
  426.       exit
  427.     else
  428.       play movie "noGAC"
  429.       exit
  430.     end if
  431.   end if
  432.   if gCFTBook = "Pasta" then
  433.     if (recipeNumber > 1800) and (recipeNumber < 1869) then
  434.       play movie "noVegi"
  435.       exit
  436.     end if
  437.     if (recipeNumber > 1900) and (recipeNumber < 1969) then
  438.       play movie "noStir"
  439.       exit
  440.     end if
  441.     if (recipeNumber > 2000) and (recipeNumber < 2069) then
  442.       play movie "noChick"
  443.       exit
  444.     end if
  445.   end if
  446.   if gCFTBook = "Vegi" then
  447.     if (recipeNumber > 1700) and (recipeNumber < 1773) then
  448.       play movie "noPasta"
  449.       exit
  450.     end if
  451.     if (recipeNumber > 1900) and (recipeNumber < 1969) then
  452.       play movie "noStir"
  453.       exit
  454.     end if
  455.     if (recipeNumber > 2000) and (recipeNumber < 2069) then
  456.       play movie "noChick"
  457.       exit
  458.     end if
  459.   end if
  460.   if gCFTBook = "Stir" then
  461.     if (recipeNumber > 1700) and (recipeNumber < 1773) then
  462.       play movie "noPasta"
  463.       exit
  464.     end if
  465.     if (recipeNumber > 1800) and (recipeNumber < 1869) then
  466.       play movie "noVegi"
  467.       exit
  468.     end if
  469.     if (recipeNumber > 2000) and (recipeNumber < 2069) then
  470.       play movie "noChick"
  471.       exit
  472.     end if
  473.   end if
  474.   if gCFTBook = "Chick" then
  475.     if (recipeNumber > 1700) and (recipeNumber < 1773) then
  476.       play movie "noPasta"
  477.       exit
  478.     end if
  479.     if (recipeNumber > 1800) and (recipeNumber < 1869) then
  480.       play movie "noVegi"
  481.       exit
  482.     end if
  483.     if (recipeNumber > 1900) and (recipeNumber < 1969) then
  484.       play movie "noStir"
  485.       exit
  486.     end if
  487.   end if
  488.   set gCurrentRecipe to recipeNumber
  489.   if (gCurrentRecipe > 1700) and (gCurrentRecipe < 1768) then
  490.     set gCurrentBook to "Pasta"
  491.   else
  492.     if (gCurrentRecipe > 1800) and (gCurrentRecipe < 1869) then
  493.       set gCurrentBook to "Vegi"
  494.     else
  495.       if (gCurrentRecipe > 1900) and (gCurrentRecipe < 1969) then
  496.         set gCurrentBook to "Stir"
  497.       else
  498.         if (gCurrentRecipe > 2000) and (gCurrentRecipe < 2069) then
  499.           set gCurrentBook to "Chick"
  500.         end if
  501.       end if
  502.     end if
  503.   end if
  504.   set gCurrentRecipeFrame to "recipe1"
  505.   set gBrowseChooser to 1
  506.   toRecipes()
  507. end
  508.  
  509. on setShowRecipes results
  510.   global gScroll3, gRecipesFound, gRecipesFoundBrowser, gRecipesFoundAndID, gRecipesAvailableList, gCFTBundle, gCurrentBook, gMyRecipesList, gSearchList
  511.   set newResults to results
  512.   set gRecipesFound to []
  513.   set gRecipesFoundBrowser to [:]
  514.   set gRecipesFoundAndID to [:]
  515.   repeat with i = 1 to results
  516.     set result to DBGetResult(i)
  517.     if result <> 0 then
  518.       if getOne(gSearchList, result) > 0 then
  519.         add(gRecipesFound, getOne(gRecipeIDDB, result))
  520.         addProp(gRecipesFoundAndID, getOne(gRecipeIDDB, result), result)
  521.         next repeat
  522.       end if
  523.       set newResults to newResults - 1
  524.     end if
  525.   end repeat
  526.   set tempList to gRecipesFound
  527.   repeat with i = 1 to count(tempList)
  528.     addProp(gRecipesFoundBrowser, getAt(tempList, i), i)
  529.   end repeat
  530.   put "Click here to view list" into field "recipes found"
  531.   put newResults into field "number found"
  532.   if newResults = 0 then
  533.     put "No Recipes Found" into field "recipes found"
  534.   else
  535.     put newResults into field "number found"
  536.   end if
  537.   controlPosition(gScroll3, 0.0)
  538. end
  539.  
  540. on showRecipes
  541.   global gRecipesFoundAndID, stopMovie, gCFTBundle, gCurrentBook, gCurrentOrAll, gRecipeIDDB, gScroll3, gRecipesFound
  542.   cursor(4)
  543.   sort(gRecipesFound)
  544.   set fandwRecipeList to "‚Ä¢ Food and Wine:"
  545.   put RETURN after fandwRecipeList
  546.   put RETURN after fandwRecipeList
  547.   set healthyRecipeList to "‚Ä¢ Healthy Cooking:"
  548.   put RETURN after healthyRecipeList
  549.   put RETURN after healthyRecipeList
  550.   set GACRecipeList to "‚Ä¢ Great American Cooking:"
  551.   put RETURN after GACRecipeList
  552.   put RETURN after GACRecipeList
  553.   set pastaRecipeList to "‚Ä¢ Cooking For Today - Pasta:"
  554.   put RETURN after pastaRecipeList
  555.   put RETURN after pastaRecipeList
  556.   set vegiRecipeList to "‚Ä¢ Cooking For Today - Vegetarian:"
  557.   put RETURN after vegiRecipeList
  558.   put RETURN after vegiRecipeList
  559.   set stirRecipeList to "‚Ä¢ Cooking For Today - Stir Fries:"
  560.   put RETURN after stirRecipeList
  561.   put RETURN after stirRecipeList
  562.   set chickRecipeList to "‚Ä¢ Cooking For Today - Chicken:"
  563.   put RETURN after chickRecipeList
  564.   put RETURN after chickRecipeList
  565.   repeat with i in gRecipesFoundAndID
  566.     if (i > 0) and (i < 428) then
  567.       put getOne(gRecipeIDDB, i) after healthyRecipeList
  568.       put RETURN after healthyRecipeList
  569.       put RETURN after healthyRecipeList
  570.       next repeat
  571.     end if
  572.     if (i > 1000) and (i < 1613) then
  573.       put getOne(gRecipeIDDB, i) after GACRecipeList
  574.       put RETURN after GACRecipeList
  575.       put RETURN after GACRecipeList
  576.       next repeat
  577.     end if
  578.     if (i > 1700) and (i < 1773) then
  579.       put getOne(gRecipeIDDB, i) after pastaRecipeList
  580.       put RETURN after pastaRecipeList
  581.       put RETURN after pastaRecipeList
  582.       next repeat
  583.     end if
  584.     if (i > 1800) and (i < 1869) then
  585.       put getOne(gRecipeIDDB, i) after vegiRecipeList
  586.       put RETURN after vegiRecipeList
  587.       put RETURN after vegiRecipeList
  588.       next repeat
  589.     end if
  590.     if (i > 1900) and (i < 1969) then
  591.       put getOne(gRecipeIDDB, i) after stirRecipeList
  592.       put RETURN after stirRecipeList
  593.       put RETURN after stirRecipeList
  594.       next repeat
  595.     end if
  596.     if (i > 2000) and (i < 2069) then
  597.       put getOne(gRecipeIDDB, i) after chickRecipeList
  598.       put RETURN after chickRecipeList
  599.       put RETURN after chickRecipeList
  600.       next repeat
  601.     end if
  602.     if (i > 2999) and (i < 3223) then
  603.       put getOne(gRecipeIDDB, i) after fandwRecipeList
  604.       put RETURN after fandwRecipeList
  605.       put RETURN after fandwRecipeList
  606.       next repeat
  607.     end if
  608.     nothing()
  609.   end repeat
  610.   set recipesFoundText to EMPTY
  611.   if the number of lines in chickRecipeList > 3 then
  612.     put chickRecipeList after recipesFoundText
  613.     put RETURN after recipesFoundText
  614.   end if
  615.   if the number of lines in pastaRecipeList > 3 then
  616.     put pastaRecipeList after recipesFoundText
  617.     put RETURN after recipesFoundText
  618.   end if
  619.   if the number of lines in stirRecipeList > 3 then
  620.     put stirRecipeList after recipesFoundText
  621.     put RETURN after recipesFoundText
  622.   end if
  623.   if the number of lines in vegiRecipeList > 3 then
  624.     put vegiRecipeList after recipesFoundText
  625.     put RETURN after recipesFoundText
  626.   end if
  627.   if gCurrentOrAll = "All" then
  628.     if the number of lines in fandwRecipeList > 3 then
  629.       put fandwRecipeList after recipesFoundText
  630.       put RETURN after recipesFoundText
  631.     end if
  632.     if the number of lines in GACRecipeList > 3 then
  633.       put GACRecipeList after recipesFoundText
  634.       put RETURN after recipesFoundText
  635.     end if
  636.     if the number of lines in healthyRecipeList > 3 then
  637.       put healthyRecipeList after recipesFoundText
  638.       put RETURN after recipesFoundText
  639.     end if
  640.     put the number of lines in recipesFoundText
  641.     if the number of lines in recipesFoundText < 1500 then
  642.       put recipesFoundText into field "recipes found"
  643.     else
  644.       put line 1 to 1500 of recipesFoundText into field "first half"
  645.       put RETURN after field "first half"
  646.       put RETURN after field "first half"
  647.       put "Click here to see more recipes" after field "first half"
  648.       put RETURN after field "first half"
  649.       put field "first half" into field "recipes found"
  650.       put line 1501 to the number of lines in recipesFoundText of recipesFoundText into field "second half"
  651.       put RETURN after field "second half"
  652.       put "Click here to see more recipes " after field "second half"
  653.       put RETURN after field "second half"
  654.       nothing()
  655.     end if
  656.   else
  657.     if gCFTBundle = 1 then
  658.       put recipesFoundText into field "recipes found"
  659.     else
  660.       if gCurrentBook = "Pasta" then
  661.         set tempOut to line 3 to the number of lines in pastaRecipeList of pastaRecipeList
  662.         if the number of lines in tempOut >= 1 then
  663.           put tempOut into field "recipes found"
  664.         end if
  665.       else
  666.         if gCurrentBook = "Vegi" then
  667.           set tempOut to line 3 to the number of lines in vegiRecipeList of vegiRecipeList
  668.           if the number of lines in tempOut >= 1 then
  669.             put tempOut into field "recipes found"
  670.           end if
  671.         else
  672.           if gCurrentBook = "Stir" then
  673.             set tempOut to line 3 to the number of lines in stirRecipeList of stirRecipeList
  674.             if the number of lines in tempOut >= 1 then
  675.               put tempOut into field "recipes found"
  676.             end if
  677.           else
  678.             if gCurrentBook = "Chick" then
  679.               set tempOut to line 3 to the number of lines in chickRecipeList of chickRecipeList
  680.               if the number of lines in tempOut >= 1 then
  681.                 put tempOut into field "recipes found"
  682.               end if
  683.             end if
  684.           end if
  685.         end if
  686.       end if
  687.     end if
  688.   end if
  689.   controlPosition(gScroll3, 0.0)
  690.   cursor(-1)
  691. end
  692.  
  693. on dishesMenu
  694.   global gDishesMenu
  695.   set gDishesMenu to birth(script "pull down menu", 45, 46, the number of cast "large menu", the number of cast "large button", "dishes", "Any Type of Dish" & RETURN & "Appetizers & Snacks" & RETURN & "Main Dishes" & RETURN & "Side Dishes, Breads & Rolls" & RETURN & "Soups, Salads & Sandwiches" & RETURN & "Desserts & Beverages", "DBChooser")
  696. end
  697.  
  698. on timesMenu
  699.   global gTimesMenu
  700.   set gTimesMenu to birth(script "pull down menu", 42, 43, the number of cast "large menu", the number of cast "large button", "times", "Any Length of Time" & RETURN & "Less than 15 minutes" & RETURN & "Less than 30 minutes" & RETURN & "Less than 1 hour" & RETURN & "Less than 2 hours" & RETURN & "Less than 4 hours", "DBChooser")
  701. end
  702.  
  703. on fatMenu
  704.   global gFatMenu
  705.   set gFatMenu to birth(script "pull down menu", 39, 40, the number of cast "small menu2", the number of cast "small button", "fat", "Any Amount" & RETURN & "Low: < 3 g", "DBChooser")
  706. end
  707.  
  708. on saturatedMenu
  709.   global gSaturatedMenu
  710.   set gSaturatedMenu to birth(script "pull down menu", 36, 37, the number of cast "small menu2", the number of cast "small button", "saturated", "Any Amount" & RETURN & "Low: < 1 g", "DBChooser")
  711. end
  712.  
  713. on sodiumMenu
  714.   global gSodiumMenu
  715.   set gSodiumMenu to birth(script "pull down menu", 33, 34, the number of cast "small menu3", the number of cast "small button", "sodium", "Any Amount" & RETURN & "Low: < 140 mg" & RETURN & "Very low: < 35 mg", "DBChooser")
  716. end
  717.  
  718. on caloriesMenu
  719.   global gCaloriesMenu
  720.   set gCaloriesMenu to birth(script "pull down menu", 30, 31, the number of cast "small menu2", the number of cast "small button", "calories", "Any Amount" & RETURN & "Low: < 40", "DBChooser")
  721. end
  722.  
  723. on carbohydratesMenu
  724.   global gCarbohydratesMenu
  725.   set gCarbohydratesMenu to birth(script "pull down menu", 27, 28, the number of cast "small menu3", the number of cast "small button", "carbohydrates", "Any Amount" & RETURN & "Good source: > 30 g" & RETURN & "High in: > 60 g", "DBChooser")
  726. end
  727.  
  728. on cholesterolMenu
  729.   global gCholesterolMenu
  730.   set gCholesterolMenu to birth(script "pull down menu", 24, 25, the number of cast "small menu2", the number of cast "small button", "cholesterol", "Any Amount" & RETURN & "Low: < 20 mg", "DBChooser")
  731. end
  732.  
  733. on potassiumMenu
  734.   global gPotassiumMenu
  735.   set gPotassiumMenu to birth(script "pull down menu", 21, 22, the number of cast "small menu3", the number of cast "small button", "potassium", "Any Amount" & RETURN & "Good source: > 330 mg" & RETURN & "High in: > 700 mg", "DBChooser")
  736. end
  737.  
  738. on makeScrolls
  739.   global gScroll1, gScroll2, gScroll3, gCurrentOrAll, gCFTBook
  740.   cleanLegos()
  741.   set track to new("Button", [#spriteChan: 9])
  742.   set ball to new("Button", [#spriteChan: 10, #pressedCast: 56])
  743.   set up to new("Button", [#spriteChan: 11, #pressedCast: 58])
  744.   set down to new("Button", [#spriteChan: 12, #pressedCast: 60])
  745.   if gCurrentOrAll = "All" then
  746.     set gScroll1 to new("ScrollBar", [#scrollField: "a-e text" & gCurrentOrAll, #scrollFieldOut: 4, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  747.   else
  748.     set gScroll1 to new("ScrollBar", [#scrollField: "a-e text" & gCurrentOrAll & gCFTBook, #scrollFieldOut: 4, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  749.   end if
  750.   set track to new("Button", [#spriteChan: 13])
  751.   set ball to new("Button", [#spriteChan: 14, #pressedCast: 56])
  752.   set up to new("Button", [#spriteChan: 15, #pressedCast: 58])
  753.   set down to new("Button", [#spriteChan: 16, #pressedCast: 60])
  754.   set gScroll2 to new("ScrollBar", [#scrollField: "ingredients selected", #scrollFieldOut: 5, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  755.   set track to new("Button", [#spriteChan: 17])
  756.   set ball to new("Button", [#spriteChan: 18, #pressedCast: 56])
  757.   set up to new("Button", [#spriteChan: 19, #pressedCast: 58])
  758.   set down to new("Button", [#spriteChan: 20, #pressedCast: 60])
  759.   set gScroll3 to new("ScrollBar", [#scrollField: "recipes found", #scrollFieldOut: 6, #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
  760. end
  761.  
  762. on saveSearchResults
  763.   global gChooserSearchNum, gChooserSearchList
  764.   set gChooserSearchNum to field "number found"
  765.   set gChooserSearchList to field "recipes found"
  766. end
  767.  
  768. on loadSearchResults
  769.   global gDBStartSearch, gDBSearchIngredients, gStandardIDDB, gChooserSearchNum, gChooserSearchList, gDBSearchMenus, gDishesMenu, gTimesMenu, gFatMenu, gSaturatedMenu, gSodiumMenu, gCaloriesMenu, gCarbohydratesMenu, gCholesterolMenu, gPotassiumMenu
  770.   set gDBStartSearch to 1
  771.   set ingredients to EMPTY
  772.   repeat with i in gDBSearchIngredients
  773.     set ingredient to getOne(gStandardIDDB, i)
  774.     put ingredient & RETURN after ingredients
  775.   end repeat
  776.   if ingredients = EMPTY then
  777.     set ingredients to "No Ingredients Selected"
  778.   end if
  779.   put ingredients into field "ingredients selected"
  780.   put ingredients into field "scroll2"
  781.   if voidp(gChooserSearchNum) then
  782.     put "0" into field "number found"
  783.   else
  784.     put gChooserSearchNum into field "number found"
  785.   end if
  786.   if voidp(gChooserSearchList) then
  787.     put "No Recipes Found" into field "recipes found"
  788.     put "No Recipes Found" into field "scroll3"
  789.   else
  790.     put gChooserSearchList into field "recipes found"
  791.     put gChooserSearchList into field "scroll3"
  792.   end if
  793.   if getPos(gDBSearchMenus, 1) then
  794.     controlSelection(gFatMenu, 2)
  795.   end if
  796.   if getPos(gDBSearchMenus, 2) then
  797.     controlSelection(gSaturatedMenu, 2)
  798.   end if
  799.   if getPos(gDBSearchMenus, 3) then
  800.     controlSelection(gSodiumMenu, 2)
  801.   else
  802.     if getPos(gDBSearchMenus, 4) then
  803.       controlSelection(gSodiumMenu, 3)
  804.     end if
  805.   end if
  806.   if getPos(gDBSearchMenus, 5) then
  807.     controlSelection(gCaloriesMenu, 2)
  808.   end if
  809.   if getPos(gDBSearchMenus, 6) then
  810.     controlSelection(gCarbohydratesMenu, 2)
  811.   else
  812.     if getPos(gDBSearchMenus, 7) then
  813.       controlSelection(gCarbohydratesMenu, 3)
  814.     end if
  815.   end if
  816.   if getPos(gDBSearchMenus, 8) then
  817.     controlSelection(gCholesterolMenu, 2)
  818.   end if
  819.   if getPos(gDBSearchMenus, 9) then
  820.     controlSelection(gPotassiumMenu, 2)
  821.   else
  822.     if getPos(gDBSearchMenus, 10) then
  823.       controlSelection(gPotassiumMenu, 3)
  824.     end if
  825.   end if
  826.   repeat with i = 1 to 5
  827.     if getPos(gDBSearchMenus, i + 14) then
  828.       controlSelection(gTimesMenu, i + 1)
  829.       exit repeat
  830.     end if
  831.   end repeat
  832.   repeat with i = 1 to 5
  833.     if getPos(gDBSearchMenus, i + 19) then
  834.       controlSelection(gDishesMenu, i + 1)
  835.       exit repeat
  836.     end if
  837.   end repeat
  838. end
  839.  
  840. on chooserOn
  841.   repeat with i in [4, 5, 6, 7, 23, 26, 29, 32, 35, 38, 41, 44, 47]
  842.     set the visible of sprite i to 1
  843.   end repeat
  844. end
  845.  
  846. on chooserOff
  847.   repeat with i in [4, 5, 6, 7, 23, 26, 29, 32, 35, 38, 41, 44, 47]
  848.     set the visible of sprite i to 0
  849.   end repeat
  850. end
  851.  
  852. on makeButtons
  853. end
  854.  
  855. on helpOn
  856.   global gLastHelp, gHelpLinks, gHelpActive, gHelpSprite
  857.   if gHelpActive then
  858.     helpOff()
  859.   else
  860.     set gHelpActive to 1
  861.     set gLastHelp to 0
  862.     set gHelpLinks to [7: 49, 47: 50, 44: 51, 41: 52, 38: 52, 35: 52, 32: 52, 29: 52, 26: 52, 23: 52, 4: 53, 5: 54, 6: 108, 3: 107, 2: 19]
  863.     puppetSprite(gHelpSprite, 1)
  864.   end if
  865. end
  866.