Apple Newton Utilities Guía de usuario Pagina 771

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 942
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 770
CHAPTER 21
Routing Interface
Using Routing 21-23
Your application can provide internal application-dened actions, such as deleting
and duplicating, that do not use the Out Box and a transport to perform the routing
operation. These routing actions appear at the bottom of the Action picker.
You dene these routing actions by providing a slot named
routeScripts in
your application. The Action button searches its own context for the rst
routeScripts slot that it finds. Usually you define routeScripts in the base
view of your application. That way, all child views can nd it by inheritance. But if
you want to have different routing actions active for different views, you can dene
a
routeScripts slot in each child view denition, where it will override the one
in the base view.
Alternatively, instead of dening an array of application-specic routing actions in
the
routeScripts slot, you may want to build the array dynamically. To do this,
you can override the root view method
GetRouteScripts, which is used by the
Routing interface to obtain the
routeScripts array from your application. The
default version of this method simply returns the contents of the
routeScripts
slot to the Routing interface. In the
GetRouteScripts method, build and return
an array like one you would dene in the
routeScripts slot.
If you provide a
routeScripts slot, it must contain an array of frames, one for
each routing action item, that look like this:
{title: "MyAction", // name of action
icon: GetPictAsBits("MyActionIcon",nil), // picker icon
RouteScript: 'MyActionFunc, // called if action selected
// other slots and methods you need
...}
To include a separator line in the Action picker’s list of application-specic routing
actions, include the symbol 'pickSeparator in the routeScripts array
between the two items you want to separate. Alternatively, you can include a
nil
value to include a separator line.
For delete and duplicate actions, there are bitmaps available in ROM that you can
use as icons. For the
icon slot of a delete action, you can specify the magic
pointer constant
ROM_RouteDeleteIcon. For the icon slot of a duplicate
action, you can specify the magic pointer constant
ROM_RouteDuplicateIcon.
If your application registers view denitions with the system, note that each view
denition can dene its own
routeScripts array. The routing action items that
apply to the individual view denition are added below those that apply to the
whole application in the Action picker. See the following section for more
information about specifying
routeScripts in stationery.
Vista de pagina 770
1 2 ... 766 767 768 769 770 771 772 773 774 775 776 ... 941 942

Comentarios a estos manuales

Sin comentarios