beautypg.com

Implementing a minimal scroller 7, Automatic arrow feedback 7 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 263

background image

C H A P T E R 7

Controls and Other Protos

Scroller Protos

7-3

The

protoUpDownScroller

is centered on the right side of a view and

provides vertical scroll arrows. For more information about the slots and
methods for this scroller, see “protoUpDownScroller” (page 6-5) in Newton
Programmer’s Reference
. Figure 7-3 shows an example of a

protoHorizontal2DScroller

view.

Figure 7-3

A

protoUpDownScroller

view

The

protoHorizontalUpDownScroller

is centered at the bottom of a

view and provides vertical scroll arrows. For more information about the slots
and methods for this scroller, see “protoHorizontalUpDownScroller” (page 6-6)
in Newton Programmer’s Reference. Figure 7-4 shows an example of a

protoHorizontalUpDownScroller

view.

Figure 7-4

A

protoHorizontalUpDownScroller

view

Implementing a Minimal Scroller

7

To implement a minimal scroller, all that you have to define is a

ViewScroll2DScript

method in your scroller template. This method is

called whenever the user taps one of the scroll arrows in the scroller view. Your

ViewScroll2DScript

method must perform the actual scrolling of the contents

of some other view, which you usually do by calling the

SetOrigin

method.

For more information on the

ViewScroll2DScript

method, see

“ViewScroll2DScript” (page 6-3) in Newton Programmer’s Reference. For
more information on the

SetOrigin

method, see “SetOrigin” (page 2-48) in

Newton Programmer’s Reference.

Automatic Arrow Feedback

7

All of the scroller protos can provide visual feedback to the user indicating that
there is more information to see. This feedback is handled automatically for your if
you provide three additional slots in your scroller template:

scrollRect

,