beautypg.com

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

Page 104

background image

C H A P T E R 3

Views

3-20

About Views

viewOriginX and viewOriginY Slots

3

These slots can be read but not written or set. Instead, use

Setorigin

to set the

origin offset for a view. For more information, see “Scrolling View Contents”
(page 3-41).

If you use these slots to specify an offset, the point you specify becomes the new
origin. Child views are drawn offset by this amount. This is useful for displaying
different portions of a view whose content area is larger than its visible area.

Appearance

3

The

viewFormat

slot defines view attributes such as its fill pattern, frame pattern,

frame type, and so on. Custom fill and frame patterns are defined using the

viewFillPattern

and

viewFramePattern

slots.

The

viewTransferMode

slot controls the appearance of the view when it is drawn

on the screen; that is, how the bits being drawn interact with bits on the screen.

View Format

3

The

viewFormat

slot defines visible attributes of a view such as its fill pattern,

frame type, and so on. In the

viewFormat

slot, you can specify one or more

format attributes, which are represented by constants defined as bit flags. You can
specify one format attribute from each of the following groups:

view fill pattern

view frame pattern

view frame thickness

view frame roundness

view frame inset (this is the white space between the view bounds and view frame)

view shadow style

view line style (these are solid or dotted lines drawn in the view to make it look
like lined paper)

Multiple attributes are specified by adding them together like this:

vfFillWhite+vfFrameBlack+vfPen(2)+vfLinesGray

Note that the frame of a view is drawn just outside of the view bounding box, not
within it.

The fill for a view is drawn before the view contents and the frame is drawn after
the contents.