ScintillaView seems to refresh itself

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ScintillaView seems to refresh itself

Louis Sumberg-2
This is an observation, I can't say it's a bug, but I noticed when
porting my CaptureWindow utility that a ScintillaView seems to refresh
its display when you paint on it (or perhaps it is constantly
refreshing).  The area of refresh is related to where the caret position
is.  At the bottom of this post is some workspace code that illustrates
this.

CaptureWindow uses the ole technique of drawing a rectangle using xorpen
and then drawing it again to erase it.  However, since part of the
rectangle gets refreshed, the second rectangle leaves an artifact.  That
artifact is, in turn, transient, since another refresh makes it
disappear.  Unfortunately for CaptureWindow, the capture takes place
before the artifact disappears.  I changed the code a bit so the capture
works ok now, but I thought I'd mention the general observation here.

-- Louis

"Create small workspace with text and move caret to line 2"
sv := SmalltalkWorkspace show view.
sv topView rectangle: (Point zero extent: 150@150).
sv text: 'Line 1', String lineDelimiter, 'Line 2', String lineDelimiter
, 'Line 3'.
sv selectLine: 2.
sv setFocus.

"Draw rectangle inside workspace border.  Notice portion of rectangle
disappears."
canvas := sv canvas.
canvas foreMode: 7. "R2_XORPEN"
canvas pen: (Pen withStyle: 6 "PS_INSIDEFRAME" width: 4 color: Color cyan).
canvas brush: Brush transparent.
canvas rectangle: (Point zero extent: 100@100).

"Draw rectangle again.  Notice artifact is there, then it too disappears."
canvas rectangle: (Point zero extent: 100@100).


Reply | Threaded
Open this post in threaded view
|

Re: ScintillaView seems to refresh itself

Blair McGlashan
"Louis Sumberg" <[hidden email]> wrote in message
news:[hidden email]...
> This is an observation, I can't say it's a bug, but I noticed when porting
> my CaptureWindow utility that a ScintillaView seems to refresh its display
> when you paint on it (or perhaps it is constantly refreshing).  The area
> of refresh is related to where the caret position is.  At the bottom of
> this post is some workspace code that illustrates this.
>

Louis, I'm pretty sure that Scintilla draws its own cursor, so yes this
would not be entirely unexpected.

Regards

Blair