trichview.com

trichview.support




Re: More on importing (copying and pasting) documents or document sections with styles?


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/23/2004 14:03:02


When using MinTextWidth/MaxTextWidth, it's may be not always clear why the

horizontal scrollbar does not occur and why text wraps where it wraps.


Add this code in RichViewEdit.OnPaint event.

It shows document area width (black line) and margins (dotted lines)


procedure TForm1.rvePaint(Sender: TCustomRichView; Canvas: TCanvas;

  Prepaint: Boolean);

var x: Integer;

begin

  Canvas.Pen.Style := psDot;

  Canvas.Pen.Width := 1;

  Canvas.Pen.Color := clBtnShadow;


  x := Sender.LeftMargin-Sender.HScrollPos;


  Canvas.MoveTo(x, 0);

  Canvas.LineTo(x, Sender.Height);


  inc(x,Sender.RVData.TextWidth);


  Canvas.MoveTo(x, 0);

  Canvas.LineTo(x, Sender.Height);


  Canvas.Pen.Color := clBlack;

  Canvas.Pen.Style := psSolid;

  inc(x, Sender.RightMargin);


  Canvas.MoveTo(x, 0);

  Canvas.LineTo(x, Sender.Height);

end;






Powered by ABC Amber Outlook Express Converter