Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

How to access the print button in the preview

edited January 2008 in General
Hello,

I'm migrating from RB 6.03 to 10.07.

I want to modify the print button in the preview.

In 6.03, I used a custom preview class, in the constructor I got the
Toolbar, and one of the components (a TSpeedButton) was the print button.

In 10.07, the components of the ppPreview are
- a TppTBRootItem
- a TppTBXChevronItem
- a TppTBXToolbarView

How can I access with one of these components the print button?

Thanks in advance
Klaus

Comments

  • edited January 2008
    Hi Klaus,

    You can access the buttons directly from the report object or create a
    custom preview as you did in RB 6.

    Accessing the buttons from the report...

    uses
    ppPrvDlg;

    procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
    begin
    TppPrintPreview(ppReport1.PreviewForm).PrintButton.Visible := False;
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    Hi Nico,

    Thanks a lot for the answer.

    In RB 6 the print button was a TSpeedButton, so I could use the
    OnMouseUp event to get the shift state.

    In RB 10 the print button is a TppTBXItem, which is a descendant of
    TComponent, which has only OnClick.

    Is there any way to get the shift state when clicking on the print button?

    Thank you very much for your answer,
    Klaus




    Nico Cizik (Digital Metaphors) schrieb:
  • edited February 2008

    I looked at the TB/TBX source but do not see a way to do that. The
    architecture is such that each tool Item, such as a button, has an
    associated ItemView and ItemViewer class. This provides a model view
    controller type of architecture, but does makes extending things more
    complex.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.