// Text of project call written on 5/9/95 at 17:37 // Beginning of file main.t // Before Script for "myBase" // Copyright © 1993-1995 by Apple Computer, Inc. All Rights Reserved. myBase := {viewBounds: {left: -1, top: 26, right: 219, bottom: 293}, viewScrollDownScript: func() begin CountryList:viewScrollDownScript(); end, viewScrollUpScript: func() begin CountryList:viewScrollUpScript(); end, title: "London Calling", UpdatePhone: func() begin // get the country name from the countryList view local cl := countryList ; local cName := cl.listItems[cl.selection] ; // set the value of the convertedText static text // item to the output from MungePhone. SetValue(convertedText, 'text, :MungePhone(phoneLine.entryLine.text, cName); ); end, viewSetupFormScript: func() begin local a := GetAppParams(); self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, a.appAreaWidth, a.appAreaHeight); end, debug: "myBase", _proto: @157 }; convertedText := {text: "", viewBounds: {left: 7, top: 166, right: 215, bottom: 214}, viewFormat: 337, debug: "convertedText", _proto: @218 }; AddStepForm(myBase, convertedText); StepDeclare(myBase, convertedText, 'convertedText); _view000 := {text: "Converted Number", viewBounds: {left: 6, top: 150, right: 110, bottom: 166}, _proto: @218 }; AddStepForm(myBase, _view000); phoneLine := {viewBounds: {left: 3, top: 21, right: 221, bottom: 45}, label: "Phone:", text: "415 555 1212", entryFlags: 273921, labelCommands: ["408 555 1212", "415 555 1212", "81 555 1212"], debug: "phoneLine", _proto: @189 }; AddStepForm(myBase, phoneLine); StepDeclare(myBase, phoneLine, 'phoneLine); CountryList := {viewBounds: {left: 67, top: 51, right: 218, bottom: 145}, viewSetupFormScript: func() begin // get an array of all the countries that Newton // can convert phone numbers for c := foreach item in ROM_countries collect item.name ; // sort that array alphabetically c := Sort(c, '|str<|, nil); // and set the list items to that array self.listItems := c ; // setup the list :SetupList(); end, viewFont: ROM_fontSystem9, viewLines: 7, viewSetupDoneScript: func() begin // set the default selection to the line containing USA // make sure it is visible by scrolling down to it usaLine := ArrayPos(listItems, "USA", 0, func(a,b) StrEqual(a,b)) ; :DoScrollScript(MIN(usaLine * lineHeight, spillHeight)) ; selection := usaLine; end, debug: "CountryList", _proto: @228 }; AddStepForm(myBase, CountryList); StepDeclare(myBase, CountryList, 'CountryList); _view001 := {text: "Country of Phone Number", viewBounds: {left: 6, top: 50, right: 65, bottom: 112}, viewJustify: 0, _proto: @218 }; AddStepForm(myBase, _view001); Convert := {text: "Convert Phone", buttonClickScript: func() begin :UpdatePhone(); end, viewBounds: {left: 11, top: 226, right: 95, bottom: 238}, debug: "Convert", _proto: @226 }; AddStepForm(myBase, Convert); Options := {text: "Options", buttonClickScript: func() begin // set the invoker of the callOptionsSlip to be // the base view // NOTE: invoker must support the message UpdatePhone callOptionsSlip.invoker := base; // then open it callOptionsSlip:Toggle(); end, viewBounds: {left: 115, top: 226, right: 183, bottom: 238}, debug: "Options", _proto: @226 }; AddStepForm(myBase, Options); constant |layout_main.t| := myBase; // End of file main.t