unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TMainForm = class(TForm)
    Panel1: TPanel;
    imgKONIEC: TImage;
    img1: TImage;
    imgDWA: TImage;
    procedure imgDWAClick(Sender: TObject);
    procedure img1Click(Sender: TObject);
    procedure imgKONIECClick(Sender: TObject);

  private

  public
	 procedure Koniec();
  end;

var
  MainForm: TMainForm;

implementation

uses Unit2, Unit3;
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TMainForm.imgKONIECClick(Sender: TObject);
begin
	Koniec();
end;

procedure TMainForm.Koniec();
begin
	if Application.MessageBox('Koniec pracy', 'Uwaga', MB_ICONINFORMATION or MB_YESNO) = mrYes then
	begin
		Close();
   end;
end;

procedure TMainForm.img1Click(Sender: TObject);
begin
	try
		Form2 := TForm2.Create(Self);
		Form2.ShowModal();
	finally
   	FreeAndNil(Form2);
	end;
end;

procedure TMainForm.imgDWAClick(Sender: TObject);
begin
	try
		Form3 := TForm3.Create(Self);
		Form3.ShowModal();
	finally
   	FreeAndNil(Form3);
	end;
end;

end.
