mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-05 14:32:37 +02:00
68 lines
1.3 KiB
ObjectPascal
68 lines
1.3 KiB
ObjectPascal
unit mainform;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
|
EditBtn, LCLIntf, LCLProc;
|
|
|
|
type
|
|
|
|
{ TForm1 }
|
|
|
|
TForm1 = class(TForm)
|
|
btnOpenURLHTTP: TButton;
|
|
btnOpenURLFILE: TButton;
|
|
btnOpenDocument: TButton;
|
|
btnFindBrowser: TButton;
|
|
editResult: TEdit;
|
|
editFileName: TFileNameEdit;
|
|
Label1: TLabel;
|
|
Label2: TLabel;
|
|
procedure btnFindBrowserClick(Sender: TObject);
|
|
procedure btnOpenDocumentClick(Sender: TObject);
|
|
procedure btnOpenURLHTTPClick(Sender: TObject);
|
|
procedure btnOpenURLFILEClick(Sender: TObject);
|
|
private
|
|
{ private declarations }
|
|
public
|
|
{ public declarations }
|
|
end;
|
|
|
|
var
|
|
Form1: TForm1;
|
|
|
|
implementation
|
|
|
|
{$R *.lfm}
|
|
|
|
{ TForm1 }
|
|
|
|
procedure TForm1.btnOpenURLHTTPClick(Sender: TObject);
|
|
begin
|
|
editResult.Text := BoolToStr(OpenURL('www.google.com'));
|
|
end;
|
|
|
|
procedure TForm1.btnOpenDocumentClick(Sender: TObject);
|
|
begin
|
|
editResult.Text := BoolToStr(OpenDocument(editFilename.Text));
|
|
end;
|
|
|
|
procedure TForm1.btnFindBrowserClick(Sender: TObject);
|
|
var
|
|
lStr, lParams: String;
|
|
begin
|
|
FindDefaultBrowser(lStr, lParams);
|
|
editResult.Text := lStr + ' ' + lParams;
|
|
end;
|
|
|
|
procedure TForm1.btnOpenURLFILEClick(Sender: TObject);
|
|
begin
|
|
editResult.Text := BoolToStr(OpenURL('file://'+editFilename.Text));
|
|
end;
|
|
|
|
end.
|
|
|