// Text of project TandL written on 5/9/95 at 5:00 PM // Beginning of file main.t // Before Script for "myBase" nil // Copyright © 1994-1995 Apple Computer, Inc. All rights reserved. myBase := {title: "Tables and Lists", viewBounds: {left: -1, top: 2, right: 233, bottom: 330}, viewSetupFormScript: func() begin local a := GetAppParams(); self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, a.appAreaWidth, a.appAreaHeight); end, debug: "myBase", _proto: @157 }; theTable := {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 := 3; //add an array of text values for each of the table entries def.tabValues := ["Gallifrey", "Mutters Spiral", "Shada"]; // now make each entry as wide as the interior of the table def.tabWidths := (viewBounds.right - viewBounds.left) - 2 ; end, viewBounds: {left: 12, top: 30, right: 222, bottom: 140}, viewFlags: 513, viewClickScript: func(unit) begin print("CLICK"); nil; end, selectThisCell: func(which) begin if lastSelection = which then begin // deselect the selection which:Hilite(nil) ; lastSelection := nil ; SetRemove(selectedCells, which.vIndex) ; end; else begin // call the inherited message to get the correct // selection behavior inherited:selectThisCell(which); lastSelection := which ; end; // this is where you do your housekeeping stuff print("selectThisCell called") ; print("selected cell (h,v): (" & which.hIndex & "," & which.vIndex & ")"); end, lastSelection: nil, debug: "theTable", _proto: @223 }; AddStepForm(myBase, theTable); theList := {viewBounds: {left: 13, top: 157, right: 223, bottom: 280}, viewSetupFormScript: func() begin self.listItems := ["one", "two", "three"]; :SetupList(); end, viewFont: ROM_fontSystem9, viewLines: 6, buttonClickScript: func(textIndex) begin if textIndex = lastSelection then begin lastSelection := nil ; // These next two lines clear out the selection! selection := nil ; :dirty(); end; else lastSelection := textIndex ; print(textIndex); end, lastSelection: 0, debug: "theList", _proto: @228 }; AddStepForm(myBase, theList); constant |layout_main.t| := myBase; // End of file main.t