unit Unit_AddBorrow;
interface
uses
Unit_Helper_Language,
Unit_VCLFunctions,
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls,
Vcl.WinXPickers;
type
TForm_AddBorrow =
class(TForm)
Edit_AddBorrowName: TEdit;
DatePicker_AddBorrowDate: TDatePicker;
Button_AddBorrowOK: TButton;
Button_AddBorrowCancel: TButton;
Label_AddBorrow_Name: TLabel;
Label_AddBorrow_Date: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button_AddBorrowOKClick(Sender: TObject);
procedure Button_AddBorrowCancelClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private-Deklarationen }
FResultAddBorrowName:
String;
FResultAddBorrowDate: TDate;
public
{ Public-Deklarationen }
property ResultAddBorrowName:
String read FResultAddBorrowName
write FResultAddBorrowName;
property ResultAddBorrowDate: TDate
read FResultAddBorrowDate
write FResultAddBorrowDate;
end;
var
Form_AddBorrow: TForm_AddBorrow;
implementation
{$R *.dfm}
procedure TForm_AddBorrow.Button_AddBorrowCancelClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TForm_AddBorrow.Button_AddBorrowOKClick(Sender: TObject);
begin
FResultAddBorrowName := trim(Edit_AddBorrowName.Text);
FResultAddBorrowDate := DatePicker_AddBorrowDate.Date;
ModalResult := mrOK;
end;
procedure TForm_AddBorrow.FormCreate(Sender: TObject);
begin
Form_AddBorrow.Caption := _Form_AddBorrow;
Button_AddBorrowOK.Caption := _Button_AddBorrowOK;
Button_AddBorrowCancel.Caption := _Button_AddBorrowCancel;
Label_AddBorrow_Name.Caption := _Label_AddBorrow_Name;
Label_AddBorrow_Date.Caption := _Label_AddBorrow_Date;
end;
procedure TForm_AddBorrow.FormShow(Sender: TObject);
var
Dummy_TPoint: TPoint;
begin
Edit_AddBorrowName.Text := '
';
DatePicker_AddBorrowDate.Date := now;
if FResultAddBorrowName.Length > 0
then
Edit_AddBorrowName.Text := FResultAddBorrowName;
try
if FResultAddBorrowDate <> 0
then
DatePicker_AddBorrowDate.Date := FResultAddBorrowDate;
finally
end;
if getCursorpos(Dummy_TPoint)
then
begin
Self.Left := Dummy_TPoint.X;
Self.Top := Dummy_TPoint.Y;
CheckSeitenForm(Self);
end;
Edit_AddBorrowName.SetFocus;
end;
end.