FastReport_2022_VCL/LibD28x64/frxRegIntIO.pas
2024-01-01 16:13:08 +01:00

89 lines
2.6 KiB
ObjectPascal

{******************************************}
{ }
{ FastReport VCL }
{ Registration unit }
{ }
{ Copyright (c) 1998-2021 }
{ by Fast Reports Inc. }
{ }
{******************************************}
unit frxRegIntIO;
{$I frx.inc}
interface
procedure Register;
implementation
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
{$IFNDEF Delphi6}
DsgnIntf,
{$ELSE}
DesignIntf, DesignEditors,
{$ENDIF}
frxRes, frxIOTransportHelpers, frxIOTransportDropbox, frxIOTransportOneDrive,
frxIOTransportBoxCom, frxIOTransportGoogleDrive, frxIOTransportGMail, frxIOTransportYandexDisk,
frxIOTransportOutlook;
type
TfrxHTTPSTransportsEditor = class(TComponentEditor)
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): String; override;
function GetVerbCount: Integer; override;
end;
procedure Register;
begin
RegisterComponents('FastReport VCL Internet transports',
[TfrxDropboxIOTransport, TfrxOneDriveIOTransport, TfrxBoxComIOTransport, TfrxGoogleDriveIOTransport,
TfrxGMailIOTransport, TfrxYandexDiskIOTransport, TfrxOutlookIOTransport]);
RegisterComponentEditor(TfrxDropboxIOTransport, TfrxHTTPSTransportsEditor);
RegisterComponentEditor(TfrxOneDriveIOTransport, TfrxHTTPSTransportsEditor);
RegisterComponentEditor(TfrxBoxComIOTransport, TfrxHTTPSTransportsEditor);
RegisterComponentEditor(TfrxGoogleDriveIOTransport, TfrxHTTPSTransportsEditor);
RegisterComponentEditor(TfrxGMailIOTransport, TfrxHTTPSTransportsEditor);
RegisterComponentEditor(TfrxYandexDiskIOTransport, TfrxHTTPSTransportsEditor);
RegisterComponentEditor(TfrxOutlookIOTransport, TfrxHTTPSTransportsEditor);
end;
{ TfrxHTTPSTransportsEditor }
procedure TfrxHTTPSTransportsEditor.ExecuteVerb(Index: Integer);
var
LDialog: TfrxBaseTransportDialog;
LTransport: TfrxInternetIOTransport;
begin
if not (Component is TfrxInternetIOTransport) then Exit;
LTransport := TfrxInternetIOTransport(Component);
LDialog := TfrxBaseTransportDialog(LTransport.TransportDialogClass.NewInstance);
LDialog.Create(nil);
try
LDialog.InitControlsFromFilter(LTransport);
if LDialog.ShowModal = mrOK then
begin
LDialog.InitFilterFromDialog(LTransport);
end;
finally
LDialog.Free;
end;
end;
function TfrxHTTPSTransportsEditor.GetVerb(Index: Integer): String;
begin
Result := 'Edit connection';
end;
function TfrxHTTPSTransportsEditor.GetVerbCount: Integer;
begin
Result := 1;
end;
end.