beautypg.com

Providing a status template 22 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 809

background image

C H A P T E R 2 2

Transport Interface

Using the Transport Interface

22-21

Providing a Status Template

22

A status template for a transport is based on the proto

protoStatusTemplate

.

The status template displays status information to the user. A transport should
generally display a status view whenever it is sent the

ReceiveRequest

or

SendRequest

messages.

You probably won’t need to create your own status template. The

protoTransport

is defined with a default status template named

statusTemplate

(based on

protoStatusTemplate

), which includes six predefined subtypes, described in

Table 22-1 and shown in Figure 22-1. Each subtype consists of a set of child views
that are added to the base status view. The base status view includes a transport
icon and a close box, to which different child views are added, depending on the
specified subtype name.

Table 22-1

Status view subtypes

Subtype name

Important values

Description

vStatus

statusText

(top string)

A view that incorporates a status line.
This is the default subview created by

SetStatusDialog

.

vStatusTitle

statusText

(top string),

titleText

(lower string)

A view that incorporates a status line and
a line for the item’s title.

vConfirm

statusText

(top string),

primary

(lower-button text

and method:

{text:

string

, script:

function

}

),

secondary

(upper-button text and
method:

{text:

string

,

script:

function

}

)

A view that has space for three lines of
text, and two buttons. This view is
suitable for situations where the user
must choose between two options.

vProgress

statusText

(top string),

titleText

(lower string),

progress

(integer,

percentage completed)

A view that incorporates status and title
lines, as well as a dog-eared page image
that fills from top to bottom, based on the
progress of the transfer.

vGauge

statusText

(top string),

titleText

(lower string),

gauge

(integer, percentage

completed)

A view that incorporates status and title
lines, as well as a horizontal gauge that
fills from left to right, based on the
progress of the transfer.

vBarber

statusText

(top string),

titleText

(lower string),

barber

(set to

true

)

A view that incorporates status and title
lines, as well as a horizontal barber
pole-like image that can be made to
appear to move from left to right.