// Text of project infoButton written on 5/13/95 at 11:03 PM // Beginning of text file Project Data // Copyright ©1994 Apple Computer, Inc., All Rights Reserved. // constants for the application constant kMaxAppWidth := 240 ; constant kMaxAppHeight := 336 ; // other constants constant kAppSplashSymbol := '|Splash:InfoButton:PIEDTS| ; // constants for the InfoButton items: constant kAboutItem := 0 ; constant kHelpItem := 1 ; constant kPrefsItem := 2 ; constant kThisWayItem := 4 ; constant kThatWayItem := 5 ; constant kTheOtherWayItem := 6 ; // get the sounds... r := OpenResFileX(HOME&"infoButton.rsrc") ; DefConst('kEeahSound, GetSound("eeah")) ; // End of text file Project Data // Beginning of file protoInfoButton // Before Script for "info" // Copyright ©1994 Apple Computer, Inc., All Rights Reserved. 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, debug: "info", viewClass: 76 }; // After Script for "info" thisView := info; // 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)); constant |layout_protoInfoButton| := info; // End of file protoInfoButton // Beginning of file infoButton.t // Before Script for "myBase" // Copyright ©1994 Apple Computer, Inc., All Rights Reserved. myBase := {viewFlags: 4, viewFormat: nil, viewBounds: {left: 0, top: 0, right: 240, bottom: 328}, declareSelf: 'base, viewSetupFormScript: func() begin local l := GetAppParams(); viewBounds := RelBounds(l.AppAreaLeft, l.appAreaTop, MIN(kMaxAppWidth, l.appAreaWidth), MIN(kMaxAppHeight, l.appAreaHeight)) ; :MarkAppInfoItem(kThisWayItem); end, AppInfoItems: nil, InfoItemSelected: func(item) begin if item = kAboutItem then AboutView:Open(); else if item = kHelpItem then HelpView:Open(); else if item = kPrefsItem then PrefsView:Open(); else begin :MarkAppInfoItem(item) ; end; end, DefaultAppInfoItems: ["About", "Help", "Prefs", 'pickSeparator, "This Way", "That Way", "The Other Way"] , MarkAppInfoItem: func(item) begin AppInfoItems := DeepClone(DefaultAppInfoItems) ; AppInfoItems[item] := {item: AppInfoItems[item], mark: kCheckMarkChar} ; if item >= kThisWayItem then begin globalSortType := item ; theTitle.title := titleBase & "- Sort " & DefaultAppInfoItems[globalSortType] ; // a hack to get the title view to update itself if theTitle.viewCObject then theTitle:SyncView(); end; end, titleBase: "Info Button", globalSortType: 4, debug: "myBase", viewClass: 74 }; _view000 := {text: "This Space Intentionally Left Blank (well, apart from this text)", viewBounds: {left: 0, top: 20, right: 0, bottom: -20}, viewJustify: 246, viewFont: {family: 'NewYork, face: kFaceNormal, size: 12}, _proto: @218 }; AddStepForm(myBase, _view000); _view001 := {_proto: @219}; AddStepForm(myBase, _view001); _view002 := { pickActionScript: func(index) begin // MUST do this :Hilite(nil); :InfoItemSelected(index) ; end, _proto: info }; AddStepForm(_view001, _view002); theTitle := {viewBounds: {left: -12, top: 8, right: 92, bottom: 24}, debug: "theTitle", _proto: @229 }; AddStepForm(myBase, theTitle); StepDeclare(myBase, theTitle, 'theTitle); HelpView := {viewBounds: {left: 0, top: 0, right: 200, bottom: 100}, viewJustify: 80, viewFlags: 0, showSound: kEeahSound, debug: "HelpView", _proto: @180 }; AddStepForm(myBase, HelpView); StepDeclare(myBase, HelpView, 'HelpView); _view003 := { text: "Hacker, help thyself.\n\nBut seriously, see the 'Beyond Help' sample code (version 3 or better) to see how to do help books." , viewBounds: {top: 0, left: 0, right: 0, bottom: -10}, viewJustify: 246, _proto: @218 }; AddStepForm(HelpView, _view003); PrefsView := {viewBounds: {left: 0, top: 0, right: 200, bottom: 100}, viewJustify: 80, viewFlags: 0, showSound: kEeahSound, debug: "PrefsView", _proto: @180 }; AddStepForm(myBase, PrefsView); StepDeclare(myBase, PrefsView, 'PrefsView); _view004 := { text: "Hacker, help thyself.\n\nBut seriously, see the\n'Preefer Madness'\nsample code (version 4 or better) to see how to do Preferences." , viewBounds: {top: 10, left: 0, right: 0, bottom: -10}, viewJustify: 246, viewFlags: 2051, _proto: @218 }; AddStepForm(PrefsView, _view004); AboutView := {viewBounds: {left: 0, top: 0, right: 200, bottom: 100}, viewJustify: 80, viewFlags: 0, showSound: kEeahSound, debug: "AboutView", _proto: @180 }; AddStepForm(myBase, AboutView); StepDeclare(myBase, AboutView, 'AboutView); _view005 := { text: "Hacker, help thyself.\n\nBut seriously, see the 'Splash Screen' sample code (version 1 or better) to see how to do an About splash screen." , viewBounds: {top: 10, left: 0, right: 0, bottom: -10}, viewJustify: 246, viewFlags: 2051, _proto: @218 }; AddStepForm(AboutView, _view005); constant |layout_infoButton.t| := myBase; // End of file infoButton.t