// Text of project SyncScroll written on 11/21/95 at 2:02 PM // Beginning of text file Project Data // Copyright © 1994 Apple Computer, Inc. All rights reserved. // scroll direction constants constant kScrollDown := 1; constant kScrollUp := -1; // End of text file Project Data // Beginning of file Scroll.t // Before Script for "myapp" // Copyright 1993-1994 Apple Computer, Inc. All rights reserved. myapp := {title: "SyncScroll", viewBounds: {left: -4, top: 2, right: 224, bottom: 326}, viewFormat: 83951953, viewSetupFormScript: func() begin constant kMaxWidth := 240; constant kMaxHeight := 336; local b := GetAppParams(); viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, Min(b.appAreaWidth, kMaxWidth), Min(b.appAreaHeight, kMaxHeight) ); end, viewScrollDownScript: func() begin scrollArray:DoScroll(kScrollDown) ; end, viewScrollUpScript: func() begin scrollArray:DoScroll(kScrollUp) ; end, debug: "myapp", _proto: @157 }; scrollarray := {viewFlags: 33, viewFormat: 336, viewBounds: {left: 9, top: 73, right: 231, bottom: 247}, DoScroll: func(UpOrDown) begin // you MUST have in index slot in the parent // of the templates you are scrolling. That is // the view that recieves the SyncScroll message // make sure you pass this index :SyncScroll(stepchildren, index, UpOrDown) ; end, index: 0, debug: "scrollarray", viewClass: 74 }; AddStepForm(myapp, scrollarray); StepDeclare(myapp, scrollarray, 'scrollarray); _view000 := {viewFlags: 33, viewFormat: 12625, viewLineSpacing: 20, viewFont: 18434, viewBounds: {left: 0, top: 0, right: 215, bottom: 250}, viewJustify: 8192, text: "This is the first item in the array. Now is the time for all good llamas to come to the aid of their party." , height: 50, viewClass: 81 }; AddStepForm(scrollarray, _view000); // After Script for "_view000" thisView := _view000; thisview.height := thisview.viewBounds.bottom - thisview.viewBounds.top; // works for all justifications except vertical full justification!!!! // for full vertical justification the 'height' slot used by the :SyncScroll method will be different from the view height!! _view001 := {viewFlags: 33, viewFormat: 12625, viewLineSpacing: 20, viewFont: 18434, viewBounds: {left: 0, top: 0, right: 215, bottom: 39}, viewJustify: 8192, text: "THIS IS THE SECOND ITEM IN THE ARRAY. NOW IS THE TIME FOR ALL GOOD LLAMAS TO COME TO THE AID OF THEIR PARTY." , height: 50, viewClass: 81 }; AddStepForm(scrollarray, _view001); // After Script for "_view001" thisView := _view001; thisview.height := thisview.viewBounds.bottom - thisview.viewBounds.top; // works for all justifications except vertical full justification!!!! // for full vertical justification the 'height' slot used by the :SyncScroll method will be different from the view height!! _view002 := {viewFlags: 33, viewFormat: 12625, viewLineSpacing: 20, viewFont: 18434, viewBounds: {left: 0, top: 0, right: 215, bottom: 103}, viewJustify: 8192, text: "This is the last item in the array. Now is the time for all good llamas to come to the aid of their party.Now is the time for all good llamas to come to the aid of their party.Now is the time for all good llamas to come to the aid of their party.Now is the time for all good llamas to come to the aid of their party.Now is the time for all good llamas to come to the aid of their party.Now is the time for all good llamas to come to the aid of their party." , height: 50, viewClass: 81 }; AddStepForm(scrollarray, _view002); // After Script for "_view002" thisView := _view002; thisview.height := thisview.viewBounds.bottom - thisview.viewBounds.top; // works for all justifications except vertical full justification!!!! // for full vertical justification the 'height' slot used by the :SyncScroll method will be different from the view height!! _view003 := {text: "Using an array of view templates:", viewBounds: {left: 8, top: 48, right: 208, bottom: 64}, _proto: @218 }; AddStepForm(myapp, _view003); constant |layout_Scroll.t| := myapp; // End of file Scroll.t