// Text of project Modal written on 5/13/95 at 11:05 PM // Beginning of file MyModalDialog.t // Before Script for "_view000" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. _view000 := {viewFlags: 512, viewFormat: 256, viewBounds: {left: 0, top: 0, right: 0, bottom: 0}, viewJustify: 240, declareSelf: 'modal, viewClickScript: // viewClickScript to absorb all taps. func(unit) begin print("click"); TRUE; end, viewClass: 74 }; // Before Script for "_view001" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. _view001 := {viewFlags: 1, viewFormat: 83886673, viewBounds: {left: 32, top: 24, right: 216, bottom: 136}, viewClass: 74 }; AddStepForm(_view000, _view001); // Before Script for "_view002" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. _view002 := {text: "OK", buttonClickScript: func() begin // the topmost clView for this dialog has a declareSelf // slot with the value 'modal, so this will close it. modal:Close(); end, viewBounds: {left: 34, top: 82, right: 90, bottom: 98}, _proto: @226 }; AddStepForm(_view001, _view002); // Before Script for "_view003" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. _view003 := {text: "Ick... A Modal dialog! Ick!", viewBounds: {left: 25, top: 33, right: 153, bottom: 49}, _proto: @218 }; AddStepForm(_view001, _view003); // Before Script for "_view004" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. _view004 := {text: "Cancel", buttonClickScript: func() begin // the topmost clView for this dialog has a declareSelf // slot with the value 'modal, so this will close it. modal:Close(); end, viewBounds: {left: 107, top: 83, right: 163, bottom: 99}, _proto: @226 }; AddStepForm(_view001, _view004); constant |layout_MyModalDialog.t| := _view000; // End of file MyModalDialog.t // Beginning of file Modal.t // Before Script for "myBase" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. myBase := {title: "Modal Fun", viewBounds: {left: -4, top: 98, right: 223, bottom: 261}, doModal: func(theView) begin // send the ModalDialog message to the view // identified by theModalView // this is done as a deferred action. // see the buttonClickScript in the protoTextButton theView:ModalDialog(); end, viewQuitScript: func() begin if theModal then theModal:?Close(); end, debug: "myBase", _proto: @157 }; // Before Script for "_view005" // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved. _view005 := {text: "Modal Me", buttonClickScript: func() begin // MUST send the ModalDialog message as a deferred // action, otherwise events can go awry. AddDeferredAction(doModal, [theModal]); end, viewBounds: {left: 74, top: 122, right: 148, bottom: 140}, _proto: @226 }; AddStepForm(myBase, _view005); theModal := LinkedSubview(_view000, {viewBounds: {left: 48, top: 56, right: 104, bottom: 80}, debug: "theModal"} ); AddStepForm(myBase, theModal); StepDeclare(myBase, theModal, 'theModal); constant |layout_Modal.t| := myBase; // End of file Modal.t