unit Unit_27;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes,
  Graphics, Controls, Forms,
  Dialogs, Spin, StdCtrls, Divide2Numbers;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    SpinEdit1: TSpinEdit;
    SpinEdit2: TSpinEdit;
    Divide1: TDivide;
    procedure Button1Click(Sender: TObject);
    procedure Divide1ZeroDivide(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Divide1.Number1:=SpinEdit1.Value;
  Divide1.Number2:=SpinEdit2.Value;
  Divide1.Divide2Numbers;
  Edit1.Text:=FloatToStr(Divide1.Result);
end;
//---------------------------------------------------------
procedure TForm1.Divide1ZeroDivide(Sender: TObject);
begin
   Application.MessageBox('Próba dzielenia przez zero !',
                          'Uwaga',MB_OK);
end;
//---------------------------------------------------------
end.
