unit UInputQueryFile;
interface
uses
Windows, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, Buttons, Mask, ToolEdit;
type
TFrmInputQueryFile =
class(TForm)
FilenameEdit1: TFilenameEdit;
BtnOk: TBitBtn;
BtnCancel: TBitBtn;
LblPromt: TLabel;
private
{ Private-Deklarationen }
function GetFilename:
string;
procedure SetFilename(
const Value:
string);
public
{ Public-Deklarationen }
property Filename:
string read GetFilename
write SetFilename;
end;
function InputQueryFile(
const ACaption, APrompt:
string;
var Value:
string): Boolean;
implementation
{$R *.DFM}
function InputQueryFile(
const ACaption, APrompt:
string;
var Value:
string): Boolean;
var
FrmInputQueryFile: TFrmInputQueryFile;
begin
Result := False;
FrmInputQueryFile := TFrmInputQueryFile.Create(
nil);
try
FrmInputQueryFile.Caption := ACaption;
FrmInputQueryFile.LblPromt.Caption := APrompt;
FrmInputQueryFile.Filename := Value;
if FrmInputQueryFile.ShowModal = mrOk
then
begin
Value := FrmInputQueryFile.Filename;
Result := True;
end;
finally
FrmInputQueryFile.Free;
end;
end;
{ TFrmInputQueryFile }
function TFrmInputQueryFile.GetFilename:
string;
begin
Result := FilenameEdit1.FileName;
end;
procedure TFrmInputQueryFile.SetFilename(
const Value:
string);
begin
FilenameEdit1.FileName := Value;
end;