Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 2 - Newton Works Draw Application / Draw Application Reference
Proto / protoDrawTool


AdjustBounds

protoDrawTool:AdjustBounds(shape, style, left, top, right, bottom, constrain)

Called to limit the bounds of the object as the user is dragging out a new bounding box or resizing an existing object.

shape
Either a graphic object, or nil if a new object is being created and dragARectangle is set to true.

style
The current user defaults for penSize, penPattern, fillPattern, and font.

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.

constrain
The value true indicates that the shift key is pressed.

return value
A bounds frame.

DISCUSSION

The default version of this method limits the bounding box to always be square when constrain is true. If you override this method, you should do something similar.

SPECIAL CONSIDERATIONS

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 bounds frame you return should be Min(left, right), the top slot should be Min(top, bottom), and so on.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help