on-paint in editor<%>
Provides a way to add arbitrary graphics to an editor's display. This method is called just before and just after every painting of the editor.
The
on-paint method, together with the snips'
draw methods, must be able to draw the entire state of an editor. Never
paint directly into an editor's display canvas except from
within
on-paint or
draw. Instead, put all extra drawing code within
on-paint and call
invalidate-bitmap-cache when part of the display needs to be repainted.
If an
on-paint method uses cached location information, then the cached
information should be recomputed in response to a call of
invalidate-bitmap-cache.
The
on-paint method must not make any assumptions about the state of the drawing
context (e.g., the current pen), except that the clipping region is
already set to something appropriate. Before
on-paint returns, it must restore any drawing context settings that it changes.
The editor is internally locked for writing and reflowing during a call to this method (see also Locks).
(-> voidsendan-editoron-paintbefore?dclefttoprightbottomdxdydraw-caret)
before?: boolean
dc:dc<%>object
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)The
before?argument is#twhen the method is called just before a painting the contents of the editor or#fwhen it is called after painting. Theleft,top,right, andbottomarguments specify which region of the editor is being repainted, in editor coordinates. To get the coordinates fordc, offset editor coordinates by adding (dx,dy). See Caret for information aboutdraw-caret.See also
invalidate-bitmap-cache.