Addison-Wesley Publishing CompanyReading, Massachusetts Menlo Park, California New YorkDon Mills, Ontario Harlow, England Amsterdam BonnSydney Singapo
xSelection Tab Protos 7-25Gauges and Slider Protos 7-25Time Protos 7-27Special View Protos 7-28View Appearance Protos 7-30Status Bar Protos 7-31Chapte
CHAPTER 3 Views3-16 About ViewsvjParentCenterV64 The difference between the top and bottom view bounds is used as the height of the view. If you speci
CHAPTER 3ViewsAbout Views 3-171For views of the clParagraphView class, the vertical alignment constants vjTopV, vjCenterV, and vjBottomV apply only to
CHAPTER 3 Views3-18 About ViewsFigure 3-7 View alignment effectsHorizontal alignment of view contents Vertical alignment of view contentsJustify v jFu
CHAPTER 3ViewsAbout Views 3-19Figure 3-7 View alignment effects (continued)View Alignment effects2Figure 3-7 continuedBasic Views / Newton Programmer&
CHAPTER 3 Views3-20 About ViewsviewOriginX and viewOriginY Slots 3These slots can be read but not written or set. Instead, use Setorigin to set the or
CHAPTER 3ViewsAbout Views 3-21IMPORTANTMany views need no fill pattern, so you may be inclined to set the fill pattern to “none” when you create such a
CHAPTER 3 Views3-22 About ViewsDrawing Transfer Mode for Views 3The viewTransferMode slot specifies the transfer mode to be used for drawing in the vie
CHAPTER 3ViewsAbout Views 3-23Opening and Closing Animation Effects 3Another attribute of a view that you can specify is an animation that occurs when
CHAPTER 3 Views3-24 About Views fxZoomCloseEffect—opposite of fxZoomOpenEffect. This value shrinks the image of the view from a point in the center u
CHAPTER 3ViewsAbout Views 3-25_parent Contains a reference to the parent template. This slot is created when the view opens. Note that it’s best to us
xiHandling Input Events 8-38Testing for a Selection Hit 8-38Summary of Text 8-39Text Constants and Data Structures 8-39Views 8-42Protos 8-43Text and I
CHAPTER 3 Views3-26 About ViewsIMPORTANTRemember that the viewChildren and stepChildren arrays contain templates, not views. If you try to send a mess
CHAPTER 3ViewsAbout Views 3-27Declaring a View 3Before diving into the discussion of view instantiation, it is important to understand the term declar
CHAPTER 3 Views3-28 About ViewsFor a more detailed technical description of the inner workings of declaring a view, see Appendix A, “The Inside Story
CHAPTER 3ViewsAbout Views 3-295. The viewChildren and stepChildren slots are read and the child views are instantiated using this same process. As par
CHAPTER 3 Views3-30 About ViewsView Compatibility 3The following new functionality has been added for the 2.0 release of Newton System Software. See t
CHAPTER 3ViewsAbout Views 3-31New Alignment Flags 3The viewJustify slot contains new constants that allow you to specify that a view is sized proporti
CHAPTER 3 Views3-32 Using ViewsNew Warning Messages 3Warning messages are now printed to the inspector when a NewtonScript application calls a view me
CHAPTER 3ViewsUsing Views 3-33Displaying, Hiding, and Redrawing Views 3To display a view (and its visible child views), send it one of the following v
CHAPTER 3 Views3-34 Using ViewsShowing a Hidden View 3In many cases, you might think that you need to create a view dynamically. However, if the templ
CHAPTER 3ViewsUsing Views 3-35If at some point after the child views have been created you want to modify the contents of the stepChildren array and b
xiiRecognizing Standard Gestures 9-25Combining View Flags 9-26Recognizing Text 9-27Recognizing Punctuation 9-28Suppressing Spaces Between Words 9-28Fo
CHAPTER 3 Views3-36 Using ViewsTo remove a view created by AddStepView, use the RemoveStepView function. This function takes two parameters: the paren
CHAPTER 3ViewsUsing Views 3-37needed values. Your template is only a two-slot object in RAM. The user proto resides in the package with the rest of yo
CHAPTER 3 Views3-38 Using ViewsEach of the three return values contains three elements: Element 0: the subview that is highlighted. This subview is u
CHAPTER 3ViewsUsing Views 3-39Typically, modal views are used for slips. For example, if the user was going to delete some data in your application, y
CHAPTER 3 Views3-40 Using ViewsAnimating Views 3There are four view methods that perform special animation effects on views. They are summarized here:
CHAPTER 3ViewsUsing Views 3-41 GetDropDataScript— is sent to the source view when the destination view is found. ViewDropScript— is sent to the dest
CHAPTER 3 Views3-42 Using ViewsIn the latter kind of scrolling, the child views are moved within the parent view by changing their view bounds. Newly
CHAPTER 3ViewsUsing Views 3-43To determine if a given view is highlighted, check the vSelected bit in the viewFlags. vSelected should not be set by yo
CHAPTER 3 Views3-44 Using ViewsTo lay out a view containing a vertical column of child views, send the view the messageLayoutColumn.Optimizing View Pe
CHAPTER 3ViewsUsing Views 3-45views). Also, if there are multiple dirty views that are in different view hierarchies, their closest common ancestor vi
xiiiProviding the _recogPopup Slot 10-22Accessing Correction Information 10-23Using Custom Dictionaries 10-24Creating a Custom Enumerated Dictionary 1
CHAPTER 3 Views3-46 Using Viewsview of your application, you should set to nil those slots that aren’t needed when the application is closed, since th
CHAPTER 3ViewsSummary of Views 3-47Summary of Views 3Constants 3Class ConstantsviewFlags ConstantsConstant ValueclView74clPictureView76clEditView77clK
CHAPTER 3 Views3-48 Summary of ViewsviewFormat ConstantsConstant ValuevfNone0vfFillWhite1vfFillLtGray2vfFillGray3vfFillDkGray4vfFillBlack5vfFillCustom
CHAPTER 3ViewsSummary of Views 3-49viewTransferMode ConstantsviewEffect ConstantsConstant ValuemodeCopy0modeOr1modeXor2modeBic3modeNotCopy4modeNotOr5m
CHAPTER 3 Views3-50 Summary of ViewsfxCheckerboardEffectfxColumns(8)+fxRows(8)+fxColAltVPhase+fxRowAltHPhase+fxDown155879fxZoomVerticalEffectfxColumns
CHAPTER 3ViewsSummary of Views 3-51Functions and Methods 3Getting References to Viewsview:ChildViewFrames()view:Parent()GetRoot()GetView(symbol)Displa
CHAPTER 3 Views3-52 Summary of Viewsview:RevealEffect(distance, bounds, sound, methodName,methodParameters)view:Delete(methodName, methodParameters)Dr
CHAPTER 3ViewsSummary of Views 3-53ViewScrollUpScript()ViewOverviewScript()ViewAddChildScript(child)ViewChangedScript(slot, view)ViewDropChildScript(c
About the NewtApp Framework 4-1CHAPTER 4NewtApp Applications 4Figure 4-0Table 4-0NewtApp is a collection of prototypes that work together in an applic
xivChapter 11 Data Storage and Retrieval 11-1About Data Storage on Newton Devices 11-1Introduction to Data Storage Objects 11-2Where to Go From Here 1
CHAPTER 4 NewtApp Applications4-2 About the NewtApp FrameworkYou can create most kinds of applications with the NewtApp framework. If your application
CHAPTER 4NewtApp ApplicationsAbout the NewtApp Framework 4-3The parts of the NewtApp framework are designed to fit together using the two-part NewtonSc
CHAPTER 4 NewtApp Applications4-4 About the NewtApp FrameworkNoteThis drawing does not depict the protos as they would appear in a Newton Toolkit layo
CHAPTER 4NewtApp ApplicationsAbout the NewtApp Framework 4-5About newtSoup 4Application data is stored in persistent structures known as soups in any
CHAPTER 4 NewtApp Applications4-6 About the NewtApp FrameworkFigure 4-2 A roll-based application (left) versus a card-based applicationThe page-based
CHAPTER 4NewtApp ApplicationsAbout the NewtApp Framework 4-7Figure 4-3 Calls is an example of a page-based applicationThe overview protos are also lay
CHAPTER 4 NewtApp Applications4-8 About the NewtApp FrameworkThe Entry View Protos 4The entry view is the focal point for operations that happen on on
CHAPTER 4NewtApp ApplicationsAbout the NewtApp Framework 4-9Note that the header bar contains the Action and Filing buttons on its right side. These b
CHAPTER 4 NewtApp Applications4-10 About the NewtApp Frameworkdata which they format appropriately. For example, the number views (newtNumberView and
CHAPTER 4NewtApp ApplicationsAbout the NewtApp Framework 4-11Figure 4-6 The smart name view and system-provided people pickerStationery 4Stationery, a
xvRetrieving Existing Soups 11-33Adding Entries to Soups 11-34Adding an Index to an Existing Soup 11-35Removing Soups 11-36Using Built-in Soups 11-36M
CHAPTER 4 NewtApp Applications4-12 Using NewtAppSome NewtApp protos are usable in your non-NewtApp applications. For example, there is a newtStatusBar
CHAPTER 4NewtApp ApplicationsUsing NewtApp 4-13responsibility for its operation is 100% yours. If you are going to redistribute it, you must make it c
CHAPTER 4 NewtApp Applications4-14 Using NewtAppOne other global, unique to this application, is set. It is the constant kAppTitle,set to the string &
CHAPTER 4NewtApp ApplicationsUsing NewtApp 4-15 Optional. Set the statusBarSlot to contain the declared name of the status bar so layouts can use it
CHAPTER 4 NewtApp Applications4-16 Using NewtAppUse code similar to the following example to set the allSoups slot:allSoups:={ IOUSoup: {_proto: newt
CHAPTER 4NewtApp ApplicationsUsing NewtApp 4-17where items is replaced by the value of the appObject slot set in the newtApplication base view. An exa
CHAPTER 4 NewtApp Applications4-18 Using NewtApp3. Set the masterSoupSlot to the symbol 'IOUSoup. This correlates to the name of the soup as it i
CHAPTER 4NewtApp ApplicationsUsing NewtApp 4-19menuRightButtons:=[newtActionButton,newtFilingButton,]Be sure to add the Overview Layout template file t
CHAPTER 4 NewtApp Applications4-20 Using NewtAppFollow these steps to ready your application for the slot views:1. Drag out a newtEntryView proto on t
CHAPTER 4NewtApp ApplicationsUsing NewtApp 4-21frame containing slots with references to all the viewDef layout templates that work with that dataDef.
xviSpecial-Purpose Objects for Chapter 12 Data Storage and Retrieval 12-1About Special-Purpose Storage Objects 12-1Entry Aliases 12-1Virtual Binary Ob
CHAPTER 4 NewtApp Applications4-22 Using NewtAppYou should create a text file, which you save as Install&Remove.f, into which to copy the functions
CHAPTER 4NewtApp ApplicationsUsing NewtApp 4-23Certain slots must be added to these base view slots for your application to be able to utilize the fal
CHAPTER 4 NewtApp Applications4-24 Using NewtAppomitted if your base application view’s soup slot is set to the default name dataSoup. Add a soupQuer
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-25Summary of the NewtApp Framework 4Required Code 4Required InstallScript 4InstallScri
CHAPTER 4 NewtApp Applications4-26 Summary of the NewtApp FrameworkAddEntry: //Adds the entry to the specified storefunc(entry, store) ...AdoptEntry:
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-27newtApplication 4myNewtAppBaseView := {_proto: newtapplication, // Application base
CHAPTER 4 NewtApp Applications4-28 Summary of the NewtApp FrameworkdateFindSlot: pathExpression // Enables dateFind for your// app. Path must lead to
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-29Find: // Default Find method as defined in framework.func(text, results, scope, find
CHAPTER 4 NewtApp Applications4-30 Summary of the NewtApp FrameworknewtAZTabs 4myAZTab:= { // the standard A-Z tabs_proto: newtAZTabs,PickActionScrip
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-31newtPrefsView 4aPrefsView:= { // The preferences view_proto: newtPrefsView } newtLa
xviiDrawing Compatibility 13-8New Functions 13-8New Style Attribute Slots 13-8Changes to Bitmaps 13-8Changes to the HitShape Method 13-8Changes to Vie
CHAPTER 4 NewtApp Applications4-32 Summary of the NewtApp FrameworknewtRollLayout 4myRollLayout:= { // Dynamically lays out child views_proto: newtRo
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-33forceNewEntry: true, //Creates blank entry for layoutmenuRightButtons:[], //Replaces
CHAPTER 4 NewtApp Applications4-34 Summary of the NewtApp FrameworkcurrentViewDef: //Set to current viewDefcurrentStatView: //Set to current context o
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-35newtEntryRollHeader 4aRollHeader:= { // Header/divider bar for page or // roll-styl
CHAPTER 4 NewtApp Applications4-36 Summary of the NewtApp FrameworknewtTextView 4editableTextView:= {// This is the editable text view_proto: newtText
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-37longFormat: yearMonthDayStrSpec,// for LongDateStrshortFormat: nil, // for ShortDate
CHAPTER 4 NewtApp Applications4-38 Summary of the NewtApp FrameworknewtROTextPhoneView 4readOnlyTextPhoneView:= {// Displays phone numbers_proto: newt
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-39newtROEditView 4readOnlyEditView:= { // A text display view, which // may have scrol
CHAPTER 4 NewtApp Applications4-40 Summary of the NewtApp FrameworknewtStationeryView 4stationeryView:= { // Used as bounding box and container// view
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-41usePopup: true,// When true with labelCommands array// picker is enabledaccess: &apo
xviiiChapter 14 Sound 14-1About Newton Sound 14-1Event-related Sounds 14-2Sounds in ROM 14-2Sounds for Predefined Events 14-2Sound Data Structures 14-3
CHAPTER 4 NewtApp Applications4-42 Summary of the NewtApp FrameworknewtROLabelNumInputLine 4aDisplayLabelNumberInputLine:= {// Labelled number display
CHAPTER 4NewtApp ApplicationsSummary of the NewtApp Framework 4-43_proto: newtLabelSimpleDateInputLine, label: "",// Text for input line lab
CHAPTER 4 NewtApp Applications4-44 Summary of the NewtApp FrameworkUpdateText: // Used with Undo to update text to new textfunc(newText)..., // }newtN
About Stationery 5-1CHAPTER 5Stationery 5Figure 5-0Table 5-0Stationery, which consists of new data formats and different views of your data, may be bu
CHAPTER 5 Stationery5-2 About StationeryA dataDef is based on the newtStationery proto and is used to create alternative data structures. The dataDef
CHAPTER 5StationeryAbout Stationery 5-3Figure 5-1 The IOU extension in the New pickerWhen you choose IOU from the New picker, an IOU entry is displaye
CHAPTER 5 Stationery5-4 About StationeryFigure 5-3 The Show menu presents different views of application dataStationery Registration 5Your stationery,
CHAPTER 5StationeryUsing Stationery 5-5Getting Information about Stationery 5By using the appropriate global function, you can get information about a
CHAPTER 5 Stationery5-6 Using StationeryThe dataDef component of your stationery should use a FillNewEntry method to define its own discrete soup entry
CHAPTER 5StationeryUsing Stationery 5-7newEntry.class := kDataSymbol;newEntry.viewStationery := kDataSymbol;newEntry.(kDataSymbol).dueDate:=time();new
xixCreating the labelsFilter slot 15-14Creating the storesFilter slot 15-14Adding the Filing Button 15-14Adding the Folder Tab View 15-14Customizing F
CHAPTER 5 Stationery5-8 Using StationeryA call to the global function GetDefs in the NTK Inspector window returns a series of frames describing dataDe
CHAPTER 5StationeryUsing Stationery 5-9The following example uses the constant kSuperSymbol as the value of the superSymbol slot. It is defined as fol
CHAPTER 5 Stationery5-10 Using Stationery// Generic entry definition:DefConst('kEntryTemplate, {class: kDataSymbol,viewStationery: kDataSymbol,//
CHAPTER 5StationeryUsing Stationery 5-11Here is an example:TextScript: func(item,target)beginitem.text := "IOU\n" & target.(kDataSymbol)
CHAPTER 5 Stationery5-12 Using StationeryAdd the protos that will display the data and labels to the working application. The protos used here include
CHAPTER 5StationeryUsing Stationery 5-13Set the slots of the newtLabelNumInputLine as follows: Set the label slot to "How Much". Set the p
CHAPTER 5 Stationery5-14 Using StationeryUsing the MinimalBounds ViewDef Method 5The MinimalBounds method must be used in a viewDef when the size of t
CHAPTER 5StationeryStationery Summary 5-15Stationery Summary 5Data Structures 5ViewDef Frame 5myViewDef := {_proto: anyGenericView,type: 'editor,
CHAPTER 5 Stationery5-16 Stationery SummarynewtStationeryPopupButton 5aStatPopup := { // used to construct New and Show buttons_proto: newtStationeryP
CHAPTER 5StationeryStationery Summary 5-17newtRollShowStationeryButton 5aRollShowButton := { // the Show button in paper roll apps_proto: newtRollShow
Apple Computer, Inc.© 1996 Apple Computer, Inc.All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or tr
xxImplementing Find Overview Support 16-21The FindSoupExcerpt Method 16-21The ShowFoundItem Method 16-22Replacing the Built-in Find Slip 16-24Reportin
About Pickers and Pop-up Views 6-1CHAPTER 6Pickers, Pop-up Views, and Overviews 6Figure 6-0Table 6-0This chapter describes how to use pickers and pop-
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-2 About Pickers and Pop-up ViewsMore sophisticated picker protos allow multiple selections and use a c
CHAPTER 6Pickers, Pop-up Views, and OverviewsAbout Pickers and Pop-up Views 6-3 protoDateDurationTextPicker protoRepeatDateDurationTextPicker proto
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-4 General-Purpose Pickers protoPeoplePopupThe following two protos are data types that support the pr
CHAPTER 6Pickers, Pop-up Views, and OverviewsGeneral-Purpose Pickers 6-5Figure 6-1 A protoPopupButton example The protoPopInPlace picker is a text bu
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-6 General-Purpose PickersProgrammer’s Reference. Figure 6-4 shows the types of objects you can display
CHAPTER 6Pickers, Pop-up Views, and OverviewsGeneral-Purpose Pickers 6-7 The protoTextList picker is a scrollable list of items. The user can scroll
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-8 Map PickersThe protoGeneralPopup sends a pickCancelledScript to the callbackContext specified in the
CHAPTER 6Pickers, Pop-up Views, and OverviewsMap Pickers 6-9Figure 6-8 A protoCountryPicker example The protoProvincePicker displays a map of North A
xxiUsing Alerts and Alarms 17-11Using the Notify Method to Display User Alerts 17-11Creating Alarms 17-11Obtaining Information about Alarms 17-12Retri
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-10 Tex t Pickersthe slots and methods for this picker, see “protoWorldPicker” (page 5-34) in Newton P
CHAPTER 6Pickers, Pop-up Views, and OverviewsTex t Pickers 6-11 The protoDateTextPicker is a label picker with a text representation of a date. When
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-12 Tex t PickersFigure 6-14 A protoDateDurationTextPicker example The protoRepeatDateDurationTextPic
CHAPTER 6Pickers, Pop-up Views, and OverviewsTex t Pickers 6-13Figure 6-15 A protoDateNTimeTextPicker example The protoTimeTextPicker is a label pic
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-14 Tex t PickersFigure 6-17 A protoDurationTextPicker example The protoTimeDeltaTextPicker is a labe
CHAPTER 6Pickers, Pop-up Views, and OverviewsTex t Pickers 6-15Figure 6-19 A protoMapTextPicker example The protoCountryTextPicker is the same as pr
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-16 Tex t Pickers The protoCitiesTextPicker is a label picker with a text representation of a city. W
CHAPTER 6Pickers, Pop-up Views, and OverviewsDate, Time, and Location Pop-up Views 6-17Date, Time, and Location Pop-up Views 6You can use the protos d
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-18 Date, Time, and Location Pop-up Views The protoDateNTimePopup allows the user to choose a single d
CHAPTER 6Pickers, Pop-up Views, and OverviewsDate, Time, and Location Pop-up Views 6-19 The protoMultiDatePopup allows the user to specify a range of
xxiiThe Task Frame 18-11The Entries Slot 18-11The Phrases Slot 18-11The OrigPhrase Slot 18-12The Value Slot 18-12Resolving Template-Matching Conflicts
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-20 Date, Time, and Location Pop-up Views The protoAnalogTimePopup allows the user to choose a time wi
CHAPTER 6Pickers, Pop-up Views, and OverviewsNumber Pickers 6-21Number Pickers 6This section describes the protos available to allow users to pick num
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-22 Overview ProtosOverview Protos 6You can use the protos described in this section to create overview
CHAPTER 6Pickers, Pop-up Views, and OverviewsOverview Protos 6-23Figure 6-36 A protoSoupOverview example The protoListPicker provides a scrollable li
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-24 Overview ProtosFigure 6-37 A protoListPicker example The protoPeoplePicker displays a list of name
CHAPTER 6Pickers, Pop-up Views, and OverviewsOverview Protos 6-25You also need to define the following slot in your protoOverview:cursor This should b
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-26 Overview Protos Move, which moves the “cursor” a given number of entries and returns that entry or
CHAPTER 6Pickers, Pop-up Views, and OverviewsOverview Protos 6-27Figure 6-39 Creating a new name entryWhen the pen comes down in any column, the row/c
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-28 Overview Protospop-up view is displayed to allow the user to select any option or enter a new one.
CHAPTER 6Pickers, Pop-up Views, and OverviewsOverview Protos 6-29The picker definition (described in the next section) is a data definition frame that i
xxiiiDates 19-8About the Dates Application 19-8Dates Compatibility 19-9Using the Dates Application 19-10Adding Meetings or Events 19-11Deleting Meetin
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-30 Overview ProtosSee “Column Specifications” (page 5-3) in Newton Programmer’s Reference for details o
CHAPTER 6Pickers, Pop-up Views, and OverviewsOverview Protos 6-31Validation and Editing in protoListPicker 6The built-in validation mechanism is not d
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-32 Overview Protos// NOTE: returns the edit slip that is openedGetLayout("editor.t"):new(tap
CHAPTER 6Pickers, Pop-up Views, and OverviewsOverview Protos 6-33Changing the Font of protoListPicker 6The mechanism described here will probably cha
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-34 Overview Protosif x > selectIndent thenbegin // get a temporary cursor based on the cursor used
CHAPTER 6Pickers, Pop-up Views, and OverviewsRoll Protos 6-35Roll Protos 6You can use the protos described in this section to present roll views in yo
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-36 View ClassesFigure 6-45 A protoRollBrowser exampleView Classes 6There are two view classes that you
CHAPTER 6Pickers, Pop-up Views, and OverviewsSpecifying the List of Items for a Popup 6-37 The clMonthView view class displays a monthly calendar. Fi
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-38 Specifying the List of Items for a PopupTable 6-2 describes the frame used to specify a string with
CHAPTER 6Pickers, Pop-up Views, and OverviewsSpecifying the List of Items for a Popup 6-39Table 6-3 describes the frame required to specify a two-dime
xxivFax Soup Entries 19-34About Fax Soup Entries 19-34Using Fax Soup Entries 19-34Prefs and Formulas Rolls 19-35About the Prefs and Formulas Rolls 19-
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-40 Specifying the List of Items for a PopupNotePicker items can include 1.x bitmaps but not 2.0 shapes
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-41Summary 6The following sections summarize the reference information in this chapter.General P
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-42 SummaryiconSetup: icon frame,labelCommands: array, // items in listiconBounds: boundsFrame, // boun
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-43protoGeneralPopup 6aProtoGeneralPopup := {_proto: protoGeneralPopup,viewBounds: boundsFrame,v
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-44 SummaryviewFormat: formatFlags,def: frame, // protoTableDef table// definition framescrollAmount:
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-45Map Pickers 6protoCountryPicker 6aProtoCountryPicker := {_proto: protoCountryPicker,viewBound
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-46 SummaryTex t Picker Protos 6protoTextPicker 6aProtoTextPicker := {_proto: protoTextPicker,label: st
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-47PickActionScript: function, // returns selected itemPickCancelledScript: function, // user ca
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-48 Summarytime: integer, // initial start timeformat: symbol, // format to display timeincrement: inte
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-49protoMapTextPicker 6aProtoMapTextPicker := {_proto: protoMapTextPicker,label: string, // pick
xxvChapter 20 Localizing Newton Applications 20-1About Localization 20-1The Locale Panel and the International Frame 20-1Locale and ROM Version 20-2Ho
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-50 SummaryprotoCitiesTextPicker 6aProtoCitiesTextPicker := {_proto: protoCitiesTextPicker,label: strin
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-51protoDatePicker 6aProtoDatePicker := {_proto: protoDatePicker,selectedDates: array, // select
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-52 SummaryprotoYearPopup 6protoYearPopup := {_proto: protoYearPopup,New: function, // creates pop-up v
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-53protoTimeIntervalPopup 6protoTimeIntervalPopup := {_proto: protoTimeIntervalPopup,New: functi
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-54 SummaryOverview Protos 6protoOverview 6aProtoOverview := {_proto: protoOverview,viewBounds : bounds
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-55protoListPicker 6aProtoListPicker := {_proto: protoListPicker,declareSelf : symbol, // Set to
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-56 SummaryprotoNameRefDataDef 6aProtoNameRefDataDef := {_proto: protoNameRefDataDef,name: string, // n
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-57Validate: function, // returns array of invalid// refsModifyEntryPath: function, // entry m
CHAPTER 6 Pickers, Pop-up Views, and Overviews6-58 SummaryallCollapsed: Boolean, // roll collapsed if non-nilindex: integer, // index of item to start
CHAPTER 6Pickers, Pop-up Views, and OverviewsSummary 6-59browsers: array, // frame with array of outline// itemsviewFont: fontSpec,viewFlags : consta
xxviRouting Formats 21-5Current Format 21-8Routing Compatibility 21-8Print Formats 21-8Using Routing 21-8Providing Transport-Based Routing Actions 21-
7-1CHAPTER 7Controls and Other Protos 7Figure 7-0Table 7-0Controls are software objects that provide various user interface capabilities, including sc
CHAPTER 7 Controls and Other Protos7-2 Scroller Protos four new date and time protos: protoDigitalClock, protoSetClock,protoNewSetClock, and protoAMP
CHAPTER 7Controls and Other ProtosScroller Protos 7-3 The protoUpDownScroller is centered on the right side of a view and provides vertical scroll ar
CHAPTER 7 Controls and Other Protos7-4 Scroller ProtosviewRect, and dataRect. Each of these slots is a bounds frame with the following form:{left: 0,
CHAPTER 7Controls and Other ProtosScroller Protos 7-5Scrolling in the Dates Application 7Scrolling in the Dates application allows the user to see the
CHAPTER 7 Controls and Other Protos7-6 Button and Box ProtosKeep in mind that if you set scrollAmounts to values other than the default, your method m
CHAPTER 7Controls and Other ProtosButton and Box Protos 7-7 The protoPictureButton creates a picture that is a button. For more information about the
CHAPTER 7 Controls and Other Protos7-8 Button and Box Protos The protoRadioButton creates a radio button child view of a radio button cluster (based
CHAPTER 7Controls and Other ProtosButton and Box Protos 7-9 The protoLargeCloseBox creates a picture button with an “X” icon that is used to close th
xxviiProtos 21-38Functions and Methods 21-39Application-Defined Methods 21-40Chapter 22 Transport Interface 22-1About Transports 22-1Transport Parts 22
CHAPTER 7 Controls and Other Protos7-10 Button and Box ProtosImplementing a Simple Button 7To provide a simple button in your application, pick a butt
CHAPTER 7Controls and Other ProtosSelection Tab Protos 7-11Selection Tab Protos 7You can use the protos described in this section to display alphabeti
CHAPTER 7 Controls and Other Protos7-12 Gauge and Slider ProtosGauge and Slider Protos 7You can use the gauge and slider protos described in this sect
CHAPTER 7Controls and Other ProtosGauge and Slider Protos 7-13 The clGaugeView class is used to display objects that look like analog bar gauges. Alt
CHAPTER 7 Controls and Other Protos7-14 Time ProtosChangedSlider: func()beginSetVolume(viewValue);:SysBeep();end,...}The example above initializes the
CHAPTER 7Controls and Other ProtosTime Protos 7-15Figure 7-22 A protoNewSetClock view The protoSetClock time proto also displays an analog clock with
CHAPTER 7 Controls and Other Protos7-16 Special View Protos// initialize with current timeViewSetupFormScript: func() begintime := time();end,...};Spe
CHAPTER 7Controls and Other ProtosSpecial View Protos 7-17 The protoDrawer creates a view that looks and acts like the base view of the Extras Drawer
CHAPTER 7 Controls and Other Protos7-18 View Appearance ProtosView Appearance Protos 7You can use the protos described in this section to add to the a
CHAPTER 7Controls and Other ProtosStatus Bar Protos 7-19Status Bar Protos 7You can use the protos described in this section to display a status bar at
xxviiiChapter 23 Endpoint Interface 23-1About the Endpoint Interface 23-1Asynchronous Operation 23-2Synchronous Operation 23-3Input 23-3Data Forms 23-
CHAPTER 7 Controls and Other Protos7-20 SummarySummary 7Scroller Protos 7protoLeftRightScroller 7aProtoLeftRightScroller := {_proto: protoLeftRightScr
CHAPTER 7Controls and Other ProtosSummary 7-21protoHorizontal2DScroller 7aProtoHorizontal2DScroller := {_proto: protoHorizontal2DScroller,scrollView:
CHAPTER 7 Controls and Other Protos7-22 SummaryButton and Box Protos 7protoTextButton 7aProtoTextButton := {_proto: protoTextButton,viewBounds: bounds
CHAPTER 7Controls and Other ProtosSummary 7-23protoOrientation 7aProtoOrientation := {_proto: protoOrientation,viewFlags: integer, // viewFlags consta
CHAPTER 7 Controls and Other Protos7-24 SummaryviewValue: integer, // current value of radio buttonViewDrawScript:function, // to highlight button...}
CHAPTER 7Controls and Other ProtosSummary 7-25protoRCheckbox 7aProtoRCheckbox := {_proto: protoRCheckbox,viewBounds: boundsFrame,viewFormat: formatFla
CHAPTER 7 Controls and Other Protos7-26 SummaryviewValue: integer, // gauge valueminValue: integer, // minimum gauge valuemaxValue: integer, // maximu
CHAPTER 7Controls and Other ProtosSummary 7-27Time Protos 7protoDigitalClock 7aProtoDigitalClock := {_proto: protoDigitalClock,viewFlags: integer, //
CHAPTER 7 Controls and Other Protos7-28 SummaryRefresh: function, // update clockTimeChanged: function, // called when time is changed...}protoAMPMClu
CHAPTER 7Controls and Other ProtosSummary 7-29protoDrawer 7aProtoDrawer := {_proto: protoDrawer,viewFlags: integer, // viewFlags constantsviewBounds:
xxixChapter 24 Built-in Communications Tools 24-1Serial Tool 24-1Standard Asynchronous Serial Tool 24-1Serial Tool with MNP Compression 24-4Framed Asy
CHAPTER 7 Controls and Other Protos7-30 SummaryprotoGlance 7aProtoGlance := {_proto: protoGlance,viewBounds: boundsFrame,viewJustify: justificationFla
CHAPTER 7Controls and Other ProtosSummary 7-31protoDivider 7aProtoDivider:= {_proto: protoDivider,viewBounds: boundsFrame,viewFlags: integer, // viewF
About Text 8-1CHAPTER 8Text and Ink Input and Display 8Figure 8-0Table 8-0This chapter describes how the Newton system handles text and presents inter
CHAPTER 8 Text and Ink Input and Display8-2 About TextWhen the user writes a line of text on the Newton screen, the Newton system software performs a
CHAPTER 8Text and Ink Input and DisplayAbout Text 8-3Caret Insertion Writing Mode 8Caret insertion writing mode is a text input mode that the user can
CHAPTER 8 Text and Ink Input and Display8-4 About TextThe views and protos that you use for text are listed in Table 8-1.About Keyboard Text Input 8Yo
CHAPTER 8Text and Ink Input and DisplayAbout Text 8-5 Use one of the keyboard protos to create keyboard views in your applications. These protos incl
CHAPTER 8 Text and Ink Input and Display8-6 Using TextCompatibility 8One of the significant advances in software functionality in the Newton 2.0 system
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-7instead, they have child views that contain the individual data items. Text items are contained i
iiiTable of ContentsFigures and Tables xxxiiiPreface About This Book xliiiWho Should Read This Book xliiiRelated Books xliiiNewton Programmer’s Refere
xxxChapter 26 Utility Functions 26-1Compatibility 26-2New Functions 26-2New Object System Functions 26-2New String Functions 26-3New Array Functions 2
CHAPTER 8 Text and Ink Input and Display8-8 Using TextHere is an example of a template defining a view of the clEditView class:editor := {...viewClass:
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-9Defining a Line Pattern 8You can define a custom line pattern for drawing the horizontal lines in a
CHAPTER 8 Text and Ink Input and Display8-10 Using TextIMPORTANTYou store view templates (not view objects) in the viewChildren array of an edit view.
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-11// 8 chars of one font, 3 chars of another, 5 chars // of anotherstyles: [8, 18434, 3, 12290, 5,
CHAPTER 8 Text and Ink Input and Display8-12 Using TextOnce a lightweight paragraph view has been instantiated, you cannot dynamically change the view
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-13The slots of protoRichInputLine are described in “protoRichInputLine” (page 7-19) in Newton Prog
CHAPTER 8 Text and Ink Input and Display8-14 Using TextIMPORTANTYou can programmatically access the value of the text slot for theprotoLabelInputLine
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-15Recognition menu. The view configuration is defined by the view flags and the (optional) recognitio
CHAPTER 8 Text and Ink Input and Display8-16 Using TextNoteThe view flags are described in “Views” (page 3-1). The recognition view flags are described
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-17You can modify the size at which ink words are displayed in two ways: by changing the scaling pe
xxxiAppendix The Inside Story on Declare A-1Compile-Time Results A-1Run-Time Results A-2Glossary GL-1Index IN-1
CHAPTER 8 Text and Ink Input and Display8-18 Using TextThe constants you can use in font specifications are shown in “Font Constants for Packed Font In
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-19NoteApple recommending using the normal, bold, and underline font styles. The other styles do no
CHAPTER 8 Text and Ink Input and Display8-20 Using TextROM_fontsystem12underline {family:'espy, face:4, size:12}4206592ROM_fontsystem14 {family:&
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-21The integers in Table 8-5 are derived by packing font family, face, and size information into a
CHAPTER 8 Text and Ink Input and Display8-22 Using TextNote that the “Casual” font uses the symbol 'handwriting for its font family.You can use t
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-23Important Rich String Considerations 8Although the Newton system software allows you to use rich
CHAPTER 8 Text and Ink Input and Display8-24 Using Textview’s 'text and 'styles slots are generated and placed in the context frame of the v
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-25Text and Styles 8Within a paragraph view, text is represented in two slots: the 'text slot
CHAPTER 8 Text and Ink Input and Display8-26 Using TextSetting the Caret Insertion Point 8When you application starts up, you might want to establish
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-27To use the numeric keyboard, which is shown in Figure 8-7, use the symbol 'numericKeyboard.
CHAPTER 8 Text and Ink Input and Display8-28 Using TextIf you want to open one of these keyboards programmatically, use code like the following to sen
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-29Figure 8-10 An example of a protoKeyboardThis proto enables the caret (if it is not already visi
CHAPTER 8 Text and Ink Input and Display8-30 Using TextprotoSmallKeyboardButton 8This proto is used to include a small keyboard button in a view. Tapp
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-31The Key Definitions Array 8Each keyboard view contains a key definitions array, which determines t
CHAPTER 8 Text and Ink Input and Display8-32 Using Textrow1 := [ keyVUnit, keyVUnit, "4",4, keyHUnit+keyVUnit+keyFramed+2*keyInsetUnit+keyAu
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-33 An array. An element of the array is selected and treated as one of the above data types. The
CHAPTER 8 Text and Ink Input and Display8-34 Using TextFigure 8-14 Keyboard codesThe Key Descriptor 8The appearance of each key in a keyboard is deter
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-35Key Dimensions 8The width and height of keys are specified in units, not pixels. A key unit is no
CHAPTER 8 Text and Ink Input and Display8-36 Using TextKey dimensions are specified by summing a combination of horizontal and vertical key unit consta
CHAPTER 8Text and Ink Input and DisplayUsing Text 8-37Each view path must specify the actual view that accepts the input. An example of a suitable pat
xxxiiiFigures and TablesChapter 1Overview1-1Figure 1-1 System software overview 1-2Figure 1-2 Communications architecture 1-12Figure 1-3 Using compone
CHAPTER 8 Text and Ink Input and Display8-38 Using Text a view descended from protoInputLine with the vApplication flag set in theviewFlags slotThe Ca
CHAPTER 8Text and Ink Input and DisplaySummary of Text 8-39Summary of Text 8Text Constants and Data Structures 8Text Flags 8vWidthIsParentWidth (1 <
CHAPTER 8 Text and Ink Input and Display8-40 Summary of TextROM_fontsystem10underline 4204544ROM_fontsystem12 12288ROM_fontsystem12bold 1060864ROM_fon
CHAPTER 8Text and Ink Input and DisplaySummary of Text 8-41Font Face Constants for Packed Integer Font Specifications 8tsPlain 0tsBold 1048576tsItalic
CHAPTER 8 Text and Ink Input and Display8-42 Summary of TextKeyboard Modifier Keys 8kIsSoftKeyboard (1 << 24)kCommandModifier (1 << 25)kShi
CHAPTER 8Text and Ink Input and DisplaySummary of Text 8-43clKeyboardView 8aClEditView:= {_noRepeat: constant,viewBounds: boundsFrame,keyDefinitions:
CHAPTER 8 Text and Ink Input and Display8-44 Summary of Texttext: string,viewFont: constant,viewJustify: constant,viewFormat: constant,viewTransferMod
CHAPTER 8Text and Ink Input and DisplaySummary of Text 8-45labelFont: constant,labelCommands: array, // strings for listcurLabelCommand: integer,inden
CHAPTER 8 Text and Ink Input and Display8-46 Summary of TextprotoKeyboardButton 8aprotoKeyboardButton:= {_proto : protoKeyboardButton,viewFlags: const
CHAPTER 8Text and Ink Input and DisplaySummary of Text 8-47protoPhoneKeyboard 8aprotoPhoneKeyboard:= {_proto : protoPhoneKeyboard,viewBounds: boundsFr
xxxivChapter 5 Stationery 5-1Figure 5-1 The IOU extension in the New picker 5-3Figure 5-2 The IOU extension to the Notes application 5-3Figure 5-3 The
CHAPTER 8 Text and Ink Input and Display8-48 Summary of TextFont Attribute Functions and Methods 8FontAscent(fontSpec)FontDescent(fontSpec)FontHeight(
CHAPTER 8Text and Ink Input and DisplaySummary of Text 8-49Keyboard Functions and Methods 8This section summarizes the functions and methods that you
CHAPTER 8 Text and Ink Input and Display8-50 Summary of TextInput Event Functions and Methods 8This section summarizes the functions and methods that
About the Recognition System 9-1CHAPTER 9Recognition 9Figure 9-0Listing 1-0Table 9-0This chapter and Chapter 10, “Recognition: Advanced Topics,” descr
CHAPTER 9 Recognition9-2 About the Recognition SystemAlthough no recognizers are associated with clicks and strokes, they do pass through the recognit
CHAPTER 9RecognitionAbout the Recognition System 9-3Classifying Strokes 9Recognition is an iterative process that compares raw input strokes with vari
CHAPTER 9 Recognition9-4 About the Recognition Systemmultiple stroke units into meaningful groups. For example, certain letters (such as an uppercase
CHAPTER 9RecognitionAbout the Recognition System 9-5Figure 9-1 Recognizers create units from input strokesShapes 9When the recognition system returns
CHAPTER 9 Recognition9-6 About the Recognition SystemText 9When the recognition system returns a word unit to a view based on the clParagraphView or c
CHAPTER 9RecognitionAbout the Recognition System 9-7recognizer’s letter-by-letter option may produce different results than using the printed recogniz
xxxvFigure 6-35 A protoOverview example 6-22Figure 6-36 A protoSoupOverview example 6-23Figure 6-37 A protoListPicker example 6-24Figure 6-38 A ProtoL
CHAPTER 9 Recognition9-8 About the Recognition SystemclParagraphView view child. Ink text automatically wraps to the paragraph boundaries, just as rec
CHAPTER 9RecognitionAbout the Recognition System 9-9Figure 9-2 Recognition-related view flagsView Flags 9The system supplies a number of constants, cal
CHAPTER 9 Recognition9-10 About the Recognition Systemmultiple bits in the input mask to produce a particular behavior. You can use a recConfig frame
CHAPTER 9RecognitionAbout the Recognition System 9-11Recognition Failure 9Recognition may fail when the handwritten input is too sloppy for the system
CHAPTER 9 Recognition9-12 About the Recognition SystemIMPORTANTAn excessively large user dictionary can slow the system when performing searches that
CHAPTER 9RecognitionAbout the Recognition System 9-13user to make individual decisions about each word in the list, this slip does not permit selectio
CHAPTER 9 Recognition9-14 About the Recognition System the expansions of words that match entries in the expansion dictionary. a graphical represent
CHAPTER 9RecognitionAbout the Recognition System 9-15This section describes only those user preferences for which the system provides a NewtonScript i
CHAPTER 9 Recognition9-16 About the Recognition SystemFigure 9-4 Handwriting Recognition preferencesChecking the “Configure for guest user” checkbox ca
CHAPTER 9RecognitionAbout the Recognition System 9-17can always add new words to the user dictionary programmatically, regardless of which recognizer
xxxviFigure 7-23 A protoAMPMCluster view 7-15Figure 7-24 A protoDragger view 7-16Figure 7-25 A protoDragNGo view 7-16Figure 7-26 A protoGlance view 7-
CHAPTER 9 Recognition9-18 About the Recognition SystemFigure 9-7 Handwriting Settings slipWhen the “Learn my handwriting” checkbox is selected, the sy
CHAPTER 9RecognitionAbout the Recognition System 9-19displays a picker from which the user can choose recognition behaviors that you specify. When thi
CHAPTER 9 Recognition9-20 About the Recognition Systemrecognition takes place. The Entry Flags area of the NTK screen specifies the view flags for this
CHAPTER 9RecognitionUsing the Recognition System 9-21cursive letter styles in the system’s handwriting model are enabled, and the system disables unus
CHAPTER 9 Recognition9-22 Using the Recognition Systemrecognition behavior by setting view flags or providing a recConfig frame. Specifically, clEditVie
CHAPTER 9RecognitionUsing the Recognition System 9-23Obtaining Optimum Recognition Performance 9To obtain the most accurate results from the recogniti
CHAPTER 9 Recognition9-24 Using the Recognition Systemthis regard. If necessary, you can provide a ViewWordScript or ViewChangedScript method that val
CHAPTER 9RecognitionUsing the Recognition System 9-25You can solve this problem by setting the top view’s vClickable flag without providing a ViewClick
CHAPTER 9 Recognition9-26 Using the Recognition SystemDouble Taps” beginning on page 10-41. See also “ViewGestureScript” (page 8-71) in Newton Program
CHAPTER 9RecognitionUsing the Recognition System 9-27When troubleshooting recognition errors, remember that view flags may enable multiple dictionaries
xxxviiChapter 9 Recognition 9-1Figure 9-1 Recognizers create units from input strokes 9-5Figure 9-2 Recognition-related view flags 9-9Figure 9-3 Tex t-
CHAPTER 9 Recognition9-28 Using the Recognition Systemthe cursive recognizer’s letter-by-letter option may be different from those returned by the pri
CHAPTER 9RecognitionUsing the Recognition System 9-29The vNoSpaces flag must appear in an evaluate slot named textFlags that you create in the view. Th
CHAPTER 9 Recognition9-30 Using the Recognition Systemor typing them. To prevent invalid input by these means, you can implement a ViewChangedScript m
CHAPTER 9RecognitionSummary 9-31Summary 9Constants 9Text Recognition View Flags 9Constant Value DescriptionvCharsAllowed 1 << 12or0x01000Enables
CHAPTER 9 Recognition9-32 SummaryNon-Text Recognition View Flags 9Constant Value DescriptionvNothingAllowed 0x00000000or0x0000The view accepts no hand
CHAPTER 9RecognitionSummary 9-33View Flags Enabling Lexical Dictionaries 9Data Structures 9Recognition-Related User Configuration Slots 9Use the GetUse
CHAPTER 9 Recognition9-34 SummarydoTextRecognition true enables text recognition unconditionally.doShapeRecognition true enables shape recognition unc
About Advanced Topics in Recognition 10-1CHAPTER 10Recognition:Advanced Topics 10Figure 10-0Listing 2-0Table 10-0This chapter describes advanced uses
CHAPTER 10 Recognition: Advanced Topics10-2 About Advanced Topics in Recognitionapplications to change these system-wide settings. Instead, individual
CHAPTER 10Recognition: Advanced TopicsAbout Advanced Topics in Recognition 10-3On the other hand, if the view does not supply a recConfig frame, the r
xxxviiiChapter 12 Special-Purpose Objects for Data Storage and Retrieval 12-1Table 12-1 Parts and type identifiers 12-4Chapter 13 Drawing and Graphics
CHAPTER 10 Recognition: Advanced Topics10-4 About Advanced Topics in Recognition values specified by an optional recConfig frame, which may override v
CHAPTER 10Recognition: Advanced TopicsAbout Advanced Topics in Recognition 10-5A formatted comb view utilizes a template you define which specifies char
CHAPTER 10 Recognition: Advanced Topics10-6 About Advanced Topics in RecognitionThe user can enter unrecognized ink by enabling ink text or sketch ink
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-7Compatibility Information 10The ReadDomainOptions function is obsolete.
CHAPTER 10 Recognition: Advanced Topics10-8 Using Advanced Topics in Recognition using protoRecToggle views to specify recognition behavior defining
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-9Creating a recConfig Frame 10For any view that is to use a recConfig fra
CHAPTER 10 Recognition: Advanced Topics10-10 Using Advanced Topics in Recognitionexact complement of slots and values required is determined by the re
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-11Sketch ink, like shapes, is displayed only in views based on the clEdi
CHAPTER 10 Recognition: Advanced Topics10-12 Using Advanced Topics in RecognitionAs an alternative to using a recConfig frame to provide support for i
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-13Manipulating Dictionaries 10You can control the view’s use of dictiona
xxxixFigure 16-9 The ShowFoundItem method displays the view of an overview item 16-9Figure 16-10 Typical status message 16-24Table 16-1 Overview of RO
CHAPTER 10 Recognition: Advanced Topics10-14 Using Advanced Topics in RecognitionTo obtain the best performance and to conserve available memory, crea
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-15If you provide a grid in which the user is to write characters or word
CHAPTER 10 Recognition: Advanced Topics10-16 Using Advanced Topics in Recognition// indent from left of view to first letterconstant kBoxIndent := 4;/
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-17The PurgeAreaCache function causes the recognition system to adopt the
CHAPTER 10 Recognition: Advanced Topics10-18 Using Advanced Topics in Recognition▲ W ARNINGThe SetValue function may not be appropriate for setting th
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-19Using protoRecToggle Views 10A protoRecToggle view changes the recogni
CHAPTER 10 Recognition: Advanced Topics10-20 Using Advanced Topics in RecognitionConfiguring Recognizers and Dictionaries for recToggle Views 10Regardl
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-21Figure 10-5 One recToggle controls all viewsFigure 10-6 Each recToggle
CHAPTER 10 Recognition: Advanced Topics10-22 Using Advanced Topics in RecognitionWhen the view receives input, it uses parent inheritance to find config
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-23Avoid including inappropriate items in the recToggle popup, such as an
ivCommunications Services 1-11NewtonScript Application Communications 1-13Routing Through the In/Out Box 1-13Endpoint Interface 1-14Low-Level Communic
xlChapter 20 Localizing Newton Applications 20-1Figure 20-1 The Locale settings in Preferences 20-2Table 20-1 Using the kIncludeAllElements constant 2
CHAPTER 10 Recognition: Advanced Topics10-24 Using Advanced Topics in RecognitionThe wordInfo frame provides methods that you can use to manipulate it
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-25application’s NTK project; they might be supplied by the user in an in
CHAPTER 10 Recognition: Advanced Topics10-26 Using Advanced Topics in Recognitionsymbol 'custom as its argument, which specifies that the new dict
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-27This approach works well for small dictionaries; for most large dictio
CHAPTER 10 Recognition: Advanced Topics10-28 Using Advanced Topics in Recognition// store the dictionary datadictData := {data:theObj};mySoup:AddXmit(
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-29In addition to setting the view’s vCustomDictionaries flag, you need to
CHAPTER 10 Recognition: Advanced Topics10-30 Using Advanced Topics in RecognitionRemoving Your RAM-Based Custom Dictionary 10It is recommended that yo
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-31Do not use the global functions AddWordToDictionary and RemoveWordFrom
CHAPTER 10 Recognition: Advanced Topics10-32 Using Advanced Topics in RecognitionNoteFuture versions of the system are not guaranteed to have the auto
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-33The RemoveWord method returns true if the word was removed successfull
xliChapter 24 Built-in Communications Tools 24-1Figure 24-1 Default serial framing 24-5Figure 24-2 NetChooser view while searching 24-14Figure 24-3 Ne
CHAPTER 10 Recognition: Advanced Topics10-34 Using Advanced Topics in RecognitionRemoving Words From the Expand Dictionary 10Normally, words are added
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-35Usually, you do not need to load the auto-add dictionary into RAM your
CHAPTER 10 Recognition: Advanced Topics10-36 Using Advanced Topics in RecognitionRemoving Words From the Auto-Add Dictionary 10The RemoveAutoAdd funct
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-37Manipulating Text in protoCharEdit Views 10The default view provided b
CHAPTER 10 Recognition: Advanced Topics10-38 Using Advanced Topics in RecognitionYou may also need to know the boundaries of the word in the text slot
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-39The cells in this example template use filters defined by the format and
CHAPTER 10 Recognition: Advanced Topics10-40 Using Advanced Topics in RecognitionCustomized Processing of Input Strokes 10Setting the vStrokesAllowed
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-41Customized Processing of Double Taps 10To process double taps reliably
CHAPTER 10 Recognition: Advanced Topics10-42 Using Advanced Topics in RecognitionNoteNormally, slot values in the system’s user configuration data are
CHAPTER 10Recognition: Advanced TopicsUsing Advanced Topics in Recognition 10-43GetKeyView().viewInkWordScript := func(strokeBundle) begin // convert
CHAPTER 10 Recognition: Advanced Topics10-44 Summary of Advanced Topics in RecognitionSummary of Advanced Topics in Recognition 10See also “Summary” b
CHAPTER 10Recognition: Advanced TopicsSummary of Advanced Topics in Recognition 10-45Lexical Dictionaries 10System-Supplied RecConfig Frames 10Data Str
CHAPTER 10 Recognition: Advanced Topics10-46 Summary of Advanced Topics in RecognitionSystem-Supplied RecConfig Frames 10// recognize ink or textROM_rc
CHAPTER 10Recognition: Advanced TopicsSummary of Advanced Topics in Recognition 10-47// use custom dictionaries onlyinputMask: vCustomDictionaries, //
CHAPTER 10 Recognition: Advanced Topics10-48 Summary of Advanced Topics in Recognition// Positive offset (in pixels) from base // to the top of an upp
CHAPTER 10Recognition: Advanced TopicsSummary of Advanced Topics in Recognition 10-49System-Supplied ProtoCharEdit Templates 10GetLocale().phoneFilter
CHAPTER 10 Recognition: Advanced Topics10-50 Summary of Advanced Topics in Recognition// dictionaries to use when vCustomDictionaries is set// single
CHAPTER 10Recognition: Advanced TopicsSummary of Advanced Topics in Recognition 10-51// height of cells in pixelscellHeight: int, // system-provided d
CHAPTER 10 Recognition: Advanced Topics10-52 Summary of Advanced Topics in RecognitionprotoCharEdit Templates 10ROM_numberFilter // general-purpose nu
CHAPTER 10Recognition: Advanced TopicsSummary of Advanced Topics in Recognition 10-53ProtoWordInfo 10aWordInfoFrame := {// ID of view that owns this d
xliiiPREFACEAbout This BookThis book, Newton Programmer’s Guide, is the definitive guide to Newton programming, providing conceptual information and in
CHAPTER 10 Recognition: Advanced Topics10-54 Summary of Advanced Topics in RecognitionAdditional Recognition Functions and Methods 10Dictionary Functi
CHAPTER 10Recognition: Advanced TopicsSummary of Advanced Topics in Recognition 10-55Deferred Recognition Functions 10Recognize(strokes, config, doGro
About Data Storage on Newton Devices 11-1CHAPTER 11Data Storage and Retrieval 11Figure 11-0Table 11-0The Newton operating system supplies a suite of o
CHAPTER 11 Data Storage and Retrieval11-2 About Data Storage on Newton DevicesIntroduction to Data Storage Objects 11Newton devices represent data as
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-3lookup, message-passing, and inheritance in NewtonScript, see The NewtonS
CHAPTER 11 Data Storage and Retrieval11-4 About Data Storage on Newton Devicesdifferent from soups that are not part of a union. Unless specifically no
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-5the query specification or query spec. The query spec describes the kind o
CHAPTER 11 Data Storage and Retrieval11-6 About Data Storage on Newton Devicesapplications might require notification include creating soups; deleting
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-7For information on using store objects, see “Using Stores” beginning on p
xlivPREFACE The NewtonScript Programming Language. This book comes with the Newton Toolkit development environment. It describes the NewtonScript pro
CHAPTER 11 Data Storage and Retrieval11-8 About Data Storage on Newton DevicesThe soup definition frame specifies a name that identifies the soup to the
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-9You can create your own specialized indexes for any soup. You need to cre
CHAPTER 11 Data Storage and Retrieval11-10 About Data Storage on Newton Devicesdata from a different locale. To take advantage of this behavior, the a
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-11Querying for Indexed Values 11Queries can retrieve items according to th
CHAPTER 11 Data Storage and Retrieval11-12 About Data Storage on Newton DevicesIndexes sort key values in ascending order unless the index spec frame
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-13exclusive forms of the same endrange selector; for example, a single que
CHAPTER 11 Data Storage and Retrieval11-14 About Data Storage on Newton Devicescursor is positioned on the next valid entry in index key order. Simila
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-15key values, indexValidTest functions are fast and efficient because index
CHAPTER 11 Data Storage and Retrieval11-16 About Data Storage on Newton Devicesunless this behavior is requested explicitly, the words "blackSmit
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-17Figure 11-5 Cursor presents discontiguous index key values contiguouslyE
xlvPREFACESample Code 0The Newton Toolkit development environment, from Apple Computer, includes many sample code projects. You can examine these samp
CHAPTER 11 Data Storage and Retrieval11-18 About Data Storage on Newton DevicesAll frames are compressed automatically when they are stored as soup en
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-19The most important factor to consider with respect to the kind of data i
CHAPTER 11 Data Storage and Retrieval11-20 About Data Storage on Newton Devices Although the user might enter data dynamically, there might be a larg
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-21Soup Compatibility Information 11This section contains compatibility inf
CHAPTER 11 Data Storage and Retrieval11-22 About Data Storage on Newton DevicesThe following soup methods and functions are obsolete:SetupCardSoups()
CHAPTER 11Data Storage and RetrievalAbout Data Storage on Newton Devices 11-23Null Union Soups 11Under unusual circumstances a 1.x application may enc
CHAPTER 11 Data Storage and Retrieval11-24 About Data Storage on Newton DevicesQuery Global Function Is Obsolete 11Queries are now performed by the Qu
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-25Heap Space Requirements of Words and Text Queries 11On systems prior to ver
CHAPTER 11 Data Storage and Retrieval11-26 Using Newton Data Storage ObjectsThis section presumes understanding of the material in “About Data Storage
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-27When creating soups from within your application (form) part’s InstallScrip
xlviPREFACE Italic typeface. Italic typeface is used in code to indicate replace-able items, such as the names of function parameters, which you must
CHAPTER 11 Data Storage and Retrieval11-28 Using Newton Data Storage Objects// get from myUSoup all entries having an aSlot slotlocal myCursor := myUS
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-29You can use the EntryUndoChangesXmit function to undo the changes to the so
CHAPTER 11 Data Storage and Retrieval11-30 Using Newton Data Storage ObjectsReferencing Stores 11The GetStores global function returns an array of ref
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-31for such stores. Do not use the global function IsReadOnly to test store ob
CHAPTER 11 Data Storage and Retrieval11-32 Using Newton Data Storage Objectsmethod retrieves the value of a specified slot in the store information fra
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-33Registering and Unregistering Soup Definitions 11The RegUnionSoup global fun
CHAPTER 11 Data Storage and Retrieval11-34 Using Newton Data Storage Objectsindexes: [{structure: 'slot, path: 'aSlot, type: 'string}]}
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-35Adding Entries to Soups 11This section describes how to add a frame to a un
CHAPTER 11 Data Storage and Retrieval11-36 Using Newton Data Storage ObjectsAfter creating the new soup entry, these methods transmit a soup change no
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-37▲ W ARNINGEach soup has only one tags index; if you add a tags index to a s
xlviiPREFACE2. Edit the viewBounds slot to match the values shown in the book.3. Add each of the other slots you see listed in the frame, setting thei
CHAPTER 11 Data Storage and Retrieval11-38 Using Newton Data Storage ObjectsThis approach provides the following benefits: It prevents your applicati
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-39 the use of internationalized sorting order queries on multiple-slot inde
CHAPTER 11 Data Storage and Retrieval11-40 Using Newton Data Storage Objectsparticular slot, the soup must be indexed on that slot. For example, the f
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-41at or before the position that would be occupied by 27 in the index is the
CHAPTER 11 Data Storage and Retrieval11-42 Using Newton Data Storage ObjectsThe query passes the entire entry to the validTest method, rather than jus
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-43set operator to select entries marked with only the 'flower and '
CHAPTER 11 Data Storage and Retrieval11-44 Using Newton Data Storage ObjectsThis query finds entries containing the words "Bob", "Bobby&
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-45following code fragment illustrates a query that returns entries having str
CHAPTER 11 Data Storage and Retrieval11-46 Using Newton Data Storage Objectsinternationalized index: cursor methods such as Next and Prev return entri
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-47Sending the Reset message to the cursor positions it at the first valid entr
xlviiiPREFACEUndocumented System Software Objects 0When browsing in the NTK Inspector window, you may see functions, methods, and data objects that ar
CHAPTER 11 Data Storage and Retrieval11-48 Using Newton Data Storage ObjectsA multiple-slot query can be performed only on a soup that has a multiple-
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-49A multiple-slot index solves this problem by sorting entries according to m
CHAPTER 11 Data Storage and Retrieval11-50 Using Newton Data Storage ObjectsInstead of using single values for the indexPath, beginKey, beginExclKey,e
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-51This time around, the query again skips over the "Bates" entry in
CHAPTER 11 Data Storage and Retrieval11-52 Using Newton Data Storage Objects▲ W ARNINGIndex keys are limited to a total of 39 unicode characters (80 b
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-53mySoup:MakeKey(["12345678901234567890", 3,"ABCDEFGHIJKLMNOPQ
CHAPTER 11 Data Storage and Retrieval11-54 Using Newton Data Storage Objects getting the number of entries in cursor data getting an index key from
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-55Moving the Cursor 11This section describes various ways to position the cur
CHAPTER 11 Data Storage and Retrieval11-56 Using Newton Data Storage ObjectsYou can use the Move method to move the cursor multiple positions. For exa
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-57Note that if the query used to generate the cursor specifies a beginKey valu
Operating System 1-1CHAPTER 1Overview 1Figure 1-0Table 1-0This chapter describes the general architecture of the Newton system software, which is divi
CHAPTER 11 Data Storage and Retrieval11-58 Using Newton Data Storage ObjectsSaving Frames as Soup Entries 11To save a frame as a soup entry, pass the
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-59No more than 32 KB of text (total of all strings, keeping in mind that one
CHAPTER 11 Data Storage and Retrieval11-60 Using Newton Data Storage ObjectsWhen the frame is constructed from the entry, it is cached in memory. At t
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-61Copying Entries 11The EntryCopyXmit global function and the CopyEntriesXmit
CHAPTER 11 Data Storage and Retrieval11-62 Using Newton Data Storage ObjectsNoteThe EntryCopyXmit method copies the cached entry—not the original soup
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-63In contrast, the EntryUndoChanges function clears the entry cache without w
CHAPTER 11 Data Storage and Retrieval11-64 Using Newton Data Storage Objects control how and when notifications are sentThe first part of this section
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-65▲ W ARNINGAny callback function registered by the RegSoupChangefunction mus
CHAPTER 11 Data Storage and Retrieval11-66 Using Newton Data Storage ObjectsYour callback function must take any action that is appropriate to respond
CHAPTER 11Data Storage and RetrievalUsing Newton Data Storage Objects 11-67changeSym parameter, the change notification is not sent, but the function
vEffects of System Resets on Application Data 2-7Flow of Control 2-8Using Memory 2-8Localization 2-9Developer Signature Guidelines 2-9Signature 2-9How
CHAPTER 1 Overview1-2 Operating SystemFigure 1-1 System software overviewNewton HardwareOperating SystemOperatingSystemSystem ServicesFindFilingSoundB
CHAPTER 11 Data Storage and Retrieval11-68 Summary of Data StorageSummary of Data Storage 11This section summarizes data structures, functions, object
CHAPTER 11Data Storage and RetrievalSummary of Data Storage 11-69Multiple-Slot Index Specification Frame 11{// index keys may be multiple slot valuesst
CHAPTER 11 Data Storage and Retrieval11-70Summary of Data Storage// maximum index key value examined by this query// for all entries, (entry.indexPath
CHAPTER 11Data Storage and RetrievalSummary of Data Storage 11-71// optional tags query spec frame; see page 11-71tagSpec: {equal:[t1, t2, …tN], all:[
CHAPTER 11 Data Storage and Retrieval11-72 Summary of Data Storagestore:IsValid()SetDefaultStore(newDefaultStore)store:SetInfo(slotSymbol,value)store:
CHAPTER 11Data Storage and RetrievalSummary of Data Storage 11-73soupOrUsoup:GetSize()uSoup:GetSoupList()soup:GetStore()GetUnionSoupAlways(soupNameStr
CHAPTER 11 Data Storage and Retrieval11-74 Summary of Data StorageEntryIsResident(entry)EntryModTime(entry)EntryMoveXmit(entry, newSoup, changeSym)Ent
About Special-Purpose Storage Objects 12-1CHAPTER 12Special-Purpose Objects for Data Storage and Retrieval 12Figure 12-0Table 12-0This chapter describ
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-2 About Special-Purpose Storage ObjectsVirtual Binary Objects 12The size of any Ne
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalAbout Special-Purpose Storage Objects 12-3Normal binary objects encapsulate their data
CHAPTER 1OverviewOperating System 1-3Another operating system task of interest is the Inker. The Inker task is responsible for gathering and displayin
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-4 About Special-Purpose Storage ObjectsExcept for soup parts, all the parts listed
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalAbout Special-Purpose Storage Objects 12-5in a local soup. Your mock entry could resid
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-6 About Special-Purpose Storage Objects// create new mock entry w/ no cached frame
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalUsing Special-Purpose Data Storage Objects 12-7Using Special-Purpose Data Storage Obje
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-8 Using Special-Purpose Data Storage ObjectsYou can use the IsSameEntry function t
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalUsing Special-Purpose Data Storage Objects 12-9The NewVBO and NewCompressedVBO store m
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-10 Using Special-Purpose Data Storage ObjectsA VBO becomes permanent only when it
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalUsing Special-Purpose Data Storage Objects 12-11The following code fragment adds sound
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-12 Using Special-Purpose Data Storage Objects// decide to go back to the originalE
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalUsing Special-Purpose Data Storage Objects 12-13Creating a Store Part 12To create a st
CHAPTER 1 Overview1-4 System ServicesThe system performs automatic memory management of the NewtonScript heap. You don’t need to worry about memory al
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-14 Using Special-Purpose Data Storage ObjectsGetting the Store Part 12Store parts
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalUsing Special-Purpose Data Storage Objects 12-15Implementing the EntryAccess Method 12
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-16 Using Special-Purpose Data Storage ObjectsTesting the Validity of a Mock Entry
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalSummary of Special-Purpose Data Storage Objects 12-17Summary of Special-Purpose Data S
CHAPTER 12 Special-Purpose Objects for Data Storage and Retrieval12-18 Summary of Special-Purpose Data Storage ObjectsSafeFreezePackage(pkgRef)SafeMov
CHAPTER 12Special-Purpose Objects for Data Storage and RetrievalSummary of Special-Purpose Data Storage Objects 12-19Application-Defined Mock Entry Han
About Drawing 13-1CHAPTER 13Drawing and Graphics 13Figure 13-0Table 13-0This chapter describes how to draw graphical objects such as lines and rectang
CHAPTER 13 Drawing and Graphics13-2 About DrawingNote that for all of the functions described in this chapter: The coordinates you specify are interp
CHAPTER 13Drawing and GraphicsAbout Drawing 13-3Figure 13-1 A line drawn with different bit patterns and pen sizesA rectangle can be defined by two poi
CHAPTER 1OverviewSystem Services 1-5Object Storage System 1This system is key to the Newton information architecture. The object storage system provid
CHAPTER 13 Drawing and Graphics13-4 About DrawingDrawing also provides functions that allow you to perform a variety of mathematical calculations on r
CHAPTER 13Drawing and GraphicsAbout Drawing 13-5A rounded rectangle is a rectangle with rounded corners. The figure is defined by the rectangle itself,
CHAPTER 13 Drawing and Graphics13-6 About DrawingFigure 13-6 A polygonA region is an arbitrary area or set of areas, the outline of which is one or mo
CHAPTER 13Drawing and GraphicsAbout Drawing 13-7can draw something that was defined in another program, with great flexibility and without having to kno
CHAPTER 13 Drawing and Graphics13-8 About DrawingDrawing Compatibility 13The following new functionality has been added for Newton OS 2.0. For complet
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-9Changes to View Classes 13The icon slot of a view of the clPictureView class can now con
CHAPTER 13 Drawing and Graphics13-10 Using the Drawing InterfaceIf you want to redraw a view explicitly at any particular time, you need to send it th
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-11For example, you might nest arrays to create the hierarchy of shapes and styles depicte
CHAPTER 13 Drawing and Graphics13-12 Using the Drawing InterfaceDefault Transfer Mode 13The default transfer mode is actually a split state: bitmaps a
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-13If the style frame includes a clipping slot, the drawing of all shapes affected by this
CHAPTER 1 Overview1-6 System ServicesThe object storage system is optimized for small chunks of data and is designed to operate in tight memory constr
CHAPTER 13 Drawing and Graphics13-14 Using the Drawing InterfaceUsing Drawing View Classes and Protos 13Four view classes and three protos, which you
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-15Displaying Bitmaps, Pictures, and Graphics Shapes 13You can use a view of the clPicture
CHAPTER 13 Drawing and Graphics13-16 Using the Drawing InterfaceviewFormat: nil,ViewSetupFormScript: func()begin// aView is the view to be scaledself.
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-17Using Bitmaps 13You can dynamically create and destroy bitmaps, draw into them, and per
CHAPTER 13 Drawing and Graphics13-18 Using the Drawing InterfaceMaking CopyBits Scale Its Output Bitmap 13CopyBits uses the bounds of the bitmap passe
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-19Figure 13-10 Example of ViewIntoBitmap method Rotating or Flipping a Bitmap 13Use the M
CHAPTER 13 Drawing and Graphics13-20 Using the Drawing InterfaceImporting Macintosh PICT Resources 13The following information applies to the Mac OS v
CHAPTER 13Drawing and GraphicsUsing the Drawing Interface 13-21You can also use MakePict:myText := MakePict([{penpattern: 0, font: ...}, rect, {font:
CHAPTER 13 Drawing and Graphics13-22 Using the Drawing InterfaceNotice that there are two types of pictures: bitmaps (a frame with bits, a bounds, and
CHAPTER 13Drawing and GraphicsSummary of Drawing 13-23Summary of Drawing 13Data Structure 13Style Frame 13aStyle := {transferMode : constant, // trans
CHAPTER 1OverviewSystem Services 1-7Text Input and Recognition 1The Newton recognition system uses a sophisticated multiple-recognizer architecture. T
CHAPTER 13 Drawing and Graphics13-24 Summary of DrawingclRemoteView 13clRemoteView := {stepChildren : int, // specifies a single viewviewBounds: int,
CHAPTER 13Drawing and GraphicsSummary of Drawing 13-25myImageView:ScrollBy : function, // scrolls an imagemyImageView:ZoomBy : function, // makes an i
CHAPTER 13 Drawing and Graphics13-26 Summary of DrawingtrackWhileScrolling : integer, // tracks the grey box...}Functions and Methods 13Bitmap Functio
CHAPTER 13Drawing and GraphicsSummary of Drawing 13-27IsPtInRect(x, y, bounds)FitToBox(sourceBox, boundingBox, justify)OffsetRect(rect, deltaX, deltaY
About Newton Sound 14-1CHAPTER 14Sound 14Figure 14-0Table 14-0This chapter describes how to use sound in your application and how to manipulate Newton
CHAPTER 14 Sound14-2 About Newton SoundAll operations on sound frames are created by sending messages to a sound channel that encapsulates the sound f
CHAPTER 14SoundAbout Newton Sound 14-3For example, to play a sound in ROM when the view opens, place its name in the view’s showSound slot. In fact, a
CHAPTER 14 Sound14-4 Using SoundUsing Sound 14This section describes how to use sound to perform specific tasks. See NewtonToolkit User’s Guide for des
CHAPTER 14SoundUsing Sound 14-5Creating Sound Frames Procedurally 14To create a sound frame, you usually need to create a copy of the sound frame you
CHAPTER 1 Overview1-8 System ServicesStationery 1Stationery is a capability of the system that allows applications to be extended by other developers.
CHAPTER 14 Sound14-6 Using SoundCreating a Sound Channel for Playback 14You create a sound channel by sending it the Open function.The code that creat
CHAPTER 14SoundUsing Sound 14-7Synchronous and Asynchronous Sound 14When a sound is played asynchronously, the playback can be intermixed with other t
CHAPTER 14 Sound14-8 Using Soundclipped off with each new call to the PlaySoundSync function. In fact, it’s likely that you won’t hear twenty sounds i
CHAPTER 14SoundUsing Sound 14-9Pitch Shifting 14In general, you can set the value of a sound frame’s samplingRate slot to any float value less than tha
CHAPTER 14 Sound14-10 Using SoundFor an example that uses output from a view based on the protoKeypadprototype, see the Newton DTS sample code on this
CHAPTER 14SoundSummary of Sound 14-11Summary of Sound 14Data Structures 14SndFrame Structure 14mySndFrame := {_proto: mySndFrame,sndFrameType : symbo
CHAPTER 14 Sound14-12 Summary of SoundFunctions and Methods 14view:Dial(numberString,where)GetVolume()PlaySoundSync(soundFrameRef)RawDial(number, whe
About Filing 15-1CHAPTER 15Filing 15Figure 15-0Table 15-0This chapter describes how your application can support the Filing service. This service allo
CHAPTER 15 Filing15-2 About FilingYour application must provide a target view that can manipulate the target. The target view is usually the same view
CHAPTER 15FilingAbout Filing 15-3When the user taps the protoFilingButton view, it displays the Filing slip shown in Figure 15-2.Figure 15-2 Filing sl
CHAPTER 1OverviewSystem Services 1-9Imaging and Printing 1At the operating system level, the Newton imaging and printing software is based on an objec
CHAPTER 15 Filing15-4 About FilingFiling and other system services display user messages containing a string that is the user-visible name of your app
CHAPTER 15FilingAbout Filing 15-5When no external store is available or the value of the doCardRouting slot isnil, the system displays the simplified v
CHAPTER 15 Filing15-6 About FilingWhen the user taps the File button, the system invokes the GetTargetInfo method to discover the target and the targ
CHAPTER 15FilingAbout Filing 15-7The protoClockFolderTab is a variation on protoNewFolderTabthat displays the current time as its title text. Do not a
CHAPTER 15 Filing15-8 About Filingon the internal store, the external store or both; that is, the user can specify a stores filter in addition to a lab
CHAPTER 15FilingAbout Filing 15-9Filing Compatibility Information 15Version 2.0 of the Newton operating system supports earlier versions of the Filing
CHAPTER 15 Filing15-10 Using the Filing ServiceThe new slots appObjectFileThisIn and appObjectFileThisOn support localization of your application’s Fi
CHAPTER 15FilingUsing the Filing Service 15-11 Create a storesFilter slot in your application’s target view Implement the FileThis and NewFilingFilt
CHAPTER 15 Filing15-12 Using the Filing ServiceCreating the appAll Slot 15You must create in your application’s base view an appAll slot containing a
CHAPTER 15FilingUsing the Filing Service 15-13Specifying the Target 15The GetTargetInfo method identifies the current target and target view to the sys
CHAPTER 1 Overview1-10 System ServicesBesides the sounds that are built into the system ROM, you can import external sound resources into an applicati
CHAPTER 15 Filing15-14 Using the Filing ServiceCreating the labelsFilter slot 15Your application’s target view must supply a labelsFilter slot. This s
CHAPTER 15FilingUsing the Filing Service 15-15declare your folder tab view to the application’s base view. The system sets the folder tab view’s bound
CHAPTER 15 Filing15-16 Using the Filing ServiceThe arguments to the FileThis method supply all the information necessary to file a soup entry, includin
CHAPTER 15FilingUsing the Filing Service 15-17perform any other actions that are appropriate, such as redrawing views affected by the change in filing
CHAPTER 15 Filing15-18 Using the Filing Service// now redraw views affected by the change// NOTE: You could keep track of the original// labelsFilter
CHAPTER 15FilingUsing the Filing Service 15-19Using Local or Global Folders Only 15To suppress the display of either local or global folders in the Fi
CHAPTER 15 Filing15-20 SummarySummary 15This section summarizes the data structures, protos, functions, and methods used by the Filing service.Data St
CHAPTER 15FilingSummary 15-21Filing Protos 15protoFilingButton 15myFilingButtonView := // do not override ViewClickScript; use ButtonClickScript inste
CHAPTER 15 Filing15-22 SummaryprotoClockFolderTab 15myClockFolderTabView := {{_parent: myAppBaseView, // see page 15-20_proto: { protoClockFolderTab,
About the Find Service 16-1CHAPTER 16Find 16Figure 16-0Table 16-0This chapter describes how your application can support finding text, dates, or your o
CHAPTER 1OverviewCommunications Services 1-11If you want to allow the user to search for data stored by your application, you need to implement certai
CHAPTER 16 Find16-2 About the Find ServiceFigure 16-1 The system-supplied Find slipThe system-supplied Find slip contains an input line that specifies
CHAPTER 16FindAbout the Find Service 16-3Searching for data in the current application only is called a Local find operation. Figure 16-3 depicts a Loc
CHAPTER 16 Find16-4 About the Find ServiceIn addition, an application can support searches of multiple data sets. For example, a personal finance progr
CHAPTER 16FindAbout the Find Service 16-5Figure 16-6 The Find overview The user can tap items in the Find overview to display them. As items are displ
CHAPTER 16 Find16-6 Using the Find ServiceCompatibility Information 16The current version of the Find service opens in the text or date find mode last
CHAPTER 16FindUsing the Find Service 16-7The only significant difference between a date find and a text find is that a different search method locates th
CHAPTER 16 Find16-8 Using the Find ServiceROM_CompatibleFinder proto, the string to display for each found item is contained in the title slot of each
CHAPTER 16FindUsing the Find Service 16-9Figure 16-9 The ShowFoundItem method displays the view of an overview item The Find overview provides Routing
CHAPTER 16 Find16-10 Using the Find ServiceThe most important difference between Local finds and other kinds of find operations is that when the system
CHAPTER 16FindUsing the Find Service 16-11 Employ multiple data sets from one application in a Selected find by adding the method AppFindTargets, and
viChanges to Existing Functions and Methods 3-31New Warning Messages 3-32Obsolete Functions and Methods 3-32Using Views 3-32Getting References to View
CHAPTER 1 Overview1-12 Communications ServicesThe communication architecture is flexible, supporting complex communication needs. The architecture is a
CHAPTER 16 Find16-12 Using the Find ServiceThe full complement of slots in the finder frame resulting from your searches varies according to the finder
CHAPTER 16FindUsing the Find Service 16-13NoteThe ROM_SoupFinder and ROM_CompatibleFindermethodsMakeFoundItem and AddFoundItem are internal methods, w
CHAPTER 16 Find16-14 Using the Find ServiceIf your application does not store data as soup entries, you can use the ROM_CompatibleFinder proto as the
CHAPTER 16FindUsing the Find Service 16-15Although the implementation of a search method is for the most part application specific, some general requir
CHAPTER 16 Find16-16 Using the Find ServiceUsing Your Own Text-Searching Method 16The following code example illustrates the kinds of tasks you must p
CHAPTER 16FindUsing the Find Service 16-17Finding Text With a ROM_CompatibleFinder 16The following example shows how to use the ROM_CompatibleFinder p
CHAPTER 16 Find16-18 Using the Find Service// We may also add slots here...};// Append myFinder frame to system’s results arrayAddArraySlot(results, m
CHAPTER 16FindUsing the Find Service 16-19querySpecFrame := {dateBefore : {indexPath : 'timeStamp, endKey: findTime,},dateAfter : {indexPath : &a
CHAPTER 16 Find16-20 Using the Find Servicelimit a Find operation to certain data sets of an application. For example, a personal finance program may h
CHAPTER 16FindUsing the Find Service 16-21NoteApplications implementing these methods must also implement the usual Find and DateFind methods since a
CHAPTER 1OverviewCommunications Services 1-13 transport interface communication tool interfaceThe first two, routing and endpoint interfaces, are ava
CHAPTER 16 Find16-22 Using the Find ServiceYour FindSoupExcerpt method may also extract extra information if the finder frame has been set up to hold a
CHAPTER 16FindUsing the Find Service 16-23In the body of this method, you need to do whatever is necessary to display the soup entry myEntry. Typicall
CHAPTER 16 Find16-24 Using the Find ServicebeginmyApp:Open();myApp:ShowFoundItem (items[index], self);end;end,...}Replacing the Built-in Find Slip 16
CHAPTER 16FindUsing the Find Service 16-25The following code fragment shows how to use the statusView parameter to display a progress message to the u
CHAPTER 16 Find16-26 SummarySummary 16Finder Protos 16mySoupFinder:= { // Use to find soup entries._proto: ROM_SoupFinder,owner:self, // View that get
CHAPTER 16FindSummary 16-27myCompatibleFinder:= {// Use to find data stored in // non-soup data structures. //Override most to fit your data. _proto:
CHAPTER 16 Find16-28 SummaryFunctions and Methods 16RegFindApps(appSymbol) //registers app. for global & //selected findsUnRegFindApps(appSymbol)
About Additional System Services 17-1CHAPTER 17Additional System Services 17Figure 17-0Table 17-0This chapter discusses system services not covered el
CHAPTER 17 Additional System Services17-2 About Additional System Servicesa function object to redo the original function or method. Thus tapping the
CHAPTER 17Additional System ServicesAbout Additional System Services 17-3Online Help 17Your application can provide a protoInfoButton view that displa
CHAPTER 1 Overview1-14 Communications Servicesinterface. You need to use the transport or endpoint interfaces only when writing custom communication t
CHAPTER 17 Additional System Services17-4 About Additional System ServicesFigure 17-2 Alarm slip with Snooze buttonPeriodic Alarms 17The periodic alar
CHAPTER 17Additional System ServicesAbout Additional System Services 17-5Alarms Compatibility 17All alarm information described here is new to the New
CHAPTER 17 Additional System Services17-6 About Additional System ServicesStatus Slips With Progress Indicators 17For complex operations requiring mor
CHAPTER 17Additional System ServicesUsing Additional System Services 17-7Power Registry 17The Power Registry implements a cooperative model for poweri
CHAPTER 17 Additional System Services17-8 Using Additional System ServicesUsing Undo Actions 17The following code example shows how to provide undo ca
CHAPTER 17Additional System ServicesUsing Additional System Services 17-9Avoiding Undo-Related “Bad Package” Errors 17The AddUndoAction method saves t
CHAPTER 17 Additional System Services17-10 Using Additional System ServicesNoteDo not install idler objects having idle time intervals of less than 10
CHAPTER 17Additional System ServicesUsing Additional System Services 17-11Using Alerts and Alarms 17This section describes the use of functions and me
CHAPTER 17 Additional System Services17-12 Using Additional System ServicesThe following code example adds an alarm set to execute in five minutes:AddA
CHAPTER 17Additional System ServicesUsing Additional System Services 17-13The following code example removes all alarms an application has scheduled f
CHAPTER 1OverviewApplication Components 1-15Communication Tool Interface 1Underlying the NewtonScript interface is the low-level communications system
CHAPTER 17 Additional System Services17-14 Using Additional System ServicesIn any case, debugging your callback function is difficult because any excep
CHAPTER 17Additional System ServicesUsing Additional System Services 17-152. Define another method in your application’s base view named PeriodicAlarm.
CHAPTER 17 Additional System Services17-16 Using Additional System ServicesTo add an action to the notify icon and display it, call the AddAction meth
CHAPTER 17Additional System ServicesUsing Additional System Services 17-17performing the myFunc function, pass it as the value of the workFunc paramet
CHAPTER 17 Additional System Services17-18 Using Additional System ServicesThe code above shows the two ways in which your code can respond when the u
CHAPTER 17Additional System ServicesUsing Additional System Services 17-192. Open the status slip. There are three parts to this process: Instantiate
CHAPTER 17 Additional System Services17-20 Using Additional System ServicesFigure 17-8 Built-in status view configurations If you want to use a system-
CHAPTER 17Additional System ServicesUsing Additional System Services 17-21includes an InitialSetup frame initializes this view automatically before it
CHAPTER 17 Additional System Services17-22 Using Additional System ServicesinitialSetup: // used to initialize view automatically{name: 'vMyBarbe
CHAPTER 17Additional System ServicesUsing Additional System Services 17-23And be sure to include this in your application’s ViewQuitScript to get rid
CHAPTER 1 Overview1-16 Application Componentsapplication using these components, Newton applications tend to be much smaller in size than similar appl
CHAPTER 17 Additional System Services17-24 Using Additional System ServicesBecause the ViewSet method rebuilds and updates all the status slip’s child
CHAPTER 17Additional System ServicesUsing Additional System Services 17-25Registering Login Screen Functions 17If you want a power-on function that br
CHAPTER 17 Additional System Services17-26 Using Additional System Servicescommunications endpoint, it can return the 'holdYourHorses symbol to d
CHAPTER 17Additional System ServicesSummary of Additional System Services 17-27Summary of Additional System Services 17This section summarizes the ser
CHAPTER 17 Additional System Services17-28 Summary of Additional System ServicesFunctions and Methods 17myApp:AlarmsEnabled() //call PeriodicAlarms?my
CHAPTER 17Additional System ServicesSummary of Additional System Services 17-29Power Registry 17Functions and Methods 17BatteryCount() //returns batte
About the Assistant 18-1CHAPTER 18Intelligent Assistant 18Figure 18-0Table 18-0The Intelligent Assistant is a system service that attempts to complete
CHAPTER 18 Intelligent Assistant18-2 About the Assistanttemplates may be supplied by the system or by your application. Some system-supplied templates
CHAPTER 18Intelligent AssistantAbout the Assistant 18-3Figure 18-1 Assist slipWhen prompted by the Assist slip, the user must provide additional infor
CHAPTER 1OverviewUsing System Software 1-17The NewtApp framework consists of a special collection of protos that are designed to be used together in a
CHAPTER 18 Intelligent Assistant18-4 About the AssistantTo allow the user to repeat recent actions easily, the bottom portion of the Please picker dis
CHAPTER 18Intelligent AssistantAbout the Assistant 18-5Programmer’s Overview 18This section describes how the templates, frames and methods used by th
CHAPTER 18 Intelligent Assistant18-6 About the AssistantYour task template designates one action template as its primary action. The primary action is
CHAPTER 18Intelligent AssistantAbout the Assistant 18-7Figure 18-4 Simplified overview of the Assistant’s matching processAction Templatecall_act := {
CHAPTER 18 Intelligent Assistant18-8 About the AssistantYou define the PostParse method in your task template. Your PostParsemethod must perform any ac
CHAPTER 18Intelligent AssistantAbout the Assistant 18-9"555-1234" as having the format of a telephone number. Based on that information, the
CHAPTER 18 Intelligent Assistant18-10 About the AssistantThe Signature and PreConditions Slots 18Your task template must define two slots, called signa
CHAPTER 18Intelligent AssistantAbout the Assistant 18-11The Assistant creates a slot in the task frame only when a template is matched. For example, i
CHAPTER 18 Intelligent Assistant18-12 About the Assistantvalue "Bob Anderson", that element of the phrases array stores the entire string&qu
CHAPTER 18Intelligent AssistantAbout the Assistant 18-13Resolving Template-Matching Conflicts 18Template matching conflicts may arise when a template’s
CHAPTER 1 Overview1-18 The NewtonScript LanguageThe NewtonScript Language 1You write Newton applications in NewtonScript, a dynamic object-oriented la
CHAPTER 18 Intelligent Assistant18-14 About the AssistantIf you specify the 'dyna_user_action symbol as the first element of your task template’s
CHAPTER 18Intelligent AssistantUsing the Assistant 18-15Using the Assistant 18This section describes how to make an application behavior available thr
CHAPTER 18 Intelligent Assistant18-16 Using the Assistant5. Define the words or phrases this template is to match as an array of strings in its lexicon
CHAPTER 18Intelligent AssistantUsing the Assistant 18-17Based on the definition above, you can derive a my_other_action template that holds the value &
CHAPTER 18 Intelligent Assistant18-18 Using the AssistantSample PostParse Method 18The following code fragment is an example of a PostParse method tha
CHAPTER 18Intelligent AssistantUsing the Assistant 18-19preConditions array is related to the first element of the signature array, the second element
CHAPTER 18 Intelligent Assistant18-20 Using the Assistant2. Define an action template for opening the appropriate help book. The global functions ShowM
CHAPTER 18Intelligent AssistantSummary 18-21Summary 18Data Structures 18Task Frame 18// Returned by ParseUtter function{// original user input phraseo
CHAPTER 18 Intelligent Assistant18-22 Summary// Optional. View template that defines task sliptaskslip : myTaskSlipView,// internal use only - always
CHAPTER 18Intelligent AssistantSummary 18-23System-Supplied Action Templates 18// base your action templates on this generic actiondyna_user_action:=
CHAPTER 1OverviewWhat’s New in Newton 2.0 1-19The NewtApp framework is not suited for all Newton applications. If your application stores data as indi
CHAPTER 18 Intelligent Assistant18-24 Summary// Action template for creating To Do itemsremind_act := {lexicon: ["remember", "remind&qu
CHAPTER 18Intelligent AssistantSummary 18-25// Action template for scheduling lunch in Dates applunch_act := {isa: 'meal_act,usualTime:"12:0
CHAPTER 18 Intelligent Assistant18-26 SummarySystem-Supplied Target Templates 18Places 18// list of system-supplied where_obj target templates// syste
CHAPTER 18Intelligent AssistantSummary 18-27People 18person := { // generic person templateisa: 'who_obj,value: nil // system use only…}title :=
CHAPTER 18 Intelligent Assistant18-28 SummaryDeveloper-Supplied Functions and Methods 18taskFrame:PostParse() // called after input is parsedApplicati
19-1CHAPTER 19Built-in Applications and System Data 19Figure 19-0Table 19-0This chapter describes the interfaces to the built-in applications. It also
CHAPTER 19 Built-in Applications and System Data19-2 NamesIMPORTANTSoup formats are subject to change. Applications that rely on soup formats risk inc
CHAPTER 19Built-in Applications and System DataNames 19-3Figure 19-1 Names application Card and All Info views Names Compatibility 19All the Names met
CHAPTER 19 Built-in Applications and System Data19-4 NamesUsing the Names Application 19This section describes adding a new type of card to the Names
CHAPTER 19Built-in Applications and System DataNames 19-5Here is an example of an infoFrame for a Names viewDef defining a view that has two fields, Mak
CHAPTER 1 Overview1-20 What’s New in Newton 2.0Protos 1There are many new protos supplied in the new system ROM. There are new pop-up button pickers,
CHAPTER 19 Built-in Applications and System Data19-6 NamesThe bizCardIcon slot contains an icon representing the new layout, to be shown in the Card S
CHAPTER 19Built-in Applications and System DataNames 19-7 get information from Names soup entries for credit/phone card information (BcCreditCards) f
CHAPTER 19 Built-in Applications and System Data19-8 DatesThe diamond appears only if there is more than one owner card; otherwise you see just a name
CHAPTER 19Built-in Applications and System DataDates 19-9Figure 19-2 Dates application Day and Day’s Agenda views Meetings and events can repeat. That
CHAPTER 19 Built-in Applications and System Data19-10 Dates In addition to changes in the programmatic interface, the 2.0 version has extensive chang
CHAPTER 19Built-in Applications and System DataDates 19-11Adding Meetings or Events 19You can programmatically add meetings and events by using the Ad
CHAPTER 19 Built-in Applications and System Data19-12 DatesDeleting Meetings and Events 19The Dates application provides three methods for deleting me
CHAPTER 19Built-in Applications and System DataDates 19-13 To delete a single instance of the repeating event created in “Adding Meetings or Events”:
CHAPTER 19 Built-in Applications and System Data19-14 Dates[StringToDate("6/1/95 12:00am"), StringToDate ("6/30/95 11:59pm")], nil
CHAPTER 19Built-in Applications and System DataDates 19-15 To move a meeting half an hour earlier and give it a different (90 minute) duration:GetRoo
CHAPTER 1OverviewWhat’s New in Newton 2.0 1-21clParagraphView now support ink text. There are several new functions that allow you to manipulate and c
CHAPTER 19 Built-in Applications and System Data19-16 Dates Get or set the meeting icon type with GetMeetingIconType and SetMeetingIconType.The remai
CHAPTER 19Built-in Applications and System DataDates 19-17// get the notes of the last meeting. If there are no // meeting notes, GetMeetingNotes retu
CHAPTER 19 Built-in Applications and System Data19-18 Datesand a frame containing the definition of the new meeting type. This frame has the following
CHAPTER 19Built-in Applications and System DataDates 19-19Examples of Creating New Meeting Types 19The following example code registers a new meeting
CHAPTER 19 Built-in Applications and System Data19-20 Dateslocal slip :=BuildContext({_proto: protoFloaterviewFlags:vClickable + vFloating +vApplicati
CHAPTER 19Built-in Applications and System DataDates 19-21 OpenMeetingSlip opens the meeting slip for a specific meeting or event. RegInfoItem adds
CHAPTER 19 Built-in Applications and System Data19-22 To Do ListUsing the Dates Soups 19The Dates application stores meeting and event information an
CHAPTER 19Built-in Applications and System DataTo Do List 19-23Figure 19-3 The To Do List application To Do List Compatibility 19Version 2.0 reads and
CHAPTER 19 Built-in Applications and System Data19-24 To Do ListAlso, note that some of these methods only work when the To Do List is open. You can
CHAPTER 19Built-in Applications and System DataTo Do List 19-25GetToDoItemsForThisDate returns an array of tasks. Tasks are elements of the array stor
viiChapter 4 NewtApp Applications 4-1About the NewtApp Framework 4-1The NewtApp Protos 4-2About newtApplication 4-4About newtSoup 4-5The Layout Protos
CHAPTER 1 Overview1-22 What’s New in Newton 2.0The implementation of undo has changed to an undo/redo model instead of two levels of undo, so applicat
CHAPTER 19 Built-in Applications and System Data19-26 To Do ListbegintheTask := todaysTasksArray[i];theIndex := i;end;//and mark it as doneGetRoot().
CHAPTER 19Built-in Applications and System DataTime Zones 19-27of slots in a soup entry. If you don’t use these functions to get and set entry slots i
CHAPTER 19 Built-in Applications and System Data19-28 Time ZonesUsing the Time Zone Application 19The application program interface provides functions
CHAPTER 19Built-in Applications and System DataTime Zones 19-29though that the list of cities and countries is not necessarily the same on your Newton
CHAPTER 19 Built-in Applications and System Data19-30 NotesareaCode: "503",region:"OR",airport:"PDX"}Using Longitude and
CHAPTER 19Built-in Applications and System DataNotes 19-31Figure 19-6 Notes note and Checklist views About the Notes Application 19Notes is a simple a
CHAPTER 19 Built-in Applications and System Data19-32 NotesUsing the Notes Application 19This section describes the methods that add new notes, and th
CHAPTER 19Built-in Applications and System DataNotes 19-33 points :ArrayToPoints ([11, // a rectangle5, //how many points 0,0, //first point0,25, //
CHAPTER 19 Built-in Applications and System Data19-34 Fax Soup EntriesDetailed information on the data structures that support these stationeries is p
CHAPTER 19Built-in Applications and System DataPrefs and Formulas Rolls 19-35body within the In/Out Box soup entry, where a user can view it. Applicat
CHAPTER 1OverviewWhat’s New in Newton 2.0 1-23The Dates application includes a comprehensive interface that gives you the ability to add, find, move, a
CHAPTER 19 Built-in Applications and System Data19-36 Auxiliary ButtonsPrefs and Formulas Compatibility 19The functions RegPrefs, UnRegPrefs, RegFormu
CHAPTER 19Built-in Applications and System DataAuxiliary Buttons 19-37Figure 19-9 The Notes application with and without an auxiliary button Using Aux
CHAPTER 19 Built-in Applications and System Data19-38 Icons and the Extras DrawerAny application that adds buttons to another application should provi
CHAPTER 19Built-in Applications and System DataIcons and the Extras Drawer 19-39This section also covers creating a cursor that iterates over icons in
CHAPTER 19 Built-in Applications and System Data19-40 Icons and the Extras DrawerUsing Extras Drawer Cursors 19The Extras Drawer method GetPartCursor
CHAPTER 19Built-in Applications and System DataIcons and the Extras Drawer 19-41InstallScript := func (partFrame)beginlocal ed := GetRoot().extrasDra
CHAPTER 19 Built-in Applications and System Data19-42 Icons and the Extras DrawerCreating a Script Icon 19Installation of a script icon is basically t
CHAPTER 19Built-in Applications and System DataIcons and the Extras Drawer 19-43InstallScript := func(partFrame, removeFrame)beginlocal mySlip := GetL
CHAPTER 19 Built-in Applications and System Data19-44 System Data2. Add a frame called soupervisor to your application’s base view. Note that this mea
CHAPTER 19Built-in Applications and System DataSystem Data 19-45Functions for Accessing User Configuration Data 19The global functions GetUserConfig an
CHAPTER 1 Overview1-24 What’s New in Newton 2.0There have been significant changes in the handling of binary (raw) data. For input, you can now target
CHAPTER 19 Built-in Applications and System Data19-46 SummarySummary 19Constants and Variables 19Names Card Layouts 19Dates Variables 19firstDayOfWee
CHAPTER 19Built-in Applications and System DataSummary 19-47Dates Constants for repeatType 19Other Date Constants 19Dates Constants for the Weeks in a
CHAPTER 19 Built-in Applications and System Data19-48 SummarycurrentCountrycurrentEmporiumcurrentPersonacurrentPrinterdialingPrefixdoAutoAdddoInkWordR
CHAPTER 19Built-in Applications and System DataSummary 19-49protoEmporiumPopup 19myEmporiumPopup := {_proto: protoEmporiumPopup, SetUpText: function,/
CHAPTER 19 Built-in Applications and System Data19-50 SummarycardType: integer,name: frame,names: array,company: stringOrRichString,title: stringOrRic
CHAPTER 19Built-in Applications and System DataSummary 19-51phones: array,email: stringOrRichString,emailAddrs: array,emailPassword: string,pagers: ar
CHAPTER 19 Built-in Applications and System Data19-52 Summaryemail: stringOrRichString,emailAddrs: array,notes: array,sorton: string,...}Worksite Entr
CHAPTER 19Built-in Applications and System DataSummary 19-53version: integer,viewBounds: frame,exceptions: array,...}Notes Frames 19aNotesFrame := {no
CHAPTER 19 Built-in Applications and System Data19-54 Summarycardfile:BcCreditCards(inEntry, inWhich) // returns the// credit card informationcardfile
CHAPTER 19Built-in Applications and System DataSummary 19-55calendar:GetMeetingIconType(mtgTextOFrame, mtgStartDate)// returns the type of icon of a m
Choosing an Application Structure 2-1CHAPTER 2Getting Started 2Figure 2-0Table 2-0This chapter describes where to begin when you’re thinking about dev
CHAPTER 19 Built-in Applications and System Data19-56 Summarycalendar:SetMeetingNotes(mtgText, mtgStartDate, notes)// sets notes for specified meeting
CHAPTER 19Built-in Applications and System DataSummary 19-57Time Zone Functions 19GetCityEntry(name) // returns information about the // specified cit
CHAPTER 19 Built-in Applications and System Data19-58 SummaryExtras Drawer Functions and Methods 19extrasDrawer:AddExtraIcon(iconType, paramFrame, pkg
About Localization 20-1CHAPTER 20Localizing Newton Applications 20Figure 20-0Table 20-0This chapter discusses how to support multiple languages and us
CHAPTER 20 Localizing Newton Applications20-2 About LocalizationFigure 20-1 The Locale settings in PreferencesThe most important of these settings is
CHAPTER 20Localizing Newton ApplicationsUsing the Localization Features of the Newton 20-3 Displaying the text. This uses the date, time, and number
CHAPTER 20 Localizing Newton Applications20-4 Using the Localization Features of the NewtonDefining a Localization Frame 20You define the alternative la
CHAPTER 20Localizing Newton ApplicationsUsing the Localization Features of the Newton 20-5 A frames path the compiler uses to find the alternative obj
CHAPTER 20 Localizing Newton Applications20-6 Using the Localization Features of the NewtonMeasuring String Widths at Compile Time 20When the size of
CHAPTER 20Localizing Newton ApplicationsUsing the Localization Features of the Newton 20-7For example:activeLocale:=GetLocale();Once you’ve obtained a
CHAPTER 2 Getting Started2-2 Choosing an Application Structuredon’t follow the “classic” form-based model. For example, some types of applications tha
CHAPTER 20 Localizing Newton Applications20-8 Using the Localization Features of the NewtonIn the preceding code example the myLocaleBundle frame is b
CHAPTER 20Localizing Newton ApplicationsUsing the Localization Features of the Newton 20-9The RemoveLocale function accepts as its argument a symbol s
CHAPTER 20 Localizing Newton Applications20-10 Using the Localization Features of the Newton//save the current locale settingpreviousLocale:=GetLocale
CHAPTER 20Localizing Newton ApplicationsUsing the Localization Features of the Newton 20-11Functions that Use the Locale Setting To Determine Format 2
CHAPTER 20 Localizing Newton Applications20-12 Using the Localization Features of the NewtonTo use one of these values, access the appropriate slot by
CHAPTER 20Localizing Newton ApplicationsUsing the Localization Features of the Newton 20-13// get the current timetheTime:= Time();// pass the time an
CHAPTER 20 Localizing Newton Applications20-14 Summary of Localization FunctionsSummary of Localization Functions 20This section categorizes the date,
CHAPTER 20Localizing Newton ApplicationsSummary of Localization Functions 20-15StringToTime(timeString)TimeStr(time, timeStrSpec)Date Frame Functions
About Routing 21-1CHAPTER 21Routing Interface 21Figure 21-0Table 21-0This chapter describes the Routing interface in Newton system software. The Routi
CHAPTER 2Getting StartedChoosing an Application Structure 2-3automatically manage many routine programming tasks. For example, some of the tasks the p
CHAPTER 21 Routing Interface21-2 About Routinguser can switch between the In Box and the Out Box by tapping radio buttons in the application.When open
CHAPTER 21Routing InterfaceAbout Routing 21-3In Box receives such an item, it is automatically transferred from the In Box to the application, without
CHAPTER 21 Routing Interface21-4 About RoutingIn the user interface of your application, the Action button should be positioned differently, depending
CHAPTER 21Routing InterfaceAbout Routing 21-53. Using the list of formats, the system builds a list of transports that can handle at least one of the
CHAPTER 21 Routing Interface21-6 About Routingwhich transports show up in the Action picker. The system builds a list of all routing formats registere
CHAPTER 21Routing InterfaceAbout Routing 21-7Figure 21-4 Format picker in routing slipThe built-in applications and transports support routing of the
CHAPTER 21 Routing Interface21-8 Using RoutingYou must register all routing formats that you define with the system, usually in your application part I
CHAPTER 21Routing InterfaceUsing Routing 21-9 send items programmatically receive items allow items to be viewed in the In/Out BoxProviding Transpo
CHAPTER 21 Routing Interface21-10 Using RoutingGetting and Verifying the Target Object 21When the user first taps the Action button, but before a choic
CHAPTER 21Routing InterfaceUsing Routing 21-11The VerifyRoutingInfo method is passed two parameters, the target information frame obtained by GetTarge
CHAPTER 2 Getting Started2-4 Package Loading, Activation, and DeactivationOther Kinds of Software 2There are other kinds of software you can develop f
CHAPTER 21 Routing Interface21-12 Using RoutingIf your application does not have a lastFormats slot, or if a matching format is not found (the format
CHAPTER 21Routing InterfaceUsing Routing 21-13Storing an Alias to the Target Object 21When there is a single target object, if there is not enough sto
CHAPTER 21 Routing Interface21-14 Using Routingoverride the routing format methods that handle the alias operations: TargetSize,MakeBodyAlias, and Res
CHAPTER 21Routing InterfaceUsing Routing 21-15If your GetTargetInfo method returns a multiple-item target object by using the functionCreateTargetCurs
CHAPTER 21 Routing Interface21-16 Using RoutingIf you need to read the body slot within the fields frame, note that it might contain an alias. In orde
CHAPTER 21Routing InterfaceUsing Routing 21-17RegisterViewDef. Nor should you use DefConst, or any other method that directly references the routing f
CHAPTER 21 Routing Interface21-18 Using RoutingCreating a Print Format 21You create a print format by using protoPrintFormat. This proto is required f
CHAPTER 21Routing InterfaceUsing Routing 21-19in portrait mode ('portrait) or horizontally in landscape mode ('landscape).The default value
CHAPTER 21 Routing Interface21-20 Using RoutingThen the print format view is closed. Note that the ViewShowScript and ViewDrawScript messages are not
CHAPTER 21Routing InterfaceUsing Routing 21-21The PrintNextPageScript method should construct the view for the next page of data so that the message s
CHAPTER 2Getting StartedPackage Loading, Activation, and Deactivation 2-5when it is moved to another store (it is deactivated then reactivated), or wh
CHAPTER 21 Routing Interface21-22 Using Routing// which takes targetInfoFrame.target and makes an // alias, if appropriateend,TextScript: func(item,ta
CHAPTER 21Routing InterfaceUsing Routing 21-23Your application can provide internal application-defined actions, such as deleting and duplicating, that
CHAPTER 21 Routing Interface21-24 Using RoutingPerforming the Routing Action 21The important slot in each frame in the routeScripts array is the Route
CHAPTER 21Routing InterfaceUsing Routing 21-25cursors, refer to Chapter 11, “Data Storage and Retrieval.” Note that only these three cursor methods ar
CHAPTER 21 Routing Interface21-26 Using RoutingSending Items Programmatically 21Your application can send an item programmatically, using a specific tr
CHAPTER 21Routing InterfaceUsing Routing 21-27The following frame shows a summary of the slots you can include in the item frame. Note that some of th
CHAPTER 21 Routing Interface21-28 Using Routingentry and even some of the slots from the soup entry. Note that you must use name references; you canno
CHAPTER 21Routing InterfaceUsing Routing 21-29data. That variable holds the printer selected by the user as the current printer. You can use this func
CHAPTER 21 Routing Interface21-30 Using Routing// get an entry from the Names soup to use for the recipientcurs:=GetUnionSoupAlways(ROM_CardfileSoupNa
CHAPTER 21Routing InterfaceUsing Routing 21-31Receiving Data 21Incoming data arrives first as an entry in the In Box. If there is a public view definiti
CHAPTER 2 Getting Started2-6 Package Loading, Activation, and DeactivationIMPORTANTAny changes that you make to the system in the InstallScript functi
CHAPTER 21 Routing Interface21-32 Using RoutingData” (page 21-34). If a matching application is found in the registry, the appSymbol slot of the item
CHAPTER 21Routing InterfaceUsing Routing 21-33Manually Putting Away Items 21If an item is not put away automatically, it resides in the In Box until t
CHAPTER 21 Routing Interface21-34 Using RoutingRegistering to Receive Foreign Data 21To receive data from a different application or from a non-Newton
CHAPTER 21Routing InterfaceUsing Routing 21-35not provide a view definition, and there are no other view definitions available for that data class, the
CHAPTER 21 Routing Interface21-36 Using Routingaccess addressing or other information in the entry besides the actual data being routed, look at the f
CHAPTER 21Routing InterfaceSummary of the Routing Interface 21-37Summary of the Routing Interface 21Constants 21ROM_RouteDeleteIcon // bitmap for dele
CHAPTER 21 Routing Interface21-38 Summary of the Routing InterfaceRouteScripts Array Element 21RouteScriptsArrayElement := {title: string, // string n
CHAPTER 21Routing InterfaceSummary of the Routing Interface 21-39TextScript: function, // gets text dataTargetSize: function, // determines target si
CHAPTER 21 Routing Interface21-40 Summary of the Routing InterfaceGetItemTransport(item)view:GetRouteScripts(targetInfoFrame)RegAppClasses(appSymbol,
About Transports 22-1CHAPTER 22Transport Interface 22Figure 22-0Table 22-0This chapter describes the Transport interface in Newton system software. Th
CHAPTER 2Getting StartedEffects of System Resets on Application Data 2-7Effects of System Resets on Application Data 2Two kinds of reset operations—ha
CHAPTER 22 Transport Interface22-2 About Transportstransports that might be installed in the system at any time. An application need not know anything
CHAPTER 22Transport InterfaceAbout Transports 22-3destAppSymbol Optional. A symbol identifying the application to receive the item, if it is different
CHAPTER 22 Transport Interface22-4 About TransportscompletionScriptA Boolean; if true, the transport sends the ItemCompletionScript message to the app
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-5Using the Transport Interface 22This section describes how to use the Transport interfa
CHAPTER 22 Transport Interface22-6 Using the Transport InterfaceHere is an example of installing a transport in the part InstallScript function:Instal
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-7The default setting of the addressingClass slot is the symbol '|nameRef.email|For
CHAPTER 22 Transport Interface22-8 Using the Transport Interfacethe routing slip is not closed. If TransportChanged returns nil, then the transport is
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-9After sending an item (successfully or unsuccessfully), you must call ItemCompleted to
CHAPTER 22 Transport Interface22-10 Using the Transport InterfaceSome transports may ignore the ReceiveRequest message, since they receive data contin
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-11After downloading all the remote data, you must refresh the In Box view, so the items
viiiCreating a DataDef 5-8Defining DataDef Methods 5-9Creating ViewDefs 5-11Registering Stationery for an Auto Part 5-13Using the MinimalBounds ViewDef
CHAPTER 2 Getting Started2-8 Flow of ControlWhen the operating system cannot obtain enough memory to complete a requested operation, it may display a
CHAPTER 22 Transport Interface22-12 Using the Transport InterfaceHandling Requests When the Transport Is Active 22While the transport is actively send
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-13// SendRequest methodfunc (newRequest)beginif status <> 'idle then // check
CHAPTER 22 Transport Interface22-14 Using the Transport Interfacefor the item. This allows the transport an opportunity to add its own slots to the it
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-15e-mail address to the sender’s internet address. Here’s an example of code that sets t
CHAPTER 22 Transport Interface22-16 Using the Transport Interfaceif dataDef then beginitem.fromRef := dataDef:MakeNameRef(persona, addressingClass);//
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-17Storing Transport Preferences and Configuration Information 22Transports can store user
CHAPTER 22 Transport Interface22-18 Using the Transport Interfaceto the Action picker in an application. Here is an example of a return value that add
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-19Application Messages 22Applications can send messages directly to a single transport o
CHAPTER 22 Transport Interface22-20 Using the Transport InterfaceError Handling 22The default exception handling method implemented by protoTransport
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-21Providing a Status Template 22A status template for a transport is based on the proto
CHAPTER 2Getting StartedLocalization 2-9IMPORTANTIf you don't remove references to unused soups, entries, cursors, and other objects, the objects
CHAPTER 22 Transport Interface22-22 Using the Transport InterfaceFigure 22-1 Status view subtypesEach child view included in a subtype has one importa
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-23Using this set of predefined status templates gives all transports a similar user inter
CHAPTER 22 Transport Interface22-24 Using the Transport Interface// vStatus subtype:SetStatusDialog('Connecting, 'vStatus, "Looking for
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-25The vBarber subtype shows a barber pole-like image, but it doesn’t animate automatical
CHAPTER 22 Transport Interface22-26 Using the Transport InterfaceFigure 22-2 Routing information viewIn your transport object, store a reference to yo
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-27Store a reference to your routing slip template in the routingSlip slot in your transp
CHAPTER 22 Transport Interface22-28 Using the Transport Interfacethe item is updated. The format picker also sends the SetupItem message to the format
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-29The name of the current transport appears in the upper-right corner of the protoFullRo
CHAPTER 22 Transport Interface22-30 Using the Transport InterfacePositioning Elements in the Lower Portion of the Routing Slip 22The height of the low
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-31information at that time. For example, if a user queued several fax items from home bu
CHAPTER 2 Getting Started2-10 Developer Signature GuidelinesExamples of valid signatures includeNEWTONDTSJoe’s Cool Apps1NEWTON2DTSWhat the #$*? SWHow
CHAPTER 22 Transport Interface22-32 Using the Transport InterfaceFigure 22-6 Address picker with remembered namesThe Intelligent Assistant also intera
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-33Most transports can use the built-in name reference data and view definitions to handle
CHAPTER 22 Transport Interface22-34 Using the Transport Interface default folders for new and read or sent items show/hide status and progress dialo
CHAPTER 22Transport InterfaceUsing the Transport Interface 22-35For example, the built-in Print transport uses the protoTransportPrefs proto for its p
CHAPTER 22 Transport Interface22-36 Summary of the Transport InterfaceSummary of the Transport Interface 22Constants 22ROM_RouteMailIcon // bitmap for
CHAPTER 22Transport InterfaceSummary of the Transport Interface 22-37AppInFront: function, // notifies transport of change in app frontmost statusAppO
CHAPTER 22 Transport Interface22-38 Summary of the Transport InterfaceTranslateError: function, // returns a string translationVerifyRoutingInfo: func
CHAPTER 22Transport InterfaceSummary of the Transport Interface 22-39protoAddressPicker 22anAddressPicker := {_proto: protoAddressPicker, // address p
About the Endpoint Interface 23-1CHAPTER 23Endpoint Interface 23Figure 23-0Table 23-0This chapter describes the basic Endpoint interface in Newton sys
CHAPTER 2Getting StartedDeveloper Signature Guidelines 2-11Examples of valid application names includeLlamaGood Form2 Fun 4 UChessNoteIt’s recommended
CHAPTER 23 Endpoint Interface23-2 About the Endpoint InterfaceThe endpoint object created from this proto encapsulates and maintains the details of th
CHAPTER 23Endpoint InterfaceAbout the Endpoint Interface 23-3This kind of asynchronous operation lends itself nicely to creating state-machine based c
CHAPTER 23 Endpoint Interface23-4 About the Endpoint InterfaceIf the input operation terminates normally—that is, the InputScript method is called—the
CHAPTER 23Endpoint InterfaceAbout the Endpoint Interface 23-5The different types of data forms and the defaults are described in more detail in “Data
CHAPTER 23 Endpoint Interface23-6 About the Endpoint Interfaceplaceholder or default values, which the system fills in when the data is received. For m
CHAPTER 23Endpoint InterfaceAbout the Endpoint Interface 23-7Endpoint Options 23You configure the communication tool underlying an endpoint object by s
CHAPTER 23 Endpoint Interface23-8 Using the Endpoint Interface Multiple communication sessions. The system now supports multiple simultaneous communi
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-9All option data you set gets packed together into one block of data. Each option within t
CHAPTER 23 Endpoint Interface23-10 Using the Endpoint Interface'long,'long]}};When you set endpoint options, the cloned option frame is retu
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-11When you are finished with an endpoint, you must unbind it using the UnBindmethod, then d
CHAPTER 2 Getting Started2-12 SummarySummary 2View Classes and Protos 2clView 2aView := {viewClass: clView, // base view classviewBounds: boundsFrame,
CHAPTER 23 Endpoint Interface23-12 Using the Endpoint InterfaceReceiving Data Using Input Specs 23The most common way to receive data is to use input
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-13The following sections describe how to set the various slots in the input spec to accomp
CHAPTER 23 Endpoint Interface23-14 Using the Endpoint InterfaceIf you specify the form 'template or 'binary, you also must specify a targets
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-15termination sequence, or an array of items, any one of which will cause the input to ter
CHAPTER 23 Endpoint Interface23-16 Using the Endpoint InterfaceSpecifying Flags for Receiving 23For certain communication tools, it may be necessary t
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-17slot in the input spec. The filter slot is a frame containing two slots, byteProxyandsev
CHAPTER 23 Endpoint Interface23-18 Using the Endpoint InterfaceHandling Normal Termination of Input 23The InputScript message is sent to the input spe
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-19Handling Unexpected Completion 23The CompletionScript message is sent to the input spec
CHAPTER 23 Endpoint Interface23-20 Using the Endpoint InterfaceIMPORTANTDo not call the Input or Partial methods in a polling loop to look for incomin
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-21within the binary object at which to stream data. For more information on receiving bina
About Views 3-1CHAPTER 3Views 3Figure 3-0Table 3-0This chapter provides the basic information you need to know about views and how to use them in your
CHAPTER 23 Endpoint Interface23-22 Using the Endpoint InterfaceThe cancellation itself can be invoked asynchronously or synchronously, and is handled
CHAPTER 23Endpoint InterfaceUsing the Endpoint Interface 23-23Next, the Cancel (or Disconnect) method returns, and any pending synchronous request is
CHAPTER 23 Endpoint Interface23-24 Using the Endpoint Interfacean option succeeds without errors, the result slot is set to nil. For more general info
CHAPTER 23Endpoint InterfaceSummary of the Endpoint Interface 23-25Summary of the Endpoint Interface 23Constants and Symbols 23Data Form Symbols 23&ap
CHAPTER 23 Endpoint Interface23-26 Summary of the Endpoint InterfaceEndpoint State Constants 23Other Endpoint Constants 23Data Structures 23Option Fra
CHAPTER 23Endpoint InterfaceSummary of the Endpoint Interface 23-27Callback Spec Frame 23myCallbackSpec := {async: Boolean, // asynch request?reqTimeo
CHAPTER 23 Endpoint Interface23-28 Summary of the Endpoint Interfacefilter: { // used to filter incoming databyteProxy: [{ // an array of framesbyte:
CHAPTER 23Endpoint InterfaceSummary of the Endpoint Interface 23-29Input: // returns data from input buffer and clears itfunc() ...,Partial: // return
CHAPTER 23 Endpoint Interface23-30 Summary of the Endpoint InterfaceFunctions and Methods 23Utility Functions 23MakeAppleTalkOption(NBPaddressString)M
Serial Tool 24-1CHAPTER 24Built-in Communications Tools24Figure 24-0Table 24-0This chapter describes the built-in communications tools provided in New
CHAPTER 3 Views3-2 About ViewsThis section provides detailed conceptual information on views and other items related to views. Specifically, it covers
CHAPTER 24 Built-in Communications Tools24-2 Serial ToolThe following is an example of how to create an endpoint that uses the standard asynchronous s
CHAPTER 24Built-in Communications ToolsSerial Tool 24-3You can get or set most of the standard serial options in the endpoint method that established
CHAPTER 24 Built-in Communications Tools24-4 Serial ToolSerial Tool with MNP Compression 24The asynchronous serial communications tool with MNP compre
CHAPTER 24Built-in Communications ToolsSerial Tool 24-5An endpoint can include kPacket, kEOP, and kMore flags to control the sending and receiving of f
CHAPTER 24 Built-in Communications Tools24-6 Modem Toolboth that character and an additional DLE character are sent; conversely, two consecutive DLE c
CHAPTER 24Built-in Communications ToolsModem Tool 24-7Table 24-4 Summary of modem options Label Value Use When DescriptionkCMOModemPrefs"mpre&quo
CHAPTER 24 Built-in Communications Tools24-8 Infrared ToolInfrared Tool 24You use the infrared (IR) communications tool to perform half-duplex infrare
CHAPTER 24Built-in Communications ToolsAppleTalk Tool 24-9The infrared tool uses the Sharp Infrared protocol. Because of the characteristics of this p
CHAPTER 24 Built-in Communications Tools24-10 Resource Arbitration Options }} ];results := myATalkEP:Instantiate(myATalkEP, myOptions);The AppleTalk t
CHAPTER 24Built-in Communications ToolsResource Arbitration Options 24-11claiming its resources passively and will allow another tool to claim it. If
CHAPTER 3ViewsAbout Views 3-3Figure 3-1 shows a collection of template frames that might make up an application. The frame at the top represents the h
CHAPTER 24 Built-in Communications Tools24-12 AppleTalk FunctionsThe following example shows how to instruct a communications tool to allow its resour
CHAPTER 24Built-in Communications ToolsAppleTalk Functions 24-13The Net Chooser 24The Newton system provides a NetChooser as part of the root view. Th
CHAPTER 24 Built-in Communications Tools24-14 AppleTalk FunctionsFigure 24-2 NetChooser view while searchingWhen the search has been completed, the Ne
CHAPTER 24Built-in Communications ToolsAppleTalk Functions 24-15The following is an example that shows the use of this function: ChooserSample := {//
CHAPTER 24 Built-in Communications Tools24-16 SummarySummary 24Built-in Communications Tool Service Option Labels 24kCMSAsyncSerial "aser"kC
CHAPTER 24Built-in Communications ToolsSummary 24-17Framed Serial Tool Options 24kCMOFramingParms "fram"kCMOFramedAsyncStats "frst"
CHAPTER 24 Built-in Communications Tools24-18 SummaryConstants 24Serial Chip Location Option Constants 24kHWLocExternalSerial "extr"kHWLocBu
CHAPTER 24Built-in Communications ToolsSummary 24-19Serial Circuit Control Option Constants 24kSerOutDTR 0x01kSerOutRTS 0x02kSerInDSR 0x02kSerInDCD 0x
CHAPTER 24 Built-in Communications Tools24-20 SummarySerial Event Configuration Option Constants 24kSerialEventBreakStartedMask 0x00000001kSerialEventB
CHAPTER 24Built-in Communications ToolsSummary 24-21kV17_12Mod 0x00000200kV17st_12Mod 0x00000400kV17_14Mod 0x00000800kV17st_14Mod 0x00001000MNP Compre
CHAPTER 3 Views3-4 About ViewsViews 3A template is a data description of an object. A view is the visual representation of the object that is created
CHAPTER 24 Built-in Communications Tools24-22 SummaryNetChooser Function 24NetChooser:OpenNetChooser(zone, lookupName, startSelection,who, connText, h
About the Modem Setup Service 25-1CHAPTER 25Modem Setup Service 25Figure 25-0Table 25-0This chapter contains information about the modem setup capabil
CHAPTER 25 Modem Setup Service25-2 About the Modem Setup ServiceModem setup packages can be supplied by modem manufacturers, or can be created by othe
CHAPTER 25Modem Setup ServiceAbout the Modem Setup Service 25-3Figure 25-1 Modem preferences viewThe Modem Setup Process 25All communication applicati
CHAPTER 25 Modem Setup Service25-4 About the Modem Setup Service4. The modem endpoint is reconfigured with pass-through mode disabled, and control is r
CHAPTER 25Modem Setup ServiceDefining a Modem Setup 25-5NoteThe modem tool has been upgraded to support the Class 2 and Class 2.0 FAX protocols in rele
CHAPTER 25 Modem Setup Service25-6 Defining a Modem Setupabout the modem preferences option, see “Modem Preferences Option” (page 21-34) in Newton Prog
CHAPTER 25Modem Setup ServiceDefining a Modem Setup 25-7Setting the Fax Profile Option 25The fax profile option describes the fax characteristics to be u
CHAPTER 25 Modem Setup Service25-8 Defining a Modem SetupNoteYou can only set the service class (use the kServiceClassconstant) for versions of the sof
CHAPTER 25Modem Setup ServiceSummary of the Modem Setup Service 25-9Summary of the Modem Setup Service 25Constants 25Constants for Modem Setup General
CHAPTER 3ViewsAbout Views 3-5application base view. (Think of the view hierarchy as a tree structure in which the tree is turned upside down with its
CHAPTER 25 Modem Setup Service25-10 Summary of the Modem Setup ServiceFax Speed Constants 25kV21Ch2Modkv27Ter24ModkV27Ter48ModkV29_72ModkV17_72ModkV17
26-1CHAPTER 26Utility Functions 26Figure 26-0Table 26-0This chapter provides a listing of a number of utility functions documented in the “Utility Fun
CHAPTER 26 Utility Functions26-2 CompatibilityCompatibility 26This section describes the changes to the utility functions for Newton System Software 2
CHAPTER 26Utility FunctionsCompatibility 26-3New String Functions 26The following new string functions have been added.CharPos
CHAPTER 26 Utility Functions26-4 CompatibilityNew Integer Math Functions 26The following new functions related to integer math have been added.GetRand
CHAPTER 26Utility FunctionsCompatibility 26-5New Data Stuffing Functions 26The following new data stuffing functions have been added.StuffCStringStuffPS
CHAPTER 26 Utility Functions26-6 CompatibilityGetMemorySlotMakePhoneMakeDisplayPhoneParsePhonePowerOffTranslateEnhanced Functions 26The following stri
CHAPTER 26Utility FunctionsSummary of Functions and Methods 26-7Summary of Functions and Methods 26Object System Functions 26ClassOf(object)Clone(obje
CHAPTER 26 Utility Functions26-8 Summary of Functions and MethodsString Functions 26BeginsWith( string, substr )Capitalize( string )CapitalizeWords( s
CHAPTER 26Utility FunctionsSummary of Functions and Methods 26-9Bitwise Functions 26Band(a, b)Bor(a, b)Bxor(a, b)Bnot(a)Array Functions 26AddArraySlot
ixSpecifying the List of Items for a Popup 6-37Summary 6-41General Picker Protos 6-41Map Pickers 6-45Text Picker Protos 6-46Date, Time, and Location P
CHAPTER 3 Views3-6 About ViewsFigure 3-3 shows an example of what this view hierarchy might represent on the screen.Figure 3-3 Screen representation o
CHAPTER 26 Utility Functions26-10 Summary of Functions and MethodsBMerge(array1, array2, test, key, uniqueOnly)BSearchLeft(array, item, test, key)BSea
CHAPTER 26Utility FunctionsSummary of Functions and Methods 26-11IsFinite(x)IsNaN(x)IsNormal(x)LessEqualOrGreater(x, y)LessOrGreater(x, y)LGamma(x)Log
CHAPTER 26 Utility Functions26-12 Summary of Functions and MethodsFeTestExcept(excepts)FeUpdateEnv(envObj)Financial Functions 26Annuity(r, n)Compound(
CHAPTER 26Utility FunctionsSummary of Functions and Methods 26-13Data Extraction Functions 26ExtractByte(data, offset)ExtractBytes(data, offset, lengt
CHAPTER 26 Utility Functions26-14 Summary of Functions and MethodsStats()StrHexDump(object, spaceInterval)TrueSize(object, filter)ViewAutopsy(function
Compile-Time Results A-1APPENDIXThe Inside Story on Declare AThis appendix describes the technical details of the declare mechanism. Knowing these tec
APPENDIXA-2 Run-Time ResultsNoteProtos built into the system use an analogous slot called allocateContext, that holds the same thing as stepAllocateCo
APPENDIXRun-Time Results A-3Figure A-1 Declare example CalculatorDisplayDisplay{preallocatedContext: 'Display..}CalculatorAs a result of the decl
GL-1GlossaryAction button The small envelope button used in applications to invoke routing functions. When tapped, it displays a picker listing routin
CHAPTER 3ViewsAbout Views 3-7Figure 3-4 View system coordinate planeFigure 3-5 Points and pixels–6654321–1–2–3–4–5–6654321–5–4–3–2–1hvGrid linesPointP
GLOSSARYGL-2cursor An object returned by the Querymethod. The cursor contains methods that iterate over a set of soup entries meeting the criteria spe
GLOSSARYGL-3flag A value that is set either on or off to enable a feature. Typically, flag values are single bits, though they can be groups of bits or
GLOSSARYGL-4item frame The frame that encapsulates a routed (sent or received) object and that is stored in the In/Out Box soup.lexical dictionary A l
GLOSSARYGL-5part A unit of software—either code or data—held in a part frame. The format of the part is identified by a four-character identifier called
GLOSSARYGL-6template slot. For example, a field for entering phone numbers might restrict acceptable user input to numerals. rich string A string objec
GLOSSARYGL-7target The object being acted upon. Sometimes the target consists of multiple items, for example, when multiple items are selected from an
IN-1IndexAaccessing query results 11-16accessing tasks in the To Do List application 19-24Action button 21-3accessing routing actions from 21-3adding
INDEXIN-2application componentsoverview 1-15application data class registry 21-33application-defined routing actions 21-23application extensions 5-1app
INDEXIN-3Ccalendarversus the term Dates 19-9Calendar Notes soup 19-22Calendar soup 19-22callback functions 15-3registering 15-11registering for folder
CHAPTER 3 Views3-8 About ViewsAs the grid lines are infinitely thin, so a point is infinitely small. Pixels, by contrast, lie between the lines of the c
INDEXIN-4completionCompletionScript 23-18handling unexpected in endpoints 23-18compressed imagesstoring 13-18configuration string usage 25-7confirm 18-4
INDEXIN-5dateKeyboard 8-27Datescompatibility information 19-9versus the term calendar 19-9Dates application 19-8adding meetings or events 19-11control
INDEXIN-6endpoint (continued)input form 23-13input spec 23-12input target 23-13input time-out 23-16instantiating 23-10linking to application 23-24prot
INDEXIN-7filter options 23-16use of byteProxy slot with 23-16use of filter slot with 23-16Findglobal 16-3local 16-3overview 1-10Find, targeted 16-19Find
INDEXIN-8fonts (continued)specifying for a view 3-24style numbers 8-18font spec 8-3, GL-3font specification 8-17packed integer format 8-19font styles 8
INDEXIN-9functions and methods (continued)ItemCompleted 22-16KillAction 17-16LastVisibleTopic, To Do List method 19-26LaunchPartEntry, Extras Drawer m
INDEXIN-10GetCityEntry 19-28GetCountryEntry 19-28GetDefaultFormat 21-11GetDefs 5-8GetExtraIcons, Extras Drawer method 19-41GetMeetingIconType, Dates m
INDEXIN-11In/Out Box 1-13, GL-3extending the user interface 22-17inputtermination of in endpoints 23-17use of InputScript message for 23-17input buffe
INDEXIN-12keysalarm 17-12KillAction 17-16LlabelsChanged parameter 15-16labels filter 15-8labelsFilter slot 15-8, 15-10creating 15-14labels slot 15-1, 1
INDEXIN-13modem setup (continued)process 25-3profile constants 25-9profile option 25-6, 25-7user interface 25-2modem setup package 25-1modem setup servi
CHAPTER 3ViewsAbout Views 3-9Opening and closing animation effectsTheviewEffect slot defines an animation to be performed when the view is displayed or
INDEXIN-14Notes application (continued)list of methods 19-57soup 19-33soup format 19-53versus term paperroll 19-31Notes stationery 19-30, 19-33notifica
INDEXIN-15periodic alarms 17-4, 17-14persistent storage 1-3persona GL-5persona popup proto 19-7phone, user configuration variable 19-48phoneKeyboard 8-
INDEXIN-16protoFolderTab proto 15-9protoFrameFormat 21-21protoFullRouteSlip 22-27protoInputLine 8-12, 8-13, 8-14protoKeyboard 8-28protoKeyboardButton
INDEXIN-17receiving large objects 23-20recognition flagsvAddressField 9-31vAnythingAllowed 9-32vCapsRequired 9-31vClickable 9-32vCustomDictionaries 9-3
INDEXIN-18RouteScript 21-24example of 21-25routeScripts slot 21-22, 21-23, 21-24defining a method identified by 21-24routingabout 21-1application-specifi
INDEXIN-19scrollingcontrolling in In/Out Box view def 21-36speeding up 3-46scrollRect 7-3scrollUpSound 14-2search method 16-7search methods 16-6, 16-1
INDEXIN-20sound (continued)synchronous 14-7waiting for completion 14-7sound channelcharacteristics of 14-2creating for playback 14-6deleting 14-6using
INDEXIN-21synonyms 18-3system data 19-44list of functions 19-58system messagesin automatic views 8-8system resets 2-7system services 16-1, 17-1alarms
INDEXIN-22Time Zones application 19-27adding a city 19-29compatibility information 19-27getting a refernce to 19-28list of functions and methods 19-57
INDEXIN-23UnRegFolderChanged function 15-3, 15-10, 15-18UnRegFormulas 19-36UnRegInboxApp 21-34UnRegInfoItem, Dates method 19-21unregistering the task
CHAPTER 3 Views3-10 About ViewsHandling Pen Input 3The use of the vClickable viewFlags constant to control pen input is important to understand, so it
INDEXIN-24view (continued)creating 3-28custom fill pattern 3-21custom frame pattern 3-21declareSelf slot 3-24declaring 3-27defining characteristics of 3
INDEXIN-25viewFlags (continued)vApplication 3-47vCalculateBounds 3-47vCapsRequired 9-31vClickable 3-47, 9-32vClipping 3-47vCustomDictionaries 9-31vDat
THE APPLE PUBLISHING SYSTEMThis Apple manual was written, edited, and composed on a desktop publishing system using Apple Macintosh computers and Fram
CHAPTER 3ViewsAbout Views 3-11leftValue The distance from the left origin of the parent view to the left edge of the view.topValue The distance from t
CHAPTER 3 Views3-12 About ViewsView Size Relative to Parent Size 3A view is normally entirely enclosed by its parent view. You shouldn’t create a view
CHAPTER 3ViewsAbout Views 3-13viewSetupFormScript: func()beginlocal b := GetAppParams();self.viewbounds := RelBounds(b.appAreaLeft,b.appAreaTop,min(20
CHAPTER 3 Views3-14 About Views horizontal alignment of the view relative to its parent or sibling view vertical alignment of the view relative to i
CHAPTER 3ViewsAbout Views 3-15vjParentCenterH16 The difference between the left and right view bounds is used as the width of the view. If you specify
Commentaires sur ces manuels