// Copyright © 1994 Apple Computer, Inc. All rights reserved. // scroll direction constants constant kScrollDown := 1; constant kScrollUp := -1; // ---- End Project Data ---- // ---- 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, _proto: protoApp, debug: "myapp" }; scrollarray := /* child of myapp */ {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, viewclass: 74, debug: "scrollarray" }; // View scrollarray is declared to myapp _view000 := /* child of scrollarray */ {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 }; // 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 := /* child of scrollarray */ {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 }; // 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 := /* child of scrollarray */ {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 }; // 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 := /* child of myapp */ {text: "Using an array of view templates:", viewBounds: {left: 8, top: 48, right: 208, bottom: 64}, _proto: protoStaticText }; // ---- Beginning of section for non used Layout files ---- // End of output