// Text of project a2z_TDS written on 5/14/95 at 9:59 PM // Beginning of file protoa2z_TDS _userproto000 := {numIndices: 26, indexClickScript: func(currIndex) begin // do a conditional message send of the a2zChanged // message. The :? will check the _proto and _parent chain :?a2zChanged(sprintObject(chr(65+currIndex))) ; end, curIndex: 0, viewBounds: {top: -13, left: 0, right: 206, bottom: -3} , iconBBox: {left: 0, top: 0, right: 206, bottom: 8}, sendChangedTo: nil, viewJustify: 150, SetIndex: // this function will update the indexer based on newChar. // So sending the message :SetIndex($b) would update the curIndex and the // visual display to be at the character B. SetIndex := func(newChar) begin local newIndex := Ord(Upcase(newChar)) - 65 ; if newIndex < 0 then newIndex := 0 ; if newIndex >= numIndices then newIndex := numIndices - 1 ; SetValue(self, 'curIndex, newIndex); end;, _proto: @196 }; // After Script for "_userproto000" thisView := _userproto000; // set the icon to the ROM a2z bitmap thisView.icon := ROM_a2zbitmap; constant |layout_protoa2z_TDS| := _userproto000; // End of file protoa2z_TDS // Beginning of file a2z_TDS.t // Before Script for "_view000" /* ** Newton Developer Technical Support Sample Code ** ** protoA2Z by Maurice Sharp ** ** 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. */ _view000 := {title: "A2Z Fun", viewBounds: {left: -3, top: 48, right: 227, bottom: 252}, _proto: @157 }; indexer := {viewFlags: 1, viewFormat: 336, viewBounds: {left: 4, top: 71, right: 229, bottom: 176}, debug: "indexer", viewClass: 74 }; AddStepForm(_view000, indexer); _view001 := {text: "Current Selection:", viewBounds: {left: 7, top: 31, right: 143, bottom: 47}, viewFont: simpleFont12+tsBold, _proto: @218 }; AddStepForm(indexer, _view001); theText := {text: "", viewBounds: {left: 143, top: 31, right: 175, bottom: 47}, viewFont: simpleFont12+tsBold, debug: "theText", _proto: @218 }; AddStepForm(indexer, theText); StepDeclare(indexer, theText, 'theText); _view002 := { viewSetupDoneScript: func() begin // if there is a viewSetupDoneScript in a proto, make // sure it gets called inherited:?viewSetupDoneScript(); // give an initial value to the text // do this by calling the protos indexClickScript // which will call the a2ZChangedScript with the // correct letter. // I did it this way so that all you have to change // is the curIndex to have a different initial letter :indexClickScript(curIndex) ; end, a2zChanged: func(theLetter) begin SetValue(theText, 'text, theLetter) ; end, _proto: _userproto000 }; AddStepForm(indexer, _view002); constant |layout_a2z_TDS.t| := _view000; // End of file a2z_TDS.t