draw in snip%
Called (by an editor) to draw the snip.
Before this method is called, the correct font, text color, and pen
color for the snip's style will have been set in the drawing context already.
(This is not true for
get-extent or
partial-offset.)
The
draw method must not make any other assumptions about the state
of the drawing context, except that the clipping region
is already set to something appropriate. Before
draw returns, it must restore any drawing context settings
that it changes.
See also
on-paint in editor<%>.
The snip's editor is usually internally locked for writing and reflowing when this method is called (see also Locks).
(-> voidsenda-snipdrawdcxylefttoprightbottomdxdydraw-caret)
dc:dc<%>object
x: real number
y: real number
left: real number
top: real number
right: real number
bottom: real number
dx: real number
dy: real number
draw-caret: symbol in'(no-caret show-inactive-caret show-caret)Draws the snip into the given drawing context with the snip's top left corner at location (
x,y) in DC coordinates.The arguments
left,top,right, andbottomdefine a clipping region (in DC coordinates) that the snip can use to optimize drawing, but it can also ignore these arguments.The
dxanddyargument provide numbers that can be subtracted fromxandyto obtain the snip's location in editor coordinates (as opposed to DC coordinates, which are used for drawing).See Caret for information about
draw-caret.