Apple Newton Utilities Guide de l'utilisateur Page 583

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 582
CHAPTER 15
Filing
Using the Filing Service 15-17
perform any other actions that are appropriate, such as redrawing views affected by
the change in ling lter.
The symbol passed as the sole argument to your
NewFilingFilter method
species which of the
storesFilter or labelsFilter slots changed in value.
This argument does not specify the slot’s new value, however. Your
NewFilingFilter method must use the current value of the specified slot to
retrieve those soup entries that fall into the new ling category.
The following code example shows the implementation of a typical
NewFilingFilter method, which queries the application soup for the entries
that match the current ling category and then redraws views affected by the
change in ling category.
NewFilingFilter: func(newFilterPath)
begin
// first figure out if query should be done on
// a union soup or on a specific store soup
// this is to make filter by store more efficient
local querySoup := GetUnionSoupAlways(kSoupName) ;
if storesFilter and storesFilter:IsValid() then
querySoup := querySoup:GetMember(storesFilter) ;
// now construct the query based on the labelsFilter
// and set my application cursor (called myCursor)
// to the new query
// the default is to show all items, i.e.,
// labelsFilter is '_all
local theQuery := nil ;
if NOT labelsFilter then
// labelsFilter is NIL, so show only those entries
// that do not have a valid tag in the labels
// slot
theQuery := {none: GetFolderList(appSymbol, nil)};
else if labelsFilter <> '_all then
// labelsFilter is some specific folder
theQuery := {all: labelsFilter} ;
myCursor := querySoup:Query(theQuery) ;
Vue de la page 582
1 2 ... 578 579 580 581 582 583 584 585 586 587 588 ... 941 942

Commentaires sur ces manuels

Pas de commentaire