unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Clipbrd,
  Unit1, Unit2, Buttons, ExtCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Panel1: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    procedure FormShow(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public

    procedure Do_schowka();
    procedure Ze_schowka();
  end;

var
  Form1: TForm1;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
	Close();
end;

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
	Do_schowka();
end;

procedure TForm1.BitBtn3Click(Sender: TObject);
begin
   Ze_schowka();
end;

procedure TForm1.FormShow(Sender: TObject);
begin
   Memo1.Clear();
end;

procedure TForm1.Ze_schowka();
var
	schowek : MojSchowek;

begin
   try
      schowek := MojSchowek.Create();
      schowek.GetFromClipboard();
   finally
		FreeAndNil(schowek);
   end;
end;

procedure TForm1.Do_schowka();
var
	lp       : Integer;
	txt      : String;
   ob_osoba : Osoba;
   schowek  : MojSchowek;

begin
	Memo1.Clear();

	for lp := 1 to 14 do
   begin
		Memo1.Lines.Add(' ');
   end;

   try
   	schowek  := MojSchowek.Create();
      ob_osoba := Osoba.Create();

      ob_osoba.set_nazwisko('Zelwerowicz');
      ob_osoba.set_imie('Konstanty');
      ob_osoba.set_ulica('Zamkowa');
      ob_osoba.set_kodp('43-200');
      ob_osoba.set_miasto('Pszczyna');

      // przypisz osobe do obiektu w schowku
      schowek.SetOsoba(ob_osoba);

      schowek.CopyToClipboard();

	finally
      FreeAndNil(schowek);
      FreeAndNil(ob_osoba);
   end;
end;

end.

