beautypg.com

Implementing find overview support 16 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 609

background image

C H A P T E R 1 6

Find

Using the Find Service

16-21

Note

Applications implementing these methods must also implement
the usual

Find

and

DateFind

methods since a find operation

may be dispatched as other than a Selected find.

Returning Search Results

16

After constructing the finder frame, your search method needs to append it to the
system-supplied

results

array. Each element in this array is a finder frame. In

the case of a finder based on the

ROM_SoupFinder

, the array the frame has a

cursor for obtaining the items found in the search. In the case of a finder based on
the

ROM_CompatibleFinder

proto, your finder frame contains an array of the

found items themselves. You need to use the global function

AddArraySlot

to

append your finder frame to the

results

array.

The following example shows a line of code that would be placed at the end of
your application’s search method to store the results of the search. In this code
fragment, the

results

parameter is the system-supplied array passed to the

Find

method, and the

myFinder

parameter is the finder frame resulting from the

search. The following call to

AddArraySlot

places the finder frame,

myFinder

,

at the end of the

results

array:

AddArraySlot(results, myFinder);

Note that the system’s

results

array is cleared when the Find slip closes.

Implementing Find Overview Support

16

The messages described in this section are sent to your application when the user
taps buttons in the Find overview. These include:

the

FindSoupExcerpt

message

the

ShowFoundItem

message

If your finder frame is based on

ROM_CompatibleFinder

, you do not need to

write a

FindSoupExcerpt

method, but you must also write a

ShowFakeEntry

method to call your

ShowFoundItem

method.

The FindSoupExcerpt Method

16

If you use the

ROM_SoupFinder

proto to construct a finder frame, your

application must supply a

FindSoupExcerpt

method. This methods must extract

the name of a found item when it is given the soup entry and the finder frame, and
return it to the system as a string to display in the Find overview.