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

  • 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 581
CHAPTER 15
Filing
15-16 Using the Filing Service
The arguments to the FileThis method supply all the information necessary to le
a soup entry, including the item to le (the target), the category under which to le
it (the value to which you set the target’s
labels slot), and the store on which to
le it.
If the value of the
labelsChanged parameter to the FileThis method is true,
your
FileThis method must use the value of the newLabels parameter to
update the value of the target’s
labels slot. However, if the value of the
labelsChanged parameter is nil, the value of the newLabels parameter is
undened—don’t use it!
Similarly, if the value of the
storesChanged parameter is true, your
FileThis method must move the target to the new store. However, if the value of
the
storesChanged parameter is nil, the value of the destStore parameter
is undened.
The following code example shows the implementation of a typical
FileThis
method. Remember to call
EntryChangeXmit from this method so your changes
to led entries are saved!
FileThis: // example code - your mileage may vary
func(target, labelsChanged, newLabels, storesChanged, destStore)
begin
if labelsChanged AND target.labels <> newLabels then
begin
target.labels := newLabels;
EntryChangeXmit(target, kAppSymbol);
end // labelsChanged
if storesChanged and (EntryStore(target) <> destStore) and
not destStore:IsReadOnly() then
begin
// move the entry to the new store & xmit change
// make sure you handle locked stores too
if EntryStore(target):IsReadOnly() then
EntryCopyXmit(target, destStore, kAppSymbol);
else
EntryMoveXmit(target, destStore, kAppSymbol);
end; //storesChanged
end; // FileThis
Implementing the NewFilingFilter Method 15
When the user changes the current ling lter in the folder tab view, the system
calls your application’s
NewFilingFilter method. You need to dene this
method in your application’s base view. Your
NewFilingFilter method must
update the query that retrieves items matching the current ling category and
Zobrazit stránku 581
1 2 ... 577 578 579 580 581 582 583 584 585 586 587 ... 941 942

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

Žádné komentáře