// Text of project Beyond Help written on 5/12/95 at 5:52 PM // Beginning of text file Project Data // Copyright © 1993-1995 Apple Computer, Inc. All rights reserved. // app constants constant kAppMaxWidth := 240 ; constant kAppMaxHeight := 336 ; // read in the book bookFilePath := HOME&"Help Book Source.f" ; // open resource fork for pictures ref := OpenResFileX(bookFilePath); // load in the book load(bookFilePath); // close the resource file CloseResFileX(ref) ; // End of text file Project Data // Beginning of file protoAdjustoButton // Before Script for "_userproto000" // Copyright © 1994-1995 Apple Computer. All rights reserved. _userproto000 := {buttonHeight: 13, textSpacer: 8, viewSetupFormScript: func() begin viewBounds := RelBounds(viewBounds.left, viewBounds.top, StrFontWidth(text, viewFont) + textSpacer, buttonHeight) ; end, viewChangedScript: func(slot, view) begin inherited:?viewChangedScript(slot, view) ; if slot = 'text then :SyncView(); // SyncView causes the viewSetupFormScript to be called again, // which sets the size based on the text. end, _proto: @226 }; constant |layout_protoAdjustoButton| := _userproto000; // End of file protoAdjustoButton // Beginning of file protoInfoButton // Before Script for "info" // Copyright © 1994-1995 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 Beyond Help.t // Before Script for "BeyondHelpApp" // Copyright © 1993-1995 Apple Computer, Inc. All rights reserved. BeyondHelpApp := {title: "Beyond Help", viewBounds: {left: 0, top: 2, right: 236, bottom: 334}, theBook: book // defined in ProjectData, from Dickens output. , viewSetupDoneScript: func() begin // create the new help book that uses the same proto as the system // help book (TinyTim). // NOTE/WARNING: TinyTime is NOT the proto, it IS the system help book. // You want the _proto of TinyTime. self.myHelpBook := BuildContext({_proto: GetRoot().TinyTim._proto, bookRef: theBook}); end, viewQuitScript: func() begin myHelpBook:Close(); // do this so card can be removed myHelpBook := nil // do this so help book can be GC'd end, declareSelf: 'base, viewFlags: 4, viewFormat: 593, viewSetupFormScript: func() begin // resize application to the screen local b := GetAppParams(); viewBounds := RelBounds(b.AppAreaLeft, b.AppAreaTop, MIN(kAppMaxWidth, b.appAreaWidth), MIN(kAppMaxHeight, b.appAreaHeight)); end, AppInfoItems: ["Help"], 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 GetRoot().TinyTim:Close(); // in case system help is open // OpenManual is a method of the TinyTim helpbook myHelpBook:OpenManual(theBook); end, debug: "BeyondHelpApp", viewClass: 74 }; OpenManualTo := {text: "Llama Topic", buttonClickScript: func() begin GetRoot().TinyTim:Close(); // in case system help is open // OpenManualTo is a method of TinyTim See help book doc myHelpBook:OpenManualTo(theBook, "LlamaTopic"); end, viewBounds: {left: 68, top: 122, right: 144, bottom: 134}, debug: "OpenManualTo", _proto: _userproto000 }; AddStepForm(BeyondHelpApp, OpenManualTo); _view000 := {_proto: @219}; AddStepForm(BeyondHelpApp, _view000); _view001 := { pickActionScript: func(index) begin // MUST do this :Hilite(nil); :InfoItemSelected(index) ; end, _proto: info }; AddStepForm(_view000, _view001); _view002 := { text: "To see the sample help book, click on the Info button and choose \"Help\"" , viewBounds: {top: -65, left: 18, right: 148, bottom: -20}, viewJustify: 128, viewFont: {family: 'espy, face: kFaceNormal, size: 10}, _proto: @218 }; AddStepForm(BeyondHelpApp, _view002); _view003 := {viewBounds: {left: -8, top: 8, right: 48, bottom: 24}, _proto: @229}; AddStepForm(BeyondHelpApp, _view003); _view004 := {text: "Click on this button to open the Help Book to the Llama Topic", viewBounds: {left: 50, top: 64, right: 170, bottom: 120}, viewJustify: 6, viewFont: {family: 'espy, face: kFaceNormal, size: 10}, _proto: @218 }; AddStepForm(BeyondHelpApp, _view004); constant |layout_Beyond Help.t| := BeyondHelpApp; // End of file Beyond Help.t