trichview.com

trichview.support




Padding in RV?


Return to index


Author

Message

Stefan M. Huber

Posted: 10/07/2004 16:23:22


Hi!


   I am using three RichViewEdit components. Two of them hold data for 

header and footer information for the third one. Using SetHeader/SetFooter 

works. With one little flaw:


The Header is constructed using this code:


   AddNL(' ', 0, 3);

   AddBreakEx(1, rvbsLine, clBlack);

   if Trim(ueberschriftTxt) <> '' then AddNL(ueberschriftTxt, 1, 2);


The blank line will be filled later on, since I need one left aligned and 

one right aligned part. Thus, I use PagePrepaint. In PagePrepaint, I fetch 

the HeaderRect and start drawing:


   R := RVPrint.GetHeaderRect;

   Canvas.Font.Name := RVStyle.TextStyles.Items[2].FontName;

   Canvas.Font.Size := RVStyle.TextStyles.Items[2].Size;

   sz := Canvas.TextExtent(reKopfTxt);

   Canvas.TextOut(R.Left, R.Top, '  ' + liKopfTxt);

   Canvas.TextOut(R.right -  sz.cx, R.Top, reKopftxt);


There's some gap that I can't explain and remove:


LEFT_HEAD                 RIGHT_HEAD

  ----------------------------------

UEBERSCHRIFT(HEADING)


Note, that the line starts indented, while the text doesn't. Where does 

this come from? Can I remove it?


Stefan





Powered by ABC Amber Outlook Express Converter