unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DataModule, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls,
  {}
  FormOsoba;

type
  TFMain = class(TForm)
    Panel2: TPanel;
    Shape: TShape;
    Label1: TLabel;
    btnCLOSE: TBitBtn;
    btnINSERT: TBitBtn;
    procedure btnINSERTClick(Sender: TObject);
    procedure btnCLOSEClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private

  public

  end;

var
  FMain: TFMain;

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

procedure TFMain.btnCLOSEClick(Sender: TObject);
begin
	Close();
end;

procedure TFMain.FormActivate(Sender: TObject);
begin
   Shape.Brush.Color := clRed;
	if DM.ADOConnection1.Connected then
   begin
	   Shape.Brush.Color := clGreen;
   end;
end;

procedure TFMain.btnINSERTClick(Sender: TObject);
var
	res : TModalResult;

begin
	if not Assigned(FOsoba) then
   begin
      try
         FOsoba := TFOsoba.Create(Application);
         res    := FOsoba.ShowModal();
      finally
 			FreeAndNil(FOsoba);
      end;
   end;
end;

end.


