trichview.com

trichview.support.thirdparty




TRVLabelItemInfo


Return to index


Author

Message

Geurt Lagemaat

Posted: 09/06/2004 17:51:57


Sergey,


I'm trying to modify the TRVLabelItemInfo labelitem to display a rectangle

at its border. I'm doing this in the DoPaint procedure:


procedure TOASymbolItem.DoPaint(r: TRect; Canvas: TCanvas;

  State: TRVItemDrawStates; Style: TRVStyle; dli: TRVDrawLineInfo;

  ColorMode: TRVColorMode);

var TextDrawState: TRVTextDrawStates;

    DTOption: Integer;

    Points : array[0..5] of TPoint;

begin

...

DrawText(Canvas.Handle, PChar(Text), Length(Text), r, DT_SINGLELINE or

DT_NOCLIP or DTOption);

  //-- new

  Canvas.Pen.Color := clblack;

  Canvas.Pen.Width:=1;

  Points[0].X :=r.Left;

  Points[0].Y :=r.Top;

  Points[1].X :=r.Left+(width-2);

  Points[1].Y :=r.Top;

  Points[2].X :=r.Left+(width-2);

  Points[2].Y :=r.Top+(height-2);

  Points[3].X :=r.Left;

  Points[3].Y :=r.Top+(height-2);

  Points[4].X :=r.Left;

  Points[4].Y :=r.Top;

  Polyline(Canvas.Handle, Points, 5);

  //-- end custom drawing

  Canvas.Brush.Style := bsClear;

...

end;


Now this works correct in TRichviewEdit but I have a problem in Preview and

on paper. I found that the rectangle is about 75% to small in the preview. I

guess it hase something to do with the width and height of my item while it

is printed.


I did some debugging and found that the height and width vars are set in

UpdateMe procedure. These values are always the same in the normal mode

(when the item is drawn in the TRichViewEdit) and in printmode (preview and

real print). Is this correct? Could you give me a hint where to look to

solve my problem?


Regards,


Geurt Lagemaat

Oriana Automatisering





Powered by ABC Amber Outlook Express Converter