// Text of project NouveauScroll written on 11/25/95 at 5:02 PM
// Beginning of file NouveauScroll.t

// Before Script for "myApp"
// Copyright ©1994 Apple Computer, Inc. All rights reserved.


myApp :=
    {title: "NouveauScroll",
     viewBounds: {left: 0, top: 2, right: 236, bottom: 334},
     viewFormat: 83951953,
     viewSetupFormScript:
       func()
       begin
       	local l := GetAppParams();
       	
       	self.viewBounds := RelBounds(l.appAreaLeft, l.appAreaTop,
       		MIN(l.appAreaWidth, 240), MIN(l.appAreaHeight, 336)) ;
       end,
     debug: "myApp",
     _proto: @157
    };

SimpleScroller :=
    {viewBounds: {left: 8, top: 32, right: 156, bottom: 156},
     viewFlags: 1,
     viewFormat: nil,
     debug: "SimpleScroller",
     viewClass: 74
    };
AddStepForm(myApp, SimpleScroller);

Scrollee :=
    {viewBounds: {left: 1, top: 1, right: 127, bottom: 123},
     def: protoTableDef,
     viewSetupFormScript:
       func()
       begin
       	// first clone off a copy of the table definition to avoid Read only errors
       	def := Clone(def);
       	// setup the number of entries in the table
       	def.tabDown := numItems;
       
       	//add an array of text values for each of the table entries	
       	def.tabValues := Array(numItems, nil) ;
       	
       	for i := 1 to numItems do
       		def.tabValues[i - 1] := "item " & i ;
       
       	// now make each entry as wide as the interior of the table
       	def.tabWidths := (viewBounds.right - viewBounds.left) - 2 ;
       	
       	def.tabHeights := FontHeight(viewFont) ;
       		
       	// setup the scroller
       	UpDownScroller.ScrollView := self ;
       end,
     numItems: 100,
     ViewScroll2DScript:
       func(dir, extras)
       begin
       	// scrollAmount says how much to scroll
       	scrollAmount := ABS(extras.amount) ;
       	
       	if extras.amount > 0 then
       		:viewScrollDownScript() ;
       	else
       		:viewScrollUpScript() ;
       	RefreshViews() ;
       end,
     debug: "Scrollee",
     _proto: @223
    };
AddStepForm(SimpleScroller, Scrollee);
StepDeclare(SimpleScroller, Scrollee, 'Scrollee);



UpDownScroller := {debug: "UpDownScroller", _proto: @656};
AddStepForm(SimpleScroller, UpDownScroller);
StepDeclare(SimpleScroller, UpDownScroller, 'UpDownScroller);





ComplexScroller :=
    {viewBounds: {left: 8, top: 176, right: 156, bottom: 300},
     viewFlags: 1,
     viewFormat: nil,
     debug: "ComplexScroller",
     viewClass: 74
    };
AddStepForm(myApp, ComplexScroller);

Scrollee :=
    {viewBounds: {left: 1, top: 1, right: 127, bottom: 123},
     def: protoTableDef,
     viewSetupFormScript:
       func()
       begin
       	// first clone off a copy of the table definition to avoid Read only errors
       	def := Clone(def);
       	// setup the number of entries in the table
       	def.tabDown := numItems;
       
       	//add an array of text values for each of the table entries	
       	def.tabValues := Array(numItems, nil) ;
       	
       	for i := 1 to numItems do
       		def.tabValues[i - 1] := "item " & i ;
       
       	// now make each entry as wide as the interior of the table
       	def.tabWidths := (viewBounds.right - viewBounds.left) - 2 ;
       	
       	def.tabHeights := FontHeight(viewFont) ;
       		
       	// setup the scroller
       	local sRect := SetBounds(0, 0, 0, numItems) ;
       	UpDownScroller.ScrollRect := sRect ;
       	UpDownScroller.DataRect := sRect ;
       	UpDownScroller.ViewRect := SetBounds(0, 0, 0,
       		((viewBounds.bottom - viewBounds.top) DIV def.tabHeights)) ;
       	UpDownScroller.ScrollAmounts := [1, UpDownScroller.ViewRect.bottom - 1, 10] ;
       	UpDownScroller.ScrollView := self ;
       end,
     numItems: 100,
     ViewScroll2DScript:
       func(dir, extras)
       begin
       	// scrollAmount says how much to scroll
       	scrollAmount := ABS(extras.amount) ;
       	
       	if extras.amount > 0 then
       		:viewScrollDownScript() ;
       	else
       		:viewScrollUpScript() ;
       	RefreshViews() ;
       end,
     debug: "Scrollee",
     _proto: @223
    };
AddStepForm(ComplexScroller, Scrollee);
StepDeclare(ComplexScroller, Scrollee, 'Scrollee);



UpDownScroller := {debug: "UpDownScroller", _proto: @656};
AddStepForm(ComplexScroller, UpDownScroller);
StepDeclare(ComplexScroller, UpDownScroller, 'UpDownScroller);





_view000 :=
    {text: "Does not use acceleration or feedback",
     viewBounds: {left: 8, top: 16, right: 224, bottom: 32},
     _proto: @218
    };
AddStepForm(myApp, _view000);



_view001 :=
    {text: "Uses acceleration and feedback",
     viewBounds: {left: 8, top: 160, right: 224, bottom: 176},
     _proto: @218
    };
AddStepForm(myApp, _view001);




constant |layout_NouveauScroll.t| := myApp;
// End of file NouveauScroll.t



