unit Construc;

interface

uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, StdCtrls, Tabs,
  Buttons, ExtCtrls, SetPlace, inputdat;

type
  TMultPageDlg = class(TForm)
    ButtonPanel: TPanel;
    TabSet: TTabSet;
    Notebook: TNotebook;
    OKBtn: TBitBtn;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    GroupBox5: TGroupBox;
    GroupBox4: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    CB_A1: TComboBox;
    CB_A2: TComboBox;
    CB_A3: TComboBox;
    CB_A4: TComboBox;
    CB_A5: TComboBox;
    CB_B1: TComboBox;
    CB_B2: TComboBox;
    CB_B3: TComboBox;
    CB_B4: TComboBox;
    CB_B5: TComboBox;
    CB_C1: TComboBox;
    CB_C2: TComboBox;
    CB_C3: TComboBox;
    CB_C4: TComboBox;
    CB_C5: TComboBox;
    CB_D1: TComboBox;
    CB_D2: TComboBox;
    CB_D3: TComboBox;
    CB_D4: TComboBox;
    CB_D5: TComboBox;
    CB_E1: TComboBox;
    CB_E2: TComboBox;
    CB_E3: TComboBox;
    CB_E4: TComboBox;
    CB_E5: TComboBox;
    CB_F1: TComboBox;
    CB_F2: TComboBox;
    CB_F3: TComboBox;
    CB_F4: TComboBox;
    CB_F5: TComboBox;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    Label25: TLabel;
    Label26: TLabel;
    GroupBox6: TGroupBox;
    Label27: TLabel;
    Label28: TLabel;
    Label29: TLabel;
    Label30: TLabel;
    Label31: TLabel;
    Site: TComboBox;
    Label32: TLabel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure TabSetClick(Sender: TObject);
    procedure SiteChange(Sender: TObject);
    procedure CB_A1Change(Sender: TObject);
    procedure CB_A2Change(Sender: TObject);
    procedure CB_A3Change(Sender: TObject);
    procedure CB_A4Change(Sender: TObject);
    procedure CB_A5Change(Sender: TObject);
    procedure CB_B1Change(Sender: TObject);
    procedure CB_B2Change(Sender: TObject);
    procedure CB_B3Change(Sender: TObject);
    procedure CB_B4Change(Sender: TObject);
    procedure CB_B5Change(Sender: TObject);
    procedure CB_C1Change(Sender: TObject);
    procedure CB_C2Change(Sender: TObject);
    procedure CB_C3Change(Sender: TObject);
    procedure CB_C4Change(Sender: TObject);
    procedure CB_C5Change(Sender: TObject);
    procedure CB_D1Change(Sender: TObject);
    procedure CB_D2Change(Sender: TObject);
    procedure CB_D3Change(Sender: TObject);
    procedure CB_D4Change(Sender: TObject);
    procedure CB_D5Change(Sender: TObject);
    procedure CB_E1Change(Sender: TObject);
    procedure CB_E2Change(Sender: TObject);
    procedure CB_E3Change(Sender: TObject);
    procedure CB_E4Change(Sender: TObject);
    procedure CB_E5Change(Sender: TObject);
    procedure CB_F1Change(Sender: TObject);
    procedure CB_F2Change(Sender: TObject);
    procedure CB_F3Change(Sender: TObject);
    procedure CB_F4Change(Sender: TObject);
    procedure CB_F5Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure OKBtnClick(Sender: TObject);
    procedure HelpBtnClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MultPageDlg: TMultPageDlg;

implementation

{$R *.DFM}

procedure TMultPageDlg.FormCreate(Sender: TObject);
begin
  { make the number of Tabs = number of Pages,
    and have the same names }
  TabSet.Tabs := Notebook.Pages;
end;

procedure TMultPageDlg.TabSetClick(Sender: TObject);
begin
  { set visible Page to which Tab was clicked }
  Notebook.PageIndex := TabSet.TabIndex;
end;

procedure TMultPageDlg.SiteChange(Sender: TObject);
var
 Idx:integer;
