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

Cancel / Close button management

edited June 2014 in End User
We embedded a print preview plugin inside one of our own forms that is
itself embedded inside a "forms manager" framework, and the forms
manager has its on UI for closing its hosted forms.

So I want to be able to hide the button on the print preview plugin
AFTER its changed from a Cancel button to a Close button (pretty sure it
has that dual functionality). However, I can't find the right event to
do this. I've played with TppPreivew.EventNotify, but it doesn't
give me what I need. Any ideas?

TIA Paul

Comments

  • edited June 2014
    Hi Paul,

    The built-in previewer uses the PrintStateChangeEvent routine to control
    the Cancel/Close button. In your own preview plugin, you could override
    this routine and tailor it to your needs.

    From the viewer, you should be able to use the OnEndGenerate event to
    manipulate anything after the report has finished generating.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2014
    Thanks Nico, that worked a treat :)


    procedure TnxPreviewPlugin.PrintStateChangeEvent(Sender: TObject);
    begin
    inherited;

    if not viewer.Busy then
    CancelButton.visible := False;

    end;


This discussion has been closed.