How to enable buttons on twpPreviewDlg

  • I asked this question about a month ago, but it must have been overlooked.

    I'm using a twpPreviewdlg, and want to allow the user to setup a printer and print. I must be misunderstanding how to do this. The following doesn't do it. I do get a several unlabeled buttons top left.

    I'm using the twppreviewdlg so I don't have to create a form.

    • Offizieller Beitrag

    Print and setup printer is usually enabled.

    This is my TWPPreviewObject in my demo:

  • Print and setup printer may usually be enabled, but they are not for me. I have a row of square buttons on the upper left that show outlines when I mouse over them, but no icons or captions.

    I've stepped through WPPrvFrm in the debugger. btnPrint.Visible is True when dia.ShowModal is called. I think my problem isn't so much visibility as setting up the buttons. No icon, no caption on the button in the preview form.

    One odd thing I see in the debugger is that the following code is apparently not active (no blue dots). Please note that I HAVE enabled the define in the .inc file {$DEFINE WP6}.

    Code
    {$IFDEF WP6} 
        if SecOptionIsSet(FEditBox.SecurityOptions, wpSecNoSaveDialog) then
        begin
          dia.btnSavePDF.Visible := false;
          dia.btnSaveExport.Visible := false;
        end else
    {$ENDIF}
  • Jeremy, fwiw, I got this problem worked around in my install.
    D2010 wptools 6.14.
    I used the solution for wptools 5 at this post:
    http://wpcubed.com/forum/viewtopi…preview+buttons
    Made a backup of the wpprvfrm.dfm file in my D2010 wptools source folder and replaced with the downloaded file. I rebuilt the project and the close, print, and print setup buttons now have images.

    Julian will have to confirm if this is a valid fix for version 6 or not. It's working for me.
    -damon

  • Hi Julian. I just upgraded my version and the glyphs in the preview form are missing. The source files I can find are dated 27-10-2009 so it seems that the mentioned updated dfm-file has passed me by. .. or perhaps the files found are not used in building the component

    Can I download it separatly, do you have an alternative fix or will it be in the next update?

    .. A follow up. I tried the WP5 solution and it worked. My problem's solved and I assume that following updates contain the proper images.

  • These components and forms can be used to build a print preview for the contents of a TWPRichText or TDBWPRichText component.

    A memo control to edit formatted text. A toolbar, ruler and/or preview can be easily attached to it and the word processor is complete. Enhanced features such as transparency and tiled background images are also supported. TWPRichText is completely independent of the Win95 RTF component!
    Headers and footers are supported at preview - and print time. Both can be edited in the same TWPRichText control or assigned from another source. Fields like 'PAGENUMBER' are supported!


    :roll:
    John Galt
    The Definitive Source For Building your Ambit Business.