Robert Roessler:
> Thanks, Neil - but I thought that my last line "Current
> Scintilla/SciTE builds from CVS on Windows XP SP2." was sufficient
> platform info?
>
> Or maybe you are remembering that I work with the Scintilla widget on
> GTK+ on Windows too? :)
GTK+/Windows is an unknown case for me as I don't test that. It may
clip like Windows or ignore clipping like GTK+/X.
> Sure - test harnesses/code might be helpful.
Attached is a replacement for ScintillaWin::WndPaint in
src/win32/ScintillaWin.cxx that draws an outline around each paint
region in a cycle of colours which can show if a paint missed the text
you think needed to repainted. Easiest to understand with a
non-blinking caret.
The code for GTK+ is not as good so I've mostly been using the GTK+
debug paint feature but not via the command line as that makes SciTE
hang, so it is turned on by a key:
gint ScintillaGTK::KeyThis(GdkEventKey *event) {
static int dd = FALSE;
if (event->keyval == GDK_Escape)
dd = !dd;
gdk_window_set_debug_updates(dd);
> OK. I have now built with the changes you mentioned in a post about 7
> minutes before you made this reply.
There were earlier but still recent changes that affected this by
changing which areas of the margin were invalidated.
Neil
LRESULT ScintillaWin::WndPaint(uptr_t wParam) {
//ElapsedTime et;
// Redirect assertions to debug output and save current state
bool assertsPopup = Platform::ShowAssertionPopUps(false);
paintState = painting;
PAINTSTRUCT ps;
PAINTSTRUCT *pps;
bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains
// a PAINSTRUCT* from the OCX
static int i = 0;
COLORREF c[] = {RGB(0,0,0xff), RGB(0,0xff,0xff), RGB(0xff,0xff,0), RGB(0xff,0,0), RGB(0,0xff,0), };
i = (i + 1) % 5;
HBRUSH hbrColoured = ::CreateSolidBrush(c[i]);
PLATFORM_ASSERT(hRgnUpdate == NULL);
hRgnUpdate = ::CreateRectRgn(0, 0, 0, 0);
int rgnType = -1;
if (IsOcxCtrl) {
pps = reinterpret_cast<PAINTSTRUCT*>(wParam);
} else {
rgnType = ::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE);
pps = &ps;
::BeginPaint(MainHWND(), pps);
::FrameRgn(pps->hdc, hRgnUpdate, hbrColoured, 1, 1);
}
AutoSurface surfaceWindow(pps->hdc, this);
if (surfaceWindow) {
rcPaint = PRectangle(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom);
PRectangle rcClient = GetClientRectangle();
paintingAllText = rcPaint.Contains(rcClient);
if (paintingAllText) {
//Platform::DebugPrintf("Performing full text paint\n");
} else {
//Platform::DebugPrintf("Performing partial paint %d .. %d\n", rcPaint.top, rcPaint.bottom);
}
Paint(surfaceWindow, rcPaint);
surfaceWindow->Release();
}
::SelectClipRgn(pps->hdc, NULL);
::FrameRgn(pps->hdc, hRgnUpdate, hbrColoured, 2, 2);
::DeleteBrush(hbrColoured);
if (hRgnUpdate) {
::DeleteRgn(hRgnUpdate);
hRgnUpdate = 0;
}
if(!IsOcxCtrl)
::EndPaint(MainHWND(), pps);
if (paintState == paintAbandoned) {
// Painting area was insufficient to cover new styling or brace highlight positions
FullPaint();
}
paintState = notPainting;
// Restore debug output state
Platform::ShowAssertionPopUps(assertsPopup);
//Platform::DebugPrintf("Paint took %g\n", et.Duration());
return 0l;
}
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest