// Text of project ViewScripts written on 11/21/95 at 3:00 PM
// Beginning of file ViewScripts.t
MainView :=
    {title: "View Scripts Example",
     viewBounds: {left: 0, top: 0, right: 240, bottom: 332},
     viewSetupDoneScript:
       func()
       begin
           print("mainView viewSetupDoneScript");
       end,
     viewSetupFormScript:
       func()
       begin
       	constant kMaxWidth := 240;
       	constant kMaxHeight := 336;
       
       	local b := GetAppParams();
       
       	self.viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop,
       											Min(b.appAreaWidth, kMaxWidth),
       											Min(b.appAreaHeight, kMaxHeight)
       										);
       
           Print("mainView viewSetupFormScript");
       end,
     viewSetupChildrenScript:
       func()
       begin
           print("mainView viewSetupChildrenScript");
       end,
     viewDrawScript:
       func()
       begin
           print("mainView viewDrawScript");
       end,
     viewQuitScript:
       func()
       begin
           print("mainView viewQuitScript");
           'postQuit;	// want postQuitScript called
       end,
     viewPostQuitScript:
       func()
       begin
       	print("mainView viewPostQuitScript");
       end,
     viewClickScript:
       func(unit)
       begin
       	print("mainView viewClickScript (returns true)");
       	true;
       end,
     viewFlags: 517,
     debug: "MainView",
     _proto: @157
    };

child1 :=
    {viewFlags: 513,
     viewFormat: 337,
     viewBounds: {left: 50, top: 66, right: 186, bottom: 130},
     viewSetupFormScript:
       func()
       begin
           print("\tchild1 viewSetupFormScript");
       end,
     viewSetupChildrenScript:
       func()
       begin
           print("\tchild1 viewSetupChildrenScript");
       end,
     viewSetupDoneScript:
       func()
       begin
           print("\tchild1 viewSetupDoneScript");
       end,
     viewDrawScript:
       func()
       begin
           print("\tchild1 viewDrawScript");
       end,
     viewFont: ROM_fontSystem9,
     viewLineSpacing: 20,
     text: "child1",
     viewQuitScript:
       func()
       begin
           print("\tchild1 viewQuitScript");
           'postQuit;	// want postQuitScript called
       end,
     viewPostQuitScript:
       func()
       begin
       	print("\tchild1 viewPostQuitScript");
       end,
     viewClickScript:
       func(unit)
       begin
       	print("\tchild1 viewClickScript (returns nil)");
       	nil;
       end,
     debug: "child1",
     viewClass: 81
    };
AddStepForm(MainView, child1);

grandchild11 :=
    {viewFlags: 513,
     viewFormat: 337,
     viewBounds: {left: 32, top: 24, right: 104, bottom: 48},
     viewSetupFormScript:
       func()
       begin
           print("\t\tgrandchild11 viewSetupFormScript");
       end,
     viewSetupChildrenScript:
       func()
       begin
           print("\t\tgrandchild11 viewSetupChildrenScript");
       end,
     viewSetupDoneScript:
       func()
       begin
           print("\t\tgrandchild11 viewSetupDoneScript");
       end,
     viewDrawScript:
       func()
       begin
           print("\t\tgrandchild11 viewDrawScript");
       end,
     viewLineSpacing: 20,
     viewFont: ROM_fontSystem9,
     text: "grandchild11"
     ,
     viewQuitScript:
       func()
       begin
           print("\t\tgrandchild11 viewQuitScript");
           'postQuit;	// want postQuitScript called
       end,
     viewPostQuitScript:
       func()
       begin
       	print("\t\tgrandchild11 viewPostQuitScript");
       end,
     viewClickScript:
       func(unit)
       begin
       	print("\t\tgrandchild11 viewClickScript (returns nil)");
       	nil;
       end,
     debug: "grandchild11",
     viewClass: 81
    };
AddStepForm(child1, grandchild11);





child2 :=
    {viewFlags: 513,
     viewFormat: 337,
     viewBounds: {left: 50, top: 162, right: 186, bottom: 218},
     viewSetupFormScript:
       func()
       begin
           print("\tchild2 viewSetupFormScript");
       end,
     viewSetupChildrenScript:
       func()
       begin
           print("\tchild2 viewSetupChildrenScript");
       end,
     viewSetupDoneScript:
       func()
       begin
           print("\tchild2 viewSetupDoneScript");
       end,
     viewDrawScript:
       func()
       begin
           print("\tchild2 viewDrawScript");
       end,
     viewLineSpacing: 20,
     viewFont: ROM_fontSystem9,
     text: "child2",
     viewQuitScript:
       func()
       begin
           print("\tchild2 viewQuitScript");
           'postQuit;	// want postQuitScript called
       end,
     viewPostQuitScript:
       func()
       begin
       	print("\tchild2 viewPostQuitScript");
       end,
     viewClickScript:
       func(unit)
       begin
       	print("\tchild2 viewClickScript (returns 'skip)");
       	'skip;
       end,
     debug: "child2",
     viewClass: 81
    };
AddStepForm(MainView, child2);

grandchild21 :=
    {viewFlags: 513,
     viewFormat: 337,
     viewBounds: {left: 32, top: 24, right: 104, bottom: 48},
     viewSetupFormScript:
       func()
       begin
           print("\t\tgrandchild21 viewSetupFormScript");
       end,
     viewSetupChildrenScript:
       func()
       begin
           print("\t\tgrandchild21 viewSetupChildrenScript");
       end,
     viewSetupDoneScript:
       func()
       begin
           print("\t\tgrandchild21 viewSetupDoneScript");
       end,
     viewDrawScript:
       func()
       begin
           print("\t\tgrandchild21 viewDrawScript");
       end,
     viewLineSpacing: 20,
     viewFont: ROM_fontSystem9,
     text: "grandchild21"
     ,
     viewQuitScript:
       func()
       begin
           print("\t\tgrandchild21 viewQuitScript");
           'postQuit;	// want postQuitScript called
       end,
     viewPostQuitScript:
       func()
       begin
       	print("\t\tgrandchild21 viewPostQuitScript");
       end,
     viewClickScript:
       func(unit)
       begin
       	print("\t\tgrandchild21 viewClickScript (returns 'skip)");
       	'skip;
       end,
     debug: "grandchild21",
     viewClass: 81
    };
AddStepForm(child2, grandchild21);






constant |layout_ViewScripts.t| := MainView;
// End of file ViewScripts.t



