beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 303

background image

C H A P T E R 8

Text and Ink Input and Display

Using Text

8-11

// 8 chars of one font, 3 chars of another, 5 chars

// of another

styles: [8, 18434, 3, 12290, 5, 1060865],

...}

Paragraph views are normally lined to convey to the user that the view accepts text
input. To add the lined paper effect to paragraph views, see “Creating the Lined
Paper Effect in a Text View” (page 8-8).

Lightweight Paragraph Views

8

When you create a template using the

clParagraphView

class, and that

template is instantiated into a view at run time, the system may create a specialized
kind of paragraph view object, called a lightweight paragraph view. Lightweight
paragraph views have the advantage of requiring much less memory than do
standard paragraph views.

The system automatically creates a lightweight paragraph view instead of a
standard paragraph view if your template meets the following conditions:

The view must be read-only, which means that its

viewFlags

slot contains the

vReadOnly

flag.

The view must not include any tabs, which means that the template does not
contain the

tabs

slot.

The view must not include multiple font styles, which means that the template
does not contain the

styles

slot; however, the view can contain a rich string in

its

text

slot. For information about rich strings, see “Rich Strings” (page 8-22).

The

viewFlags

slot of the view must not contain the following flags:

vGesturesAllowed

,

vCalculateBounds.

Note

Lightweight paragraph views can contain ink.

Most paragraph views look the same after they are instantiated; that is, there is
not normally a way to tell whether a particular paragraph view is a standard or a
lightweight view. However, ink displayed in a lightweight paragraph view is
displayed in a fixed font size.

Note

When laying out text in a lightweight paragraph view, the
viewLineSpacing value is ignored. This is not generally a
problem, since the line spacing dotted lines are normally used to
indicate that the text can be edited, and text in a lightweight
paragraph cannot be edited.