Apple Newton Utilities Guide de l'utilisateur Page 764

  • 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 763
CHAPTER 21
Routing Interface
21-16 Using Routing
If you need to read the body slot within the fields frame, note that it might
contain an alias. In order to access it you must get the format and send it the
ResolveBody message, like this:
theFormat := GetCurrentFormat(fields);
resolvedBodySlot := theFormat:ResolveBody(fields);
The ResolveBody method returns the data in the body slot whether or not it is
referenced by an alias, so you can always use it.
You can store information you obtain from an auxiliary view in the
fields frame,
preferably in the
body slot (or if body contains an alias, in the entry the alias
points to). If you store data from the auxiliary view in a different slot, be sure the
slot name has your developer signature appended to avoid future slot name
conicts.
Registering Routing Formats 21
All routing formats are specied as view denitions and are registered with the
system by means of the global function
RegisterViewDef. The formats that
handle data types other than
'view are not actually views, but they are registered
as view denitions to take advantage of the central registration mechanism.
Registering formats in this way makes them available to all applications in the
system. Routing formats are specially identied in the view denition registry
because the
type slot of all routing formats is set to the symbol 'routeFormat
(or
'printFormat in some ROM versions).
Register formats with the class of the object you want them to act on. Here is an
example of registering a format:
RegisterViewDef(myPrintFormat, '|myDataClass:SIG|);
This call registers the format myPrintFormat as working with data whose
class is
'|myDataClass:SIG|. If the class of any target data object is
'|myDataClass:SIG|, the format myPrintFormat will be available when
that item is routed. The fact that this print format (with a
'view data type) has
been registered means that you can print and fax that class of data items. This
mechanism enables you to have separate routing formats (and thus routing actions)
for individual views, if they use different data classes for data, rather than using the
same formats (and routing actions) for all views in an application.
Typically, your application registers routing formats when it is installed, in its part
InstallScript function, and unregisters formats in its RemoveScript
function. You use the function UnRegisterViewDef to unregister routing formats.
In an application part
InstallScript function, when registering your
routing formats, you must not use the Newton Toolkit function
GetLayout
to obtain a reference to the routing format layout, so that you can pass it to
Vue de la page 763
1 2 ... 759 760 761 762 763 764 765 766 767 768 769 ... 941 942

Commentaires sur ces manuels

Pas de commentaire