// Copyright © 1993-94 Apple Computer, Inc. All rights reserved. constant kAppSymbol := '|GreasySpoon:PIEDTS|; // ---- End Project Data ---- // ---- File main.t ---- mainView := {title: "Greasy Spoon Order Form", viewBounds: {left: 0, top: 0, right: 240, bottom: 336}, viewSetupFormScript: func() begin local a := GetAppParams(); self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, a.appAreaWidth, a.appAreaHeight); end, _proto: protoApp, debug: "mainView" }; tableNo := /* child of mainView */ {viewBounds: {left: 10, top: 18, right: 170, bottom: 42}, text: "Table Number:", _proto: protoInputLine, debug: "tableNo" }; eggs := /* child of mainView */ {text: "Eggs", buttonClickScript: func() begin eggPick:Open(); end, viewBounds: {left: 12, top: 60, right: 88, bottom: 72}, _proto: protoTextButton, debug: "eggs" }; eggPick := /* child of mainView */ {viewBounds: {left: 116, top: 60, right: 176, bottom: 72}, pickItems: [ {item:"Scrambled"}, 'pickseparator, {item:"Fried"}, {item:"Over easy"}, 'pickseparator, {item:"Boiled - hard"}, {item:"Boiled - soft"} ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); eggText:Open(); if actionCode = 0 then SetValue(eggText, 'text, "Scrambled"); if actionCode = 2 then SetValue(eggText, 'text, "Fried"); if actionCode = 3 then SetValue(eggText, 'text, "Over easy"); if actionCode = 5 then SetValue(eggText, 'text, "Hard boiled"); if actionCode = 6 then SetValue(eggText, 'text, "Soft boiled"); end, _proto: protoPicker, debug: "eggPick" }; // View eggPick is declared to mainView // After Script for "eggPick" thisView := eggPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; eggText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 58, right: 202, bottom: 74}, viewFlags: 20481, _proto: protoStaticText, debug: "eggText" }; // View eggText is declared to mainView bacon := /* child of mainView */ {text: "Bacon", buttonClickScript: func() begin baconPick:Open(); end, viewBounds: {left: 12, top: 92, right: 88, bottom: 104}, _proto: protoTextButton, debug: "bacon" }; baconPick := /* child of mainView */ {viewBounds: {left: 116, top: 92, right: 176, bottom: 104}, pickItems: [ {item:"Fried"}, {item:"Grilled"}, ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); baconText:Open(); if actionCode = 0 then SetValue(baconText, 'text, "Fried"); if actionCode = 1 then SetValue(baconText, 'text, "Grilled"); end, _proto: protoPicker, debug: "baconPick" }; // View baconPick is declared to mainView // After Script for "baconPick" thisView := baconPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; baconText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 90, right: 202, bottom: 106}, viewFlags: 20481, _proto: protoStaticText, debug: "baconText" }; // View baconText is declared to mainView steak := /* child of mainView */ {text: "Steak", buttonClickScript: func() begin steakPick:Open(); end, viewBounds: {left: 12, top: 124, right: 88, bottom: 136}, _proto: protoTextButton, debug: "steak" }; steakPick := /* child of mainView */ {viewBounds: {left: 116, top: 124, right: 176, bottom: 136}, pickItems: [ {item:"Rare"}, {item:"Medium"}, {item:"Well done"}, ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); steakText:Open(); if actionCode = 0 then SetValue(steakText, 'text, "Rare"); if actionCode = 1 then SetValue(steakText, 'text, "Medium"); if actionCode = 2 then SetValue(steakText, 'text, "Well done"); end, _proto: protoPicker, debug: "steakPick" }; // View steakPick is declared to mainView // After Script for "steakPick" thisView := steakPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; steakText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 122, right: 202, bottom: 138}, viewFlags: 20481 , _proto: protoStaticText, debug: "steakText" }; // View steakText is declared to mainView tomatoes := /* child of mainView */ {text: "Tomatoes", buttonClickScript: func() begin tomPick:Open(); end, viewBounds: {left: 12, top: 156, right: 88, bottom: 168}, _proto: protoTextButton, debug: "tomatoes" }; tomPick := /* child of mainView */ {viewBounds: {left: 116, top: 156, right: 176, bottom: 168}, pickItems: [ {item:"Fried"}, {item:"Grilled"}, ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); tomText:Open(); if actionCode = 0 then SetValue(tomText, 'text, "Fried"); if actionCode = 1 then SetValue(tomText, 'text, "Grilled"); end, _proto: protoPicker, debug: "tomPick" }; // View tomPick is declared to mainView // After Script for "tomPick" thisView := tomPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; tomText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 154, right: 202, bottom: 170}, viewFlags: 20481 , _proto: protoStaticText, debug: "tomText" }; // View tomText is declared to mainView sausages := /* child of mainView */ {text: "Sausages", buttonClickScript: func() begin sauPick:Open(); end, viewBounds: {left: 12, top: 188, right: 88, bottom: 200}, _proto: protoTextButton, debug: "sausages" }; sauPick := /* child of mainView */ {viewBounds: {left: 116, top: 188, right: 176, bottom: 200}, pickItems: [ {item:"Pork"}, {item:"Beef"}, {item:"Turkey"}, ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); sauText:Open(); if actionCode = 0 then SetValue(sauText, 'text, "Pork"); if actionCode = 1 then SetValue(sauText, 'text, "Beef"); if actionCode = 2 then SetValue(sauText, 'text, "Turkey"); end, _proto: protoPicker, debug: "sauPick" }; // View sauPick is declared to mainView // After Script for "sauPick" thisView := sauPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; sauText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 186, right: 202, bottom: 202}, viewFlags: 20481 , _proto: protoStaticText, debug: "sauText" }; // View sauText is declared to mainView bread := /* child of mainView */ {text: "Bread", buttonClickScript: func() begin breadPick:Open(); end, viewBounds: {left: 12, top: 220, right: 88, bottom: 232}, _proto: protoTextButton, debug: "bread" }; breadPick := /* child of mainView */ {viewBounds: {left: 116, top: 220, right: 176, bottom: 232}, pickItems: [ {item:"Toast"}, {item:"Buttered"}, {item:"Fried"}, ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); breadText:Open(); if actionCode = 0 then SetValue(breadText, 'text, "Toast"); if actionCode = 1 then SetValue(breadText, 'text, "Buttered"); if actionCode = 2 then SetValue(breadText, 'text, "Fried"); end, _proto: protoPicker, debug: "breadPick" }; // View breadPick is declared to mainView // After Script for "breadPick" thisView := breadPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; breadText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 218, right: 202, bottom: 234}, viewFlags: 20481 , _proto: protoStaticText, debug: "breadText" }; // View breadText is declared to mainView beverages := /* child of mainView */ {text: "Beverages", buttonClickScript: func() begin bevPick:Open(); end, viewBounds: {left: 12, top: 252, right: 88, bottom: 264}, _proto: protoTextButton, debug: "beverages" }; bevPick := /* child of mainView */ {viewBounds: {left: 116, top: 252, right: 176, bottom: 264}, pickItems: [ {item:"Tea"}, {item:"Coffee"}, {item:"Beer"}, ], bounds: {left: 0, top: 0, right: 0, bottom: 0}, pickActionScript: func(actionCode) begin Print("Choice picked = "&& pickItems[actionCode].item); bevText:Open(); if actionCode = 0 then SetValue(bevText, 'text, "Tea"); if actionCode = 1 then SetValue(bevText, 'text, "Coffee"); if actionCode = 2 then SetValue(bevText, 'text, "Beer"); end, _proto: protoPicker, debug: "bevPick" }; // View bevPick is declared to mainView // After Script for "bevPick" thisView := bevPick; // this proto uses the bounds instead of the viewbounds slot thisView.bounds := thisView.viewBounds; bevText := /* child of mainView */ {text: "Choice", viewBounds: {left: 130, top: 250, right: 202, bottom: 266}, viewFlags: 20481 , _proto: protoStaticText, debug: "bevText" }; // View bevText is declared to mainView costPrice := /* child of mainView */ {viewBounds: {left: 10, top: 282, right: 170, bottom: 306}, text: "Total cost:", _proto: protoInputLine, debug: "costPrice" }; // ---- Beginning of section for non used Layout files ---- // End of output