Apple Newton Utilities Uživatelská příručka Strana 611

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 942
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 610
CHAPTER 16
Find
Using the Find Service 16-23
In the body of this method, you need to do whatever is necessary to display the
soup entry
myEntry. Typically, you rst send a Close message to the Overview
and then open the view that displays the entry. The following code fragment shows
the implementation of a typical
ShowFoundItem method.
// For use with ROM_SoupFinder proto
myApplication.ShowFoundItem:=
func(entry, myFinder)
begin // close my overview if it’s open
if currentView = myOverview then begin
myOverView:Close();
myDisplayView:Open();
// open view that displays the entry
end;
// scroll, highlight, etc. as necessary
// to display the entry
myDisplayView:DisplayEntry(entry, cursor);
end
Your application is always open when the ShowFoundItem message is sent to it.
For example, this message is sent when the user scrolls between found items from
within the Find slip. The system also invokes this method when the user taps an
item in the Find overview. In this case, the system opens your application, if
necessary, before sending the
ShowFoundItem message to it.
Note that if no items are found this message is never sent.
Using ShowFoundItem with ROM_CompatibleFinder 16
If you are using a nder based on ROM_CompatibleFinder, you still need to
implement a
ShowFoundItem in your application’s base view. Your nder also
needs to override the
ShowFakeEntry method. Your ShowFakeEntry method
needs to call your
ShowFoundItem method, making sure that your application is
open rst. Your
ShowFoundItem method should accept an element of the nder’s
items array as its first parameter, instead of a soup entry. It should perform the
same actions as a
ShowFoundItem method that expects a soup entry, as described
in “The ShowFoundItem Method” (page 16-22).
The following example demonstrates a typical
ShowFakeEntry method:
myFinder :=
{
_proto : ROM_CompatibleFinder,
ShowFakeEntry : func (index)
begin
local myApp;
if myApp := GetRoot.(kAppSymbol) then
Zobrazit stránku 610
1 2 ... 606 607 608 609 610 611 612 613 614 615 616 ... 941 942

Komentáře k této Příručce

Žádné komentáře