<TWPPreview>.PrintMode

  • What's the WPTools 5 equivalent of doing something like the following in V4 or V3:

    Code
    procedure TfrmTextPreview.ScrollBox1Resize(Sender: TObject);
    var
      i : integer;
    begin
     try
       if (ppmStretchWidth in WPPreview1.PrintMode) or
          (ppmStretchHeight in WPPreview1.PrintMode) then
       begin
          WPPreview1.Width := ScrollBox1.ClientWidth-2;
          WPPreview1.Height := ScrollBox1.ClientHeight-2;


    PrintMode seems to either have been renamed or removed entirely.

    diamond

    • Offizieller Beitrag

    Hi,

    the value you need is in property 'AutoZoom'!

    But I wonder if you still need a scrollbox. Please check out the unit WPPrvFrm.pas which is the official preview dialog. That used to have a scrollbox, too, but it does not with wptools 5.

    I assume the TWPPreview does everything your scrollbox used to do.

    Note the new flag in ViewOptions which centers the page within the window.

    Julian Ziersch

  • Excellent!

    I just looked at the WPPrvFrm provided with V5. I haven't used the one provided with previous releases (for no particularly good reason other than I wanted to write my own for the exercise).

    There are some things I need my preview window to do that WPPrvFrm doesn't handle. For instance, I allow navigation through the mailmerge documents, a record at a time. However, the TWPPreview gives me a huge jump start, allowing me to add the few components and supporting code I might need to that!

    As always, thanks...:)

    diamond