// © Copyright 1993-94 Apple Computer, Inc, All Rights Reserved constant kAppName := '|Changes:PIEDTS|; // ---- End Project Data ---- // ---- File Changes.t ---- baseView := {title: "clEditView Workaround", viewBounds: {left: -4, top: 8, right: 228, bottom: 304}, viewSetupFormScript: func() begin constant kMaxAppWidth := 240 ; // original MP width constant kMaxAppHeight:= 336 ; // original MP height local b := GetAppParams() ; // make view no bigger than the original MP viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, MIN(b.appAreaWidth, kMaxAppWidth), MIN(b.appAreaHeight, kMaxAppHeight)); end, _proto: protoApp, debug: "baseView" }; myEditView := /* child of baseView */ {viewFlags: 33553921, viewFormat: 337, viewBounds: {left: 35, top: 27, right: 203, bottom: 211}, viewChangedScript: func(slot, view) begin print("myEditView:viewChangedScript()"); nil; end, viewClickScript: func(unit) begin print("myEditView:viewClickScript()"); return nil; end, viewDropChildScript: func(oldOne) begin print("myEditView:viewDropChildScript()"); //This should return TRUE if you manually removed the child end, viewAddChildScript: //Sample code copyright 1994, Apple Computer Inc. //Written by Todd Courtois func(newOne) begin if (newOne.viewStationery = 'poly) then //it's a clPolygonView begin newOne.oldSum := 0; //Create an oldSum slot in this new clPolygonView newOne.viewFlags := vVisible + vClickable; //Need to adjust viewFlags so that you can click on this particular clPolygonView //This is where we slap a viewClickScript onto the barebones clPolygonView newOne.viewClickScript := func(unit) begin oldSum := 0; //reset our cheezy checksum //Now, do a quick sum over the view's "points" binary object for i := 0 to (Length(points) -1 ) do oldSum := oldSum + (i*2)*ExtractByte(points,i); print(oldsum); //Now, come back and look at this view again when you're done clicking AddDeferredAction( func(oldSum) begin local mySum := 0; //Again, get a quick sum over the new points object for i := 0 to (Length(points) -1) do mySum := mySum + (i*2)*ExtractByte(points,i); print(mysum); //Now compare oldSum and newSum as a cheezy checksum if (mySum <> oldSum) then myEditView:viewChangedScript(viewChildren,myEditView); end, [oldsum]); return nil; //we didn't really handle the click; pass it up end; end; print("myEditView:viewAddChildScript()"); return nil; //This should return TRUE if you manually added the child end, viewGestureScript: func(unit, gestureID) begin print("myEditView:viewGestureScript()"); end, viewclass: 77, debug: "myEditView" }; // View myEditView is declared to baseView // ---- Beginning of section for non used Layout files ---- // End of output