Apple Newton Utilities Guide de l'utilisateur Page 188

  • 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 187
CHAPTER 5
Stationery
5-6 Using Stationery
The dataDef component of your stationery should use a FillNewEntry method
to dene its own discrete soup entry structure. Note that it is your responsibility to
set a
class slot within each entry. The value of the class slot must match the
dataDef symbol and is used by the system when routing the entry (via faxing,
mailing, beaming, printing, and so on). An example of how to use
FillNewEntry
follows.
Using FillNewEntry 5
You use the FillNewEntry method in your dataDef to create an entry structure
that is tailored to your data. This approach is recommended when your stationery is
implemented as part of a NewtApp application.
The
FillNewEntry method works in conjunction with the NewtApp
framework’s
newtSoup.CreateBlankEntry method. The FillNewEntry
method takes a new entry, as returned by the
CreateBlankEntry method, as a
parameter. This is done with a
CreateBlankEntry implementation put in the
newtApplication.allSoups slot of your NewtApp application, as shown in
the following example:
CreateBlankEntry: func()
begin
local newEntry := Clone({class:nil,
viewStationery: nil,
title: nil,
timeStamp: nil,
height: 176});
newEntry.title := ShortDate(time());
newEntry.timeStamp := time();
newEntry;
end;
This new entry contains an entry template. In the following code example, that
new entry is passed as a parameter to the
FillNewEntry method, which is
implemented in the stationery’s dataDef.
FillNewEntry adds a slot named
kDataSymbol, which contains an entry template for the stationery’s data
denition. It then adds a
class slot to the new entry, which is set to the same
constant (
kDataSymbol). A viewStationery slot is then added and set to the
same constant (only needed for vestigial compatibility with the Notes application).
Finally, it adds a value to the
dueDate slot of the kDataSymbol entry.
FillNewEntry: func(newEntry)
begin
newEntry.(kDataSymbol) :=
Clone({who: "A Name",
howMuch: 42,
dueDate: nil});
Vue de la page 187
1 2 ... 183 184 185 186 187 188 189 190 191 192 193 ... 941 942

Commentaires sur ces manuels

Pas de commentaire