Did not work :-( "Ghost" bands appeared.
So, I watched the sources and realized the following in the Watermark event (C++ code):
if (PaintMode.Contains( wppInPaintDesktop )) {
if ((RTFEngine->LayoutMode == wplayLayout) ||
(RTFEngine->LayoutMode == wplayFullLayout) ||
(RTFEngine->LayoutMode == wpDualPageView)) {
Wprtedefs::TWPVirtPage *vp = NULL;
TWPRTFEnginePaintPages pp;
TRect textr;
if (RTFEngine->GetPaintPage( PaintPageNr, pp, vp)) {
textr = PageRect;
textr.Left = textr.Left + Wprtedefs::MulDiv( pp.MarginLeft, XRes, WPScreenPixelsPerInch );
textr.Right = textr.Right - Wprtedefs::MulDiv( pp.MarginRight, XRes, WPScreenPixelsPerInch );
textr.Top = textr.Top + Wprtedefs::MulDiv( pp.MarginTop, YRes, WPScreenPixelsPerInch );
textr.Bottom = textr.Bottom - Wprtedefs::MulDiv( pp.MarginBottom, YRes, WPScreenPixelsPerInch );
toCanvas->Pen->Width = 1;
toCanvas->Pen->Color = clSilver;
toCanvas->Pen->Style = psSolid; // psDot
if (!pp.Modes.Contains( wpNoXMargins )) {
if (pp.MarginLeft > 0) {
toCanvas->MoveTo( textr.Left, textr.Top );
toCanvas->LineTo( textr.Left, textr.Bottom );
}
if (pp.MarginRight > 0) {
toCanvas->MoveTo( textr.Right, textr.Top );
toCanvas->LineTo( textr.Right, textr.Bottom );
}
}
if (!pp.Modes.Contains( wpNoYMargins )) {
if (pp.MarginTop > 0) {
toCanvas->MoveTo( textr.Left, textr.Top );
toCanvas->LineTo( textr.Right, textr.Top );
}
if (pp.MarginBottom > 0) {
toCanvas->MoveTo( textr.Left, textr.Bottom );
toCanvas->LineTo( textr.Right, textr.Bottom );
}
}
}
}
}
This seems to work now.
Unfortunately, the margins now are also shown in the preview window.
But for the moment I can live with it.
Regards,
E. Hess