background image
C H A P T E R 5
Stationery
5-2
About Stationery
A dataDef is based on the
newtStationery
proto and is used to create
alternative data structures. The dataDef contains slots that define, describe, and
identify its data structures. It also contains a slot, called
superSymbol
, that
identifies the application into which its data entries are to be subsumed. It also
contains a
name
slot where the string that names the dataDef is placed. This is the
name that appears in the New picker. Note that each of the items shown in the New
menu of the Notes application in Figure 5-1 is a dataDef name.
The viewDef is based on any general view proto, depending upon the
characteristics you wish to impart, but must have a specified set of slots added to it.
(For more information about the slots required in viewDefs and dataDefs, see the
"Stationery Reference" chapter in Newton Programmer's Reference.) The viewDef
is the view template you design as the input and display device for your data. It is
the component of stationery that imparts the "look and feel" for that part of the
application. Each dataDef must have at least one viewDef defined to display it,
though it can have several.
You may include or add stationery to any NewtApp application or any application
that already uses stationery. The stationery components you create appear as items
in the pickers (pop-up menus) of the New and Show buttons.
The Stationery Buttons
5
The stationery buttons are necessary to integrate stationery definitions with
an application. They must be in the application which is to display your
stationery components. They are defined as part of the NewtApp framework
and work only when included in a NewtApp application. (You can use the
newtStationeryPopupButton
proto to create your own non-
NewtApp buttons.)
The New button offers new data formats generated from dataDefs. For example,
the New button in the built-in Calls application creates one new data entry form by
default; if it contained more dataDefs there would be a New picker available. The
New button of the built-in Notes application offers a picker whose choices create a
new Note, Checklist, or Outline format for entering notes. The example used in this
chapter extends the built-in Notes application by adding the dataDef item IOU to
the New menu, as shown in Figure 5-1.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна