// Text of project Beyond Help written on 11/21/95 at 5:19 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... this sets up a global variable "book".
// *** Note: you MUST remove the "output.book" and "output.help" lines
// *** from the Help source, otherwise it will not compile correctly.
// *** See the BookMaker 1.1 release notes for more info.
load(bookFilePath);

// Also note that the warnings about Unknown global function "MakePage"
// and "MakeBlock" can be ignored; they're normal.


// 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 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"],
     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 :=
    {
     DoInfoHelp:
       func()
       begin
       	// This is where you respond to the info button "Help" item.  This is called by the protoInfoButton.
       	
          GetRoot().TinyTim:Close();   // in case system help is open
       	// OpenManual is a method of the TinyTim helpbook
          myHelpBook:OpenManual(theBook);
       end,
     viewFlags: 515,
     DoInfoAbout:
       func()
       begin
       	:Notify(knotifyQAlert, Clone("Beyond Help"), Clone("This is the Beyond Help sample application, with a gratuitous yet trivial about-box.\n\nYow!"));
       end,
     viewBounds: {left: 25, top: 2, right: 38, bottom: 15},
     viewJustify: 6,
     _proto: @478
    };
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



