red box in paragraphs

General TRichView support forum. Please post your questions here
Post Reply
r1d2m3
Posts: 13
Joined: Sun Mar 07, 2010 12:13 am

red box in paragraphs

Post by r1d2m3 »

Why a box appears red lines around a paragraph?. I remember not defined as a box that appears. Thank you.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Red border around paragraphs occur in documents containing invalid paragraph indices.

For example, if rv.Style.ParaStyles.Count = 3, and you call

Code: Select all

rv.AddNL('hello', 0, 10);
rv.Format;
you will see this red border. This red border is defined in RVStyle.ParaStyles.InvalidItem property.
r1d2m3
Posts: 13
Joined: Sun Mar 07, 2010 12:13 am

how to draw a shape, for example, a line or a box?

Post by r1d2m3 »

Thanks for the reply. I make another question: how to draw a shape, for example, a line or a box?.

Thank you.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRichView does not support shapes. If you need a shape in a document, insert it as a picture.
(A horizontal line can be inserted as rvsBreak item)
r1d2m3
Posts: 13
Joined: Sun Mar 07, 2010 12:13 am

Post by r1d2m3 »

Should be possible to program shapes, lines, boxes, etc, with canvas?

thanks.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can insert TPaintBox component, where you can draw shapes.
On page, you can use OnPagePrepaint/OnPagePostpaint event to draw shapes.
In TRichViewEdit, you can use OnPaint event.
r1d2m3
Posts: 13
Joined: Sun Mar 07, 2010 12:13 am

Post by r1d2m3 »

As a TPaintBox inserted in a tritchviewedit? Please, if you have an example, I would appreciate. Another question, this TPaintBox inserted, will be released in print the document?

Thank you.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

http://www.trichview.com/support/files/insertcircle.zip

This example shows 3 ways to insert a figure in TRichViewEdit:
- using TPaintBox component
- using TShape component
- using TMetafile.

As for me, I think using TMetafile is the best method, because it provides a high quality printing.

The current version TRichView does not print components inherited from TGraphicControl, including TPaintBox and TMetafile.
This demo uses OnPrintComponent event to print PaintBox, but cannot print TShape.
In the next TRichView update, it will be able to print any TGraphicControl even without this event.
However, in any case, controls are printed by drawing in a temporal bitmap, then printing this bitmap. Because of this, a printing quality of controls is lower than a printing quality of metafiles.

For simplicity, this demo does not include code necessary to resize and drag inserted controls. See http://www.trichview.com/forums/viewtopic.php?t=157
Post Reply