unit CtrlPanelZdva;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  DevCtrl, DatCtrl, ExtCtrls, StdCtrls, Buttons, VisZdva, ZdvaCtrl;

type
  TCtrlPanelZdvaForm = class(TForm)
    Timer: TTimer;

    procedure FormActivate(Sender: TObject);
    procedure TimerTimer(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    frm: TZdvaCtrlFrame;
  public
    M: TVisZdva;
  end;

var
  CtrlPanelZdvaForm: TCtrlPanelZdvaForm;

implementation
uses numbers, TagStorage;

{$R *.DFM}

procedure TCtrlPanelZdvaForm.FormActivate(Sender: TObject);
//var
//  k,
//  i,l: integer;
begin
  Timer.Enabled := false;
  // Создание объектов панели управления
//  k:=0;

  if frm = nil then begin
    frm := TZdvaCtrlFrame.Create(self);
    frm.Parent := self;
    frm.Name := 'frm';
    frm.Left := 2;
    frm.Top :=  2;
    frm.Visible := true;
    frm.Align := alClient;
  end;

  frm.M := M;
  frm.Init;
  frm.Visible := true;

  Timer.Enabled := true;

end;

procedure TCtrlPanelZdvaForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Timer.Enabled := false;
end;


procedure TCtrlPanelZdvaForm.TimerTimer(Sender: TObject);
begin
  frm.Process;
end;




end.
