MakeObject
protoDrawTool:MakeObject
(left, top, right, bottom, style)
Called to create a new graphic object when the user taps or drags in the canvas with the tool.
DISCUSSION
- left
- The x-coordinate of the start point of the rectangle the user dragged with this tool.
- top
- The y-coordinate of the start point of the rectangle the user dragged with this tool.
- right
- The x-coordinate of the end point of the rectangle the user dragged with this tool.
- bottom
- The y-coordinate of the start point of the rectangle the user dragged with this tool.
- style
- A style frame with the current user defaults for
penSize
,penPattern
,fillPattern
, andfont
.
- return value
- An array of shapes with the same class as the tool.
You must provide your own version of this method in your tool template.
The array returned should have a style frame at the front to make sure you get the drawing environment you want. The last two objects in the array should be an "invisible" style and a rectangle shape. The rectangle should be the size of the shape you are returning, and the style frame should be:
SPECIAL CONSIDERATIONS{penSize: 0, fillPattern: vfNone, selection: nil }
If the user drags up and to the left, the values passed as the right and bottom arguments can be less than those passed as the left and top arguments. The
left
slot in your shape's bounds should beMin(left, right)
, thetop
slot should beMin(top, bottom)
, and so on.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help