// Text of project ExpandoTime written on 5/14/95 at 10:35 PM // Beginning of text file Project Data // Copyright © 1993,4 Apple Computer, Inc. All rights reserved // for application size constant kMaxWidth := 240 ; // MP100 size // End of text file Project Data // Beginning of file protoTimeExpando // Before Script for "_userproto000" // Copyright © 1993,4 Apple Computer, Inc. All rights reserved _userproto000 := {viewBounds: {left: 3, top: 3, right: 5, bottom: 5}, entryFlags: 1097233, textChanged: // do some error checking on the input func() begin // be nice and let text expando do what it needs to inherited:?textChanged(); // now do some error checking // now set target slot to a number local num := StringToTime(entryLine.text); // the text could be bogus, so num may be nil // set it to a default // WARNING: ickky error feedback! if not num then begin if not StrEqual(entryLine.text, "") then begin local errorText := "'" & entryLine.Text & "' is not a valid time" ; :Notify(kNotifyAlert, EnsureInternal(kAppString), EnsureInternal(errorText)) ; // set the text back to what it was before the error // can do this because proto will add undo actions AddDeferredAction(func() PostCommand('application, aeUndo), []); end; num := 0 ; end; // finaly, write the data to the target target.(path) := num ; end, Setup2: func(target) begin // this function gets called to figure out what // text to show for the value in the collapsed // state // just return a string if target then HourMinute(target.(path)); end, textSetup: // show the correct text in the expanded entry func() begin // let the expando item to its work inherited:textSetup(); // now get the right text HourMinute(target.(path)); end, _proto: @227 }; constant |layout_protoTimeExpando| := _userproto000; // End of file protoTimeExpando // Beginning of file ExpandoTime.t // Before Script for "_view000" // Copyright © 1993,4 Apple Computer, Inc. All rights reserved _view000 := {viewBounds: {left: 0, top: 0, right: 240, bottom: 336}, viewSetupFormScript: func() begin // resize application to display, but // make sure it is no bigger than // a MessagePad b := GetAppParams() ; viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop, MIN(b.appAreaWidth, kMaxWidth), MIN(b.appAreaHeight, kMaxHeight)); end, title: kAppName, _proto: @157 }; _view001 := { viewSetupFormScript: func() begin // setup the target slot, just create a temporary // frame to edit self.target := {time1: Time(), time2: 56345760}; // now setup the lines array to have 2 time protos lines := [ {_proto: GetLayout("protoTimeExpando"), label: "Now", path: 'time1}, {_proto: GetLayout("protoTimeExpando"), label: "Then", path: 'time2}] ; // set the number of lines to display numLines := Length(lines) ; // finaly, call inherited method to make sure // everything gets setup correctly inherited:?viewSetupFormScript() ; end, editWidth: 150, editHeight: 50, viewBounds: {left: 26, top: 42, right: 218, bottom: 258}, FlushEdits: func() begin nil end, lines: nil, numLines: 2, _proto: @175 }; AddStepForm(_view000, _view001); constant |layout_ExpandoTime.t| := _view000; // End of file ExpandoTime.t