Menu

OnClose event in TDPFQLPreviewController missing

2015-07-21
2015-07-23
  • Harald Krekeler

    Harald Krekeler - 2015-07-21

    Hello.
    I'm developing a Firemonkey App for Android and iOS. The main form contains only FMX-Controls.
    On iOS I cant find a way to open a document like PDF (except TWebBrowser).

    I am now testing TDPFQLPreviewController:
    Create a new TForm and place only TDPFQLPreviewController on it. In the main form I open a PDF with

    procedure ShowDocumentPreview(const ALocalFileName: string);
    begin
     if not Assigned(FormDocPreview) then
       Application.CreateForm(TFormDocPreview, FormDocPreview);
     with FormDocPreview do
      begin
       QLPreviewController.ShowDoc(ALocalFileName, false);
       Show;
     end;
    end;

    But now I cannot find any way to close the form after the user click the Ready-Button on TDPFQLPreviewController. There is no Event like OnClosePreview.
    Any suggestion? Thanks, Harald

     

    Last edit: Harald Krekeler 2015-07-21
    • Harald Krekeler

      Harald Krekeler - 2015-07-23

      I added an event to DPF.iOS.QLPreviewController.pas

      TDPFQLPreviewController = class( TDPFiOSBaseControl )
      ...
      FOnClosePreview: TNotifyEvent;
      ...
      property OnClosePreview: TNotifyEvent read FOnClosePreview write FOnClosePreview;

      procedure TQLPreviewControllerDelegate.previewControllerDidDismiss( controller: QLPreviewController );
      begin
      if Assigned( FDPFQLPreviewController.FOnClosePreview ) then
      FDPFQLPreviewController.FOnClosePreview( FDPFQLPreviewController);
      end;

      Thanks for this component.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.