background image
C H A P T E R 8
Text and Ink Input and Display
Using Text
8-7
instead, they have child views that contain the individual data items. Text items
are contained in child views of the class
clParagraphView
and graphics are
contained in child views of the class
clPolygonView
.
A view of the
clEditView
class includes the following features:
Automatic creation of
clParagraphView
or
clPolygonView
children as
the user writes or draws in the view. These child views hold the data the user writes.
Support for inclusion of
clPictureView
views, which are used for images.
Text and shape recognition, selection, and gestures such as scrubbing, copying
to clipboard, pasting from clipboard, duplicating, and others, as controlled by
the setting of the
viewFlags
slot. The initial recognition is handled by the
clEditView
. A child
clParagraphView
or
clPolygonView
is created
and that child view handles subsequent editing of the data.
Drag and drop handling. A child view can be dragged (moved or copied) out of
the
clEditView
and dropped into another
clEditView
, whose child it then
becomes. Other views can be configured to handle data dragged from a
clEditView
, as described in "Views" (page 3-1).
Clipboard support. A
clParagraphView
or
clPolygonView
child view can
be dragged (moved or copied) to the clipboard, from which it can be pasted into
another
clEditView
or
clView
, whose child it becomes.
Automatic resizing of
clParagraphView
child views to accommodate added
input. This feature is controlled by the
vCalculateBounds
flag in the
viewFlags
slot of those child views.
Automatic addition of new words to existing paragraphs when caret insertion
writing mode is disabled.
Views of the class
clEditView
are intended for user input of text, shape, image,
and ink data. Consequently, views of this class expect that any child views have
been defined and created at run time, not predefined by templates created in NTK.
If you need to include predefined child views in a
clEditView
, use the
ViewSetupChildrenScript
method of the
clEditView
to define the child
views and set up the
stepChildren
array. You might need to do this, for
example, if you store the data for child views in a soup, and you need to retrieve
the data and rebuild the child views at run time. For more information, see
"Including Editable Child Views in an Input View" (page 8-9).
The default font for a
clParagraphView
created by a
clEditView
is the font
selected by the user on the Styles palette in the system.
The default pen width for a
clPolygonView
created by a
clEditView
is the
width set by the user on the Styles palette.
The slots of
clEditView
are described in "General Input View (clEditView)"
(page 7-12) in Newton Programmer's Reference.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна