Creating Ink and TextBox Shapes
Two functions have been added to create ink and text box shapes: *MakeInk
and *MakeTextBox
. *MakeInk
takes five parameters, an ink data object and four integer coordinates for the bounding box. *MakeTextBox
also takes five parameters, a string and four integers for the bounding box.The following code example illustrates the use of *
MakeTextBox
, producing the shape displayed in Figure 6-7:
Figure 6-7 A textBoxlocal tb := MakeTextBox ("Note how text is automatically wrapped at word boundaries, and clipped at shape bounds.", 0, 0, 150, 123);
:DrawShape (tb,nil);
The code example in Listing 6-2 illustrates the use of the *MakeInk
function. This code sample is a method of aclEditView
that creates a shape array with all the ink children of the view.Listing 6-2 Function to retrieve ink shapes from a
clEditView
myEditView.CollectInkShapes := func()
begin local kids := :ChildViewFrames(); local inkShapes := []; foreach child in kids do if child.ink then begin local bounds := child.viewBounds; AddArraySlot( inkShapes, MakeInk(child.ink,bounds.left,bounds.top, bounds.right, bounds.bottom)); end; inkShapes; end;
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help