// ---- End Project Data ---- // ---- File EditView Thumbnail.t ---- // Before Script for "remoteApp" /* ** Newton Developer Technical Support Sample Code ** ** Thumbnail-1, Shows how to use clRemoteView with a "live" clEditView ** ** by Bob Ebert, Newton Developer Technical Support ** ** Copyright © 1995 by Apple Computer, Inc. All rights reserved. ** ** You may incorporate this sample code into your applications without ** restriction. This sample code has been provided "AS IS" and the ** responsibility for its operation is 100% yours. You are not ** permitted to modify and redistribute the source as "DTS Sample Code." ** If you are going to re-distribute the source, we require that you ** make it clear in the source that the code was descended from ** Apple-provided sample code, but that you've made changes. */ remoteApp := {title: "EditView Thumbnail", viewBounds: {top: 0, left: 0, right: 240, bottom: 320}, viewFlags: 134217733 , viewFormat: nil, declareSelf: 'base, viewSetupFormScript: func() begin local b := GetAppParams(); constant kMaxWidth := 240; constant kMaxHeight := 336; self.viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, MIN(b.appAreaWidth, kMaxWidth), MIN(b.appAreaHeight, kMaxHeight)); end, viewclass: 74, debug: "remoteApp" }; theEditView := /* child of remoteApp */ {viewFlags: 33553953, viewFormat: 8529, viewBounds: {top: 16, left: 8, right: -8, bottom: -24}, viewlinespacing: 28, viewChangedScript: func(slot, view) if call kViewIsOpenFunc with (theFloater) then begin // this may be overkill, some changes may not // cause changes in the children, or could be // handled by theFloater.theRemoteView:Dirty(), // but performance doesn't seem bad, so why bother? theFloater.theRemoteView:Close(); theFloater.theRemoteView:Open(); end, viewDropChildScript: func(oldOne) begin AddDeferredAction(func(v) v:viewChangedScript('viewChildren, v), [self]); nil; end, viewAddChildScript: func(newOne) begin AddDeferredAction(func(v) v:viewChangedScript('viewChildren, v), [self]); nil; end, viewJustify: 240, viewclass: 77, debug: "theEditView" }; // View theEditView is declared to remoteApp theFloater := /* child of remoteApp */ {viewBounds: {top: -118, left: -62, right: -7, bottom: -32}, viewClickScript: func(unit) begin :Drag(unit, :Parent():GlobalBox()); theRemoteView:Close(); theRemoteView:Open(); end, viewFlags: 609, viewJustify: 160, _proto: protoFloatNGo, debug: "theFloater" }; // View theFloater is declared to remoteApp theRemoteView := /* child of theFloater */ {viewBounds: {left: 1, top: 1, right: 57, bottom: 71}, viewFlags: 49, viewFormat: nil, viewSetupChildrenScript: func() begin local box := theEditView:LocalBox(); self.viewChildren := [ { // wrapper layer 2 viewClass: clView, viewBounds: box, viewFlags: vVisible, viewChildren: [ { // wrapper layer 1 viewClass: clView, viewBounds: box, viewFlags: vVisible, viewChildren: [ { // this is the "real" container for the edit view stuff viewClass: clView, viewBounds: box, viewFlags: vVisible, viewFormat: theEditView.viewFormat, viewLineSpacing: theEditView.viewLineSpacing, viewChildren: theEditView.viewChildren, // OK because remote view is read only } ] } ] } ]; end, viewJustify: 0, viewclass: 88, debug: "theRemoteView" }; // View theRemoteView is declared to theFloater _view000 := /* child of remoteApp */ {_proto: protoTitle}; _view001 := /* child of remoteApp */ {_proto: protoStatusBar}; _view002 := /* child of _view001 */ {_proto: protoLargeClosebox}; _view003 := /* child of _view001 */ { buttonClickScript: func() theFloater:Toggle();, text: "Thumbnail", viewBounds: {top: 0, left: -69, right: -7, bottom: 13}, viewJustify: 8390662 , _proto: protoTextButton }; _view004 := /* child of _view001 */ {_proto: protoRecToggle}; // ---- Beginning of section for non used Layout files ---- // End of output