begin
    Idx:=Site.ItemIndex + 1;
    indexsite:=Site.ItemIndex;
   if EfecHuman[Idx].ClaseVul[1,1]=0 then
     CB_A1.text:='No Selected'
    else
     CB_A1.text:=CB_A1.items[EfecHuman[Idx].ClaseVul[1,1]];

   if EfecHuman[Idx].ClaseVul[1,2]=0 then
     CB_A2.text:='No Selected'
    else
     CB_A2.text:=CB_A2.items[EfecHuman[Idx].ClaseVul[1,2]];

   if EfecHuman[Idx].ClaseVul[1,3]=0 then
     CB_A3.text:='No Selected'
    else
     CB_A3.text:=CB_A3.items[EfecHuman[Idx].ClaseVul[1,3]];

   if EfecHuman[Idx].ClaseVul[1,4]=0 then
     CB_A4.text:='No Selected'
    else
     CB_A4.text:=CB_A4.items[EfecHuman[Idx].ClaseVul[1,4]];

   if EfecHuman[Idx].ClaseVul[1,5]=0 then
     CB_A5.text:='No Selected'
    else
     CB_A5.text:=CB_A5.items[EfecHuman[Idx].ClaseVul[1,5]];

   if EfecHuman[Idx].ClaseVul[2,1]=0 then
     CB_B1.text:='No Selected'
    else
     CB_B1.text:=CB_B1.items[EfecHuman[Idx].ClaseVul[2,1]];

   if EfecHuman[Idx].ClaseVul[2,2]=0 then
     CB_B2.text:='No Selected'
    else
     CB_B2.text:=CB_B2.items[EfecHuman[Idx].ClaseVul[2,2]];

   if EfecHuman[Idx].ClaseVul[2,3]=0 then
     CB_B3.text:='No Selected'
    else
     CB_B3.text:=CB_B3.items[EfecHuman[Idx].ClaseVul[2,3]];

   if EfecHuman[Idx].ClaseVul[2,4]=0 then
     CB_B4.text:='No Selected'
    else
     CB_B4.text:=CB_B4.items[EfecHuman[Idx].ClaseVul[2,4]];

   if EfecHuman[Idx].ClaseVul[2,5]=0 then
     CB_B5.text:='No Selected'
    else
     CB_B5.text:=CB_B5.items[EfecHuman[Idx].ClaseVul[2,5]];

   if EfecHuman[Idx].ClaseVul[3,1]=0 then
     CB_C1.text:='No Selected'
    else
     CB_C1.text:=CB_C1.items[EfecHuman[Idx].ClaseVul[3,1]];

   if EfecHuman[Idx].ClaseVul[3,2]=0 then
     CB_C2.text:='No Selected'
    else
     CB_C2.text:=CB_C2.items[EfecHuman[Idx].ClaseVul[3,2]];

   if EfecHuman[Idx].ClaseVul[3,3]=0 then
     CB_C3.text:='No Selected'
    else
     CB_C3.text:=CB_C3.items[EfecHuman[Idx].ClaseVul[3,3]];

   if EfecHuman[Idx].ClaseVul[3,4]=0 then
     CB_C4.text:='No Selected'
    else
     CB_C4.text:=CB_C4.items[EfecHuman[Idx].ClaseVul[3,4]];

   if EfecHuman[Idx].ClaseVul[3,5]=0 then
     CB_C5.text:='No Selected'
    else
     CB_C5.text:=CB_C5.items[EfecHuman[Idx].ClaseVul[3,5]];

   if EfecHuman[Idx].ClaseVul[4,1]=0 then
     CB_D1.text:='No Selected'
    else
     CB_D1.text:=CB_D1.items[EfecHuman[Idx].ClaseVul[4,1]];

   if EfecHuman[Idx].ClaseVul[4,2]=0 then
     CB_D2.text:='No Selected'
    else
     CB_D2.text:=CB_D2.items[EfecHuman[Idx].ClaseVul[4,2]];

   if EfecHuman[Idx].ClaseVul[4,3]=0 then
     CB_D3.text:='No Selected'
    else
     CB_D3.text:=CB_D3.items[EfecHuman[Idx].ClaseVul[4,3]];

   if EfecHuman[Idx].ClaseVul[4,4]=0 then
     CB_D4.text:='No Selected'
    else
     CB_D4.text:=CB_D4.items[EfecHuman[Idx].ClaseVul[4,4]];

   if EfecHuman[Idx].ClaseVul[4,5]=0 then
     CB_D5.text:='No Selected'
    else
     CB_D5.text:=CB_D5.items[EfecHuman[Idx].ClaseVul[4,5]];

   if EfecHuman[Idx].ClaseVul[5,1]=0 then
     CB_E1.text:='No Selected'
    else
     CB_E1.text:=CB_E1.items[EfecHuman[Idx].ClaseVul[5,1]];

   if EfecHuman[Idx].ClaseVul[5,2]=0 then
     CB_E2.text:='No Selected'
    else
     CB_E2.text:=CB_E2.items[EfecHuman[Idx].ClaseVul[5,2]];

   if EfecHuman[Idx].ClaseVul[5,3]=0 then
     CB_E3.text:='No Selected'
    else
     CB_E3.text:=CB_E3.items[EfecHuman[Idx].ClaseVul[5,3]];

   if EfecHuman[Idx].ClaseVul[5,4]=0 then
     CB_E4.text:='No Selected'
    else
     CB_E4.text:=CB_E4.items[EfecHuman[Idx].ClaseVul[5,4]];

   if EfecHuman[Idx].ClaseVul[5,5]=0 then
     CB_E5.text:='No Selected'
    else
     CB_E5.text:=CB_E5.items[EfecHuman[Idx].ClaseVul[5,5]];

   if EfecHuman[Idx].ClaseVul[6,1]=0 then
     CB_F1.text:='No Selected'
    else
     CB_F1.text:=CB_F1.items[EfecHuman[Idx].ClaseVul[6,1]];

   if EfecHuman[Idx].ClaseVul[6,2]=0 then
     CB_F2.text:='No Selected'
    else
     CB_F2.text:=CB_F2.items[EfecHuman[Idx].ClaseVul[6,2]];

   if EfecHuman[Idx].ClaseVul[6,3]=0 then
     CB_F3.text:='No Selected'
    else
     CB_F3.text:=CB_F3.items[EfecHuman[Idx].ClaseVul[6,3]];

   if EfecHuman[Idx].ClaseVul[6,4]=0 then
     CB_F4.text:='No Selected'
    else
     CB_F4.text:=CB_F4.items[EfecHuman[Idx].ClaseVul[6,4]];

   if EfecHuman[Idx].ClaseVul[6,5]=0 then
     CB_F5.text:='No Selected'
    else
     CB_F5.text:=CB_F5.items[EfecHuman[Idx].ClaseVul[6,5]];
