unit Unit4;

interface

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

type
  TForm4 = class(TForm)
    sPanel1: TsPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    BitBtn5: TBitBtn;
    procedure FileCaption(b:Byte);
    procedure Webput(b:Byte);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn5Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormResize(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

uses Unit1, Unit9, Unit10, Datam, Unit6, Unit3, Unit2, Unit12;

{$R *.dfm}

procedure TForm4.BitBtn1Click(Sender: TObject);
begin
FileCaption(1);
Form1.Caption:='Теориялык болім';
Form1.ShowModal;
end;

procedure TForm4.BitBtn3Click(Sender: TObject);
begin
WinExec('Тест\Test.exe', SW_SHOW);
//Form12.Show;
end;

procedure TForm4.BitBtn5Click(Sender: TObject);
begin
//FileCaption(3);
//Form1.Caption:='Косымша';
Form10.ShowModal;

end;

procedure TForm4.BitBtn2Click(Sender: TObject);
begin
//FileCaption(2);
//Form1.Caption:='Озындык жумыс';
Form9.ShowModal;
end;


procedure TForm4.FileCaption(b:Byte);
begin
case b of
1: with DataModule2.ADOQuery1, Form1.DTADOTree2.DBTreeFields do
 begin
  DisableControls;
  Form1.DTADOTree2.DataSource:=DataModule2.DataSource1;
  ListFieldName:='Name';
  KeyFieldName:='Key';
  ParentFieldName:='Parent';
  HasChildrenFieldName:='HasChildren';
  EnableControls;
  Form1.sPanel2.Caption:='Лекции';
  DataModule2.ADOQuery1.Active:=True;
  First;
  Webput(1);
  Lek:=True;
  Primer:=False;
  lab:=False;
//  Glosari:=False;
 end;

2: with DataModule2.ADOQuery2, Form1.DTADOTree2.DBTreeFields do
 begin
  DisableControls;
  Form1.DTADOTree2.DataSource:=DataModule2.DataSource2;
  ListFieldName:='Name';
  KeyFieldName:='Key';
  ParentFieldName:='Parent';
  HasChildrenFieldName:='HasChildren';
  EnableControls;
  Form1.sPanel2.Caption:='Лабораторные';
  DataModule2.ADOQuery2.Active:=True;
  First;
  Webput(2);
  Lek:=False;
  Primer:=False;
  lab:=True;
 end;
3: with DataModule2.ADOQuery3, Form1.DTADOTree2.DBTreeFields do
 begin
  s:=ExtractFilePath(Application.ExeName);
  Form1.WebBrowser1.Navigate(s+'html\Глоссарий.htm');
  Lek:=False;
  lab:=False;
 end;
4:begin
  s:=ExtractFilePath(Application.ExeName);
  Form1.WebBrowser1.Navigate(s+'html\Перечень вопросов к экзамену.htm');
end;
5:begin
  s:=ExtractFilePath(Application.ExeName);
  Form1.WebBrowser1.Navigate(s+'html\Список  литературы .htm');
end;
end;
end;

procedure TForm4.Webput(b:Byte);
var
lek_s:String;
lab_s:String;
begin
case b of
1 : if DataModule2.ADOQuery1.FieldByName('put').AsString<>'' then
 begin
  lek_s:=ExtractFilePath(Application.ExeName);
  Form1.WebBrowser1.Navigate(lek_s+'html\'+DataModule2.ADOQuery1.FieldValues['Put']+'.htm');
 end;
2 :  if DataModule2.ADOQuery2.FieldByName('put').AsString<>'' then
 begin
  lab_s:=ExtractFilePath(Application.ExeName);
  Form1.WebBrowser1.Navigate(lab_s+'html\'+DataModule2.ADOQuery2.FieldValues['Put']+'.htm');
 end;
end;
end;


procedure TForm4.FormActivate(Sender: TObject);
begin
Form3.Visible:=False;
Form2.Visible:=False;
AddUser.Visible:=False;
end;

procedure TForm4.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Form2.Visible:=True;
Form3.Visible:=True;
end;

procedure TForm4.FormResize(Sender: TObject);
begin
Height:=257;
Width:=313;
end;

end.
