constructor TnxPreviewPlugin.Create(aOwner: TComponent); begin inherited; end;
{ TnxPreview }
procedure TnxPreviewPlugin.EventNotify(aCommunicator: TppCommunicator; aEventID: Integer; aParams: TraParamList); var lnxReportingButtons: InxReportingButtons; begin
if TRBPrintPreview(Parent.owner).ButtonsForm.GetInterface(InxReportingButtons, lnxReportingButtons) then lnxReportingButtons.ButtonsDisabled := (Viewer.Busy) {or (Viewer.Report.Printing)};
Comments
Print Preview form is to register a custom TppPreview for it:
type
TnxPreviewPlugin = class(TppPreview)
protected
procedure PrintStateChangeEvent(Sender: TObject); override;
public
constructor Create(aOwner: TComponent); override;
procedure EventNotify(aCommunicator: TppCommunicator; aEventID:
Integer; aParams: TraParamList); override;
end;
implementation
constructor TnxPreviewPlugin.Create(aOwner: TComponent);
begin
inherited;
end;
{ TnxPreview }
procedure TnxPreviewPlugin.EventNotify(aCommunicator: TppCommunicator;
aEventID: Integer; aParams: TraParamList);
var
lnxReportingButtons: InxReportingButtons;
begin
if
TRBPrintPreview(Parent.owner).ButtonsForm.GetInterface(InxReportingButtons,
lnxReportingButtons) then
lnxReportingButtons.ButtonsDisabled := (Viewer.Busy) {or
(Viewer.Report.Printing)};
inherited EventNotify(aCommunicator, aEventID, aParams);
end;
procedure TnxPreviewPlugin.PrintStateChangeEvent(Sender: TObject);
begin
inherited;
if not viewer.Busy then
CancelButton.visible := False;
end;
initialization
TppPreviewPlugIn.Register(TnxPreviewPlugin);
finalization
TppPreviewPlugIn.UnRegister(TnxPreviewPlugin);
end.
Take a look at the TppReport.OnCancel event.
This event fires when a user cancels the generation of a report.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com