end;

procedure TMultPageDlg.CB_A1Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[1,1]:=CB_A1.ItemIndex;
end;

procedure TMultPageDlg.CB_A2Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[1,2]:=CB_A2.ItemIndex;
end;

procedure TMultPageDlg.CB_A3Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[1,3]:=CB_A3.ItemIndex;
end;

procedure TMultPageDlg.CB_A4Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[1,4]:=CB_A4.ItemIndex;
end;

procedure TMultPageDlg.CB_A5Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[1,5]:=CB_A5.ItemIndex;
end;

procedure TMultPageDlg.CB_B1Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[2,1]:=CB_B1.ItemIndex;
end;

procedure TMultPageDlg.CB_B2Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[2,2]:=CB_B2.ItemIndex;
end;

procedure TMultPageDlg.CB_B3Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[2,3]:=CB_B3.ItemIndex;
end;

procedure TMultPageDlg.CB_B4Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[2,4]:=CB_B4.ItemIndex;
end;

procedure TMultPageDlg.CB_B5Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[2,5]:=CB_B5.ItemIndex;
end;

procedure TMultPageDlg.CB_C1Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[3,1]:=CB_C1.ItemIndex;
end;

procedure TMultPageDlg.CB_C2Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[3,2]:=CB_C2.ItemIndex;
end;

procedure TMultPageDlg.CB_C3Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[3,3]:=CB_C3.ItemIndex;
end;

procedure TMultPageDlg.CB_C4Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[3,4]:=CB_C4.ItemIndex;
end;

procedure TMultPageDlg.CB_C5Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[3,5]:=CB_C5.ItemIndex;
end;

procedure TMultPageDlg.CB_D1Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[4,1]:=CB_D1.ItemIndex;
end;

procedure TMultPageDlg.CB_D2Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[4,2]:=CB_D2.ItemIndex;
end;

procedure TMultPageDlg.CB_D3Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[4,3]:=CB_D3.ItemIndex;
end;

procedure TMultPageDlg.CB_D4Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[4,4]:=CB_D4.ItemIndex;
end;

procedure TMultPageDlg.CB_D5Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[4,5]:=CB_D5.ItemIndex;
end;

procedure TMultPageDlg.CB_E1Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[5,1]:=CB_E1.ItemIndex;
end;

procedure TMultPageDlg.CB_E2Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[5,2]:=CB_E2.ItemIndex;
end;

procedure TMultPageDlg.CB_E3Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[5,3]:=CB_E3.ItemIndex;
end;

procedure TMultPageDlg.CB_E4Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[5,4]:=CB_E4.ItemIndex;
end;

procedure TMultPageDlg.CB_E5Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[5,5]:=CB_E5.ItemIndex;
end;

procedure TMultPageDlg.CB_F1Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[6,1]:=CB_F1.ItemIndex;
end;

procedure TMultPageDlg.CB_F2Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[6,2]:=CB_F2.ItemIndex;
end;

procedure TMultPageDlg.CB_F3Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[6,3]:=CB_F3.ItemIndex;
end;

procedure TMultPageDlg.CB_F4Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[6,4]:=CB_F4.ItemIndex;
end;

procedure TMultPageDlg.CB_F5Change(Sender: TObject);
begin
 EfecHuman[Site.ItemIndex+1].ClaseVul[6,5]:=CB_F5.ItemIndex;
end;

procedure TMultPageDlg.FormActivate(Sender: TObject);
var
i,j:integer;
begin
 Site.items.clear;
 for i:=1 to MaxSelSite do
   Site.items.add(SelSite[i].code);
 Site.ItemIndex := indexsite;
 Site.text:= SelSite[indexsite+1].code;
 SiteChange(Sender);
 Site.SetFocus;
end;

procedure TMultPageDlg.OKBtnClick(Sender: TObject);
begin
  close;
end;

procedure TMultPageDlg.HelpBtnClick(Sender: TObject);
begin
Application.HelpJump('Effect_building');
end;

procedure TMultPageDlg.Button1Click(Sender: TObject);
begin
if  Site.ItemIndex<MaxSelSite-1 then
Site.ItemIndex:=Site.ItemIndex + 1 else
Site.ItemIndex:=0;
indexsite:=Site.ItemIndex;
closewin:=true;
close;
end;

end.
