Explanation of the TFrx Stretchable.Drawpart function


I have a TFrxWPtoolview component that's a descendant of TFrxStretchable.
I'm unsure what my DrawPart function should return.
According to the FastReport comments included in the source, the view's drawPart is called
in the TfrxEngine.SplitObjects function, and just before your comment, it says:
{ trying to place it }
{ DrawPart method returns the amount of unused space. If the view
can't fit in the height, this method returns the Height }
1 er com.
I don't understand, this is the first part of the TFrxStretchable
(CalcHeight has already been called and FR knows that it doesn't fit in height) 
so DrawPart expects the preparation of the drawing of the 1st part,
I have a case where DrawPart returns 130 px (the view is 200 my text is 70 px),
but on the 1st draw, FR offers me a Height of 200 (FY1 - FY) whereas it should be 70
2nd com.
"Return the height, "
What height? That of the first part or the whole thing?

Regards
Bruno Petit
Itesya


Comments

  • gpigpi
    edited August 12

    See frxHTML.pas as a sample

    //Returns the amount of unused space. If view can't fit in the height, this method returns the Height
    function TfrxHtmlView.DrawPart: Extended;
    begin
     if Round(Height - GapY * 2) <= 0 then // text can't fit
     begin
      Result := Height;
      Exit;
     end;
     FPartStart := FNextPartStart;
     FPartHeight := CalcPartHeightFromPageBreak;
     if FPartHeight = Unknown then
      FPartHeight := CalcPartHeightFromBitmap;
     FNextPartStart := FNextPartStart + FPartHeight;
     Result := Height - FPartHeight;
    end;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.