background image
C H A P T E R 2 1
Routing Interface
Using Routing
21-11
The
VerifyRoutingInfo
method is passed two parameters, the target
information frame obtained by
GetTargetInfo
, and the partially initialized item
frame obtained from
NewItem
. The
VerifyRoutingInfo
method allows you a
chance to verify or change the target item before the routing slip is opened.
Normally you would return the same target frame that was passed in, possibly
modified. To cancel the routing operation, you can return
nil
from this method.
Note that the system sends the
VerifyRoutingInfo
message only if it is imple-
mented by your application; otherwise, the routing operation continues without it.
If multiple items are being routed, the target object (constructed by
CreateTargeCursor
) encapsulates them all. In your
VerifyRoutingInfo
method, you can use the function
GetTargetCursor
to return a cursor to
navigate the items. Then you can iterate through the cursor using the cursor
methods
Entry
,
Next
, and
Prev
, as described in Chapter 11, "Data Storage and
Retrieval." Note that only these three cursor methods are supported for use with
cursors returned by
GetTargetCursor
.
Getting and Setting the Current Format
21
Next, the Routing interface sends your application base view the
GetDefaultFormat
message. The purpose of this message is to get the default
format so that when the routing slip is opened, the format can be initially set to the
default. Normally, the default format for a particular transport is simply the last
format used with that transport from that application. This information is stored in
the
lastFormats
slot of your application base view. Unless you want to do
something special, you don't need to implement the
GetDefaultFormat
method
because this is a root view method that is found by inheritance. The root view
method simply gets the default format symbol from the
lastFormats
slot.
The format can be changed by the user, or by the system (if no last format is found,
the default is set to the first one that is found). When the format is changed, the
Routing interface sends your application base view the
SetDefaultFormat
message. The purpose of this message is to store the default format symbol for later
use. Normally, this is stored in the
lastFormats
slot in the application base
view. Unless you want to do something special, you don't need to implement the
SetDefaultFormat
method because this is a root view method that is found by
inheritance. The root view method simply sets the new format symbol in the
lastFormats
slot of your application base view.
The
lastFormats
frame contains a slot for each transport that has been used
from your application. Whenever a transport is selected, the system first checks
your application for the
lastFormats
frame and for a slot within that frame
named with the symbol of the transport being used. If the slot is found, it contains
the symbol of the last format used by that transport. Then the system searches for a
format whose
symbol
slot matches it.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна