C H A P T E R 8
Text and Ink Input and Display
Using Text
8-9
Defining a Line Pattern
8
You can define a custom line pattern for drawing the horizontal lines in a paragraph
view. A line pattern is an eight-byte binary data structure with the class
'pattern
.
To create a binary pattern data structure on the fly, use the following
NewtonScript trick:
myPattern := SetClass( Clone("\uAAAAAAAAAAAAAAAA"),
'pattern );
This code clones a string, which is already a binary object, and changes its class to
'pattern
. The string is specified with hex character codes whose binary represen-
tation creates the pattern. Each two-digit hex code creates one byte of the pattern.
Including Editable Child Views in an Input View
8
For a child view of a clEditView to be editable, you need to follow certain rules:
The child view must reside in the
viewChildren
slot of the
clEditView
.
You cannot store a child view's template in the
stepChildren
slot, as NTK
normally does.
The child view must contain a
viewStationery
slot with an appropriate
value, depending on the view class and data type. The acceptable values are
shown in Table 8-2:
Add the child view templates to the
viewChildren
array of the edit view and
open the view or send it the
RedoChildren
message. Alternatively, you can
add the child view with the
AddView
method and then send the
Dirty
message
to the edit view.
Table 8-2
viewStationery
slot value for
clEditView
children
View class
View data type
Value of
viewStationery
slot
clParagraphView
text
'para
clPolygonView
recognized
graphics
'poly
clPolygonView
ink
'ink
clPictureView
bitmap or
picture object
'pict