// ---- End Project Data ---- // ---- File The Application.t ---- // Before Script for "theApp" // Copyright © 1994 by Apple Computer, Inc. All rights reserved. // Note that this view is NOT initially visible. This keeps it from // appearing as a child in the application. Because it is linked to // the app and declared, the template will be available to the code. theApp := {title: "Splash Screen Demo", viewBounds: {left: 0, top: 2, right: 236, bottom: 334}, viewFormat: 328017, viewSetupFormScript: func() begin // open the splash screen mySplashScreen := BuildContext(theSplashScreen._proto); mySplashScreen:Open(); // because it's initially invisible RefreshViews(); // make the screen update mySplashScreen:UpdateStatus("Initializing..."); // do the rest of the view setup local a := GetAppParams(); constant kMaxAppWidth := 240; constant kMaxAppHeight := 336; self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, MIN(a.appAreaWidth, kMaxAppWidth), MIN(a.appAreaHeight, kMaxAppHeight)); mySplashScreen:UpdateStatus("Wasting Time..."); // waste some time (inefficiently--to simulate a real app processing) for i := 1 to 100 do sleep(1); end, viewSetupChildrenScript: func() begin mySplashScreen:UpdateStatus("Waisting More Time..."); // waste some time (inefficiently--to simulate a real app processing) for i := 1 to 100 do sleep(1); end, viewSetupDoneScript: func() begin mySplashScreen:UpdateStatus("Last Bit of Waste..."); // waste some time (inefficiently--to simulate a real app processing) for i := 1 to 100 do sleep(1); // Finally... put the splash screen away. AddDeferredAction(CloseSplashScreen, []); end, mySplashScreen: nil, viewQuitScript: func() begin // in case close happens unexpectedly (card yanking, auto close) // close the splash screen, use :? in case it's NIL mySplashScreen:?Close(); // always nil out slots that may have big things in them. mySplashScreen := nil; end, CloseSplashScreen: func() begin mySplashScreen:?Close(); mySplashScreen := NIL; end, AppInfoItems: ["About"], declareSelf: 'base, InfoItemSelected: func(item) begin // this is where you respond to the info button // see the pickActionScript in the protoInfoButton to // to see where this script is called from. // see the infoButton sample for details on protoInfoButton // open up the About view // but make sure the close box shows theSplashScreen.hideCloseBoxP := nil ; theSplashScreen:Open(); end, viewFlags: 4, viewclass: 74, debug: "theApp" }; _view000 := /* child of theApp */ {text: "THIS SPACE INTENTIONALLY LEFT BLANK", viewBounds: {left: 8, top: 120, right: 232, bottom: 144}, viewJustify: 8388614, _proto: protoStaticText }; // ---- File The Splash Screen.t ---- // Before Script for "theSplashScreen" // Copyright © 1994 by Apple Computer, Inc. All rights reserved. // Note that this view is NOT initially visible. This keeps it from // appearing as a child in the application. Because it is linked to // the app and declared, the template will be available to the code. theSplashScreen := /* child of theApp */ {viewFlags: 0, viewFormat: 131665, viewBounds: {left: 0, top: 0, right: 240, bottom: 336}, viewSetupFormScript: func() begin local a := GetAppParams(); constant kMaxAppWidth := 240; constant kMaxAppHeight := 336; self.viewBounds := RelBounds(a.appAreaLeft + 4, a.appAreaTop + 4, MIN(a.appAreaWidth, kMaxAppWidth) - 8, MIN(a.appAreaHeight, kMaxAppHeight) - 8); end, viewEffect: 8521952, hideCloseBoxP: true, viewSetupDoneScript: func() begin if hideCloseBoxP then SplashClose:Hide(); end, declareSelf: 'base, UpdateStatus: func(message) begin // change the status text SetValue(StatusMessage, 'text, message) ; RefreshViews() end, viewclass: 74, debug: "theSplashScreen" }; // View theSplashScreen is declared to theApp AboutPic := /* child of theSplashScreen */ {viewFlags: 1, icon: GetPictAsBits("newt 300", nil), viewFormat: nil, viewBounds: {left: 0, top: 20, right: 120, bottom: 120}, viewJustify: 22, viewclass: 76, debug: "AboutPic" }; text1 := /* child of theSplashScreen */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 20, viewFont: {family: 'newYork, face: kFaceNormal, size: 18}, viewBounds: {left: 0, top: 5, right: 0, bottom: 30}, text: "Info Button Sample!", viewJustify: 8374, viewclass: 81, debug: "text1" }; text2 := /* child of theSplashScreen */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 12, viewFont: {family: 'newYork, face: kFaceNormal, size: 10}, viewBounds: {top: 5, left: 10, right: -10, bottom: 33}, text: "Copyright \u00A9\u 1994 Apple Computer, Inc., All Rights Reserved.", viewJustify: 8374, viewclass: 81, debug: "text2" }; text3 := /* child of theSplashScreen */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 11, viewFont: {family: 'espy, face: kFaceNormal, size: 9}, viewBounds: {top: 5, left: 20, right: -20, bottom: 78}, viewJustify: 8374, text: "This sample gives you a proto you can use for the info button in your application. It was written at great expense at the last minute by a specially trained team of Peruvian Llamas. However, my boss will not let me say\nthat, so I have to take the credit." , viewclass: 81, debug: "text3" }; text4 := /* child of theSplashScreen */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 12, viewFont: {family: 'newYork, face: kFaceNormal, size: 10}, viewBounds: {top: 0, left: 10, right: -10, bottom: 25}, text: "P.S., Have you hugged your Llama today?", viewJustify: 8374, viewclass: 81, debug: "text4" }; SplashClose := /* child of theSplashScreen */ {_proto: protoClosebox, debug: "SplashClose"}; // View SplashClose is declared to theSplashScreen StatusMessage := /* child of theSplashScreen */ {text: "", viewBounds: {top: -20, left: 0, right: -20, bottom: 0}, viewJustify: 8388788 , _proto: protoStaticText, debug: "StatusMessage" }; // View StatusMessage is declared to theSplashScreen // ---- Back in File The Application.t ---- _view001 := /* child of theApp */ {viewBounds: {left: 0, top: 0, right: 104, bottom: 16}, _proto: protoTitle}; _view002 := /* child of theApp */ {_proto: protoStatus}; // ---- File protoInfoButton ---- info := {viewBounds: {left: 17, top: 0, right: 30, bottom: 12}, viewFormat: 67109457, pickCancelledScript: func() begin :Hilite(nil); end, icon: GetPictAsBits("info icon", nil), viewClickScript: func(unit) begin if :TrackHilite(unit) then begin local l := :LocalBox(); DoPopUp(AppInfoItems, l.right+3, l.top, self); end; end, viewFlags: 513, viewclass: 76, debug: "info" }; // After Script for "info" thisView := info; // Copyright ©1994 Apple Computer, Inc., All Rights Reserved. // set the bounds of the button so that it is to the right // of the clock and the correct height for the status bar // NOTE: this is the first button, so argument to the // ButtonBounds function MUST be negative thisView.viewBounds := ButtonBounds(-(thisView.viewBounds.right - thisView.viewBounds.left)); // ---- Back in File The Application.t ---- _view003 := /* child of _view002 */ { pickActionScript: func(index) begin // MUST do this :Hilite(nil); :InfoItemSelected(index) ; end, _proto: info }; // ---- Beginning of section for non used Layout files ---- // ---- File The Splash Screen.t ---- // Before Script for "SplashBase" // Copyright © 1994 by Apple Computer, Inc. All rights reserved. // Note that this view is NOT initially visible. This keeps it from // appearing as a child in the application. Because it is linked to // the app and declared, the template will be available to the code. SplashBase := {viewFlags: 0, viewFormat: 131665, viewBounds: {left: 0, top: 0, right: 240, bottom: 336}, viewSetupFormScript: func() begin local a := GetAppParams(); constant kMaxAppWidth := 240; constant kMaxAppHeight := 336; self.viewBounds := RelBounds(a.appAreaLeft + 4, a.appAreaTop + 4, MIN(a.appAreaWidth, kMaxAppWidth) - 8, MIN(a.appAreaHeight, kMaxAppHeight) - 8); end, viewEffect: 8521952, hideCloseBoxP: true, viewSetupDoneScript: func() begin if hideCloseBoxP then SplashClose:Hide(); end, declareSelf: 'base, UpdateStatus: func(message) begin // change the status text SetValue(StatusMessage, 'text, message) ; RefreshViews() end, viewclass: 74, debug: "SplashBase" }; AboutPic := /* child of SplashBase */ {viewFlags: 1, icon: GetPictAsBits("newt 300", nil), viewFormat: nil, viewBounds: {left: 0, top: 20, right: 120, bottom: 120}, viewJustify: 22, viewclass: 76, debug: "AboutPic" }; text1 := /* child of SplashBase */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 20, viewFont: {family: 'newYork, face: kFaceNormal, size: 18}, viewBounds: {left: 0, top: 5, right: 0, bottom: 30}, text: "Info Button Sample!", viewJustify: 8374, viewclass: 81, debug: "text1" }; text2 := /* child of SplashBase */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 12, viewFont: {family: 'newYork, face: kFaceNormal, size: 10}, viewBounds: {top: 5, left: 10, right: -10, bottom: 33}, text: "Copyright \u00A9\u 1994 Apple Computer, Inc., All Rights Reserved.", viewJustify: 8374, viewclass: 81, debug: "text2" }; text3 := /* child of SplashBase */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 11, viewFont: {family: 'espy, face: kFaceNormal, size: 9}, viewBounds: {top: 5, left: 20, right: -20, bottom: 78}, viewJustify: 8374, text: "This sample gives you a proto you can use for the info button in your application. It was written at great expense at the last minute by a specially trained team of Peruvian Llamas. However, my boss will not let me say\nthat, so I have to take the credit." , viewclass: 81, debug: "text3" }; text4 := /* child of SplashBase */ {viewFlags: 1, viewFormat: 0, viewlinespacing: 12, viewFont: {family: 'newYork, face: kFaceNormal, size: 10}, viewBounds: {top: 0, left: 10, right: -10, bottom: 25}, text: "P.S., Have you hugged your Llama today?", viewJustify: 8374, viewclass: 81, debug: "text4" }; SplashClose := /* child of SplashBase */ {_proto: protoClosebox, debug: "SplashClose"}; // View SplashClose is declared to SplashBase StatusMessage := /* child of SplashBase */ {text: "", viewBounds: {top: -20, left: 0, right: -20, bottom: 0}, viewJustify: 8388788 , _proto: protoStaticText, debug: "StatusMessage" }; // View StatusMessage is declared to SplashBase // End of output