/* ** Newton Developer Technical Support Sample Code ** ** PhoneExpando, shows how to use a phone expando ** ** by Maurice Sharp, Newton Developer Technical Support ** ** Copyright © 1993-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. */ Version History --------------- 2 - updated for NTK 1.5, removed all the old PT_ references. This little piece of test code shows (by example) how to use the protoPhoneExpando prototype. In reality, you probably want to implement your own phone-savvy expando prototype, unless you are the Names application. This semi-custom proto (for the Names app) expects an array of phone numbers in a slot pointed to by the 'path slot. (See myPhoneExpando user proto.) For each phone item in the expando shell, a slot called 'phoneIndex tells the proto which element of the array to use. So, to set things up, both the array and the elements of the expando (set with AddItem) must be valid, matching, etc. The class of the string in the array is used to tag the slot. The current set of phone classes and their strings (on English units) is 'phone, "Phone" 'homePhone, "Home" 'workPhone, "Work" 'faxPhone, "Fax" 'carPhone, "Car" 'beeperPhone, "Beeper" 'mobilePhone, "Mobile" 'otherPhone, "Other" When the user modifies the string, the appropriate slot in the array is modified. If the user changes the type of phone number, the class of the string in that slot of the array is edited.