Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
14
Добавлен:
26.05.2018
Размер:
4.6 Кб
Скачать
unit Main;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, Data.DB, Data.Win.ADODB, HTMLHelpViewer,
Vcl.Imaging.jpeg;

type
TFMain = class(TForm)
BBIns: TBitBtn;
BBTest: TBitBtn;
BBExit: TBitBtn;
IPsi: TImage;
LName: TLabel;
ICub: TImage;
LProgr: TLabel;
LNameProgr: TLabel;
BBRes: TBitBtn;
BHi: TBevel;
BLo: TBevel;
ADOQTest: TADOQuery;
LPsyholog: TLabel;
LNamePsyholog: TLabel;
procedure BBInsClick(Sender: TObject);
procedure BBTestClick(Sender: TObject);
procedure BBResClick(Sender: TObject);
procedure BBExitClick(Sender: TObject);
procedure FormActivate(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;

var
FMain: TFMain;


implementation

uses Ins, Result1, Variable, Filippse_Half, Kogan;

{$R *.dfm}

procedure TFMain.BBInsClick(Sender: TObject);
begin
// вывести инструкцию
FIns.ShowModal;

end;

procedure TFMain.BBTestClick(Sender: TObject);
begin
// провести тестирование
if TestId=1 then
begin
with FTest do
begin
TimerAll.Enabled := true;
ShowModal;
TimerAll.Enabled := false;
end;
end;
if testid=2 then
begin
FTestKog.ShowModal;
end;

end;



procedure TFMain.BBResClick(Sender: TObject);
begin
// вывести результаты тестирования
FResult1.ShowModal;
end;

procedure TFMain.FormActivate(Sender: TObject);
begin
if TestId=1 then
begin
with ADOQTest do
begin
SQL.Clear;
SQL.Add('SELECT * FROM Test WHERE Code=''2020200''');
Active := TRUE;
LName.Caption := FieldByName('NameTest').AsString;
LNameProgr.Caption := FieldByName('Developer').AsString;
LNamePsyholog.Caption := FieldByName('Psycologist').AsString;
ID_Test := StrToInt(FieldByName('ID_Test').AsString);

end;
end;
if TestId=2 then
begin
with ADOQTest do
begin
SQL.Clear;
SQL.Add('SELECT * FROM Test WHERE Code=''2030300''');
Active := TRUE;
LName.Caption := FieldByName('NameTest').AsString;
LNameProgr.Caption := FieldByName('Developer').AsString;
LNamePsyholog.Caption := FieldByName('Psycologist').AsString;
ID_Test := StrToInt(FieldByName('ID_Test').AsString);
end;

end;
SetBounds( Left - ClientOrigin.X, Top - ClientOrigin.Y, GetDeviceCaps(
Canvas.handle, HORZRES ) + (Width - ClientWidth), GetDeviceCaps( Canvas.handle,VERTRES )
+ (Height - ClientHeight ));

BBIns.Left := (FMain.Width div 4) - (BBIns.Width div 2);
BBTest.Left := 2 * (FMain.Width div 4) - (BBTest.Width div 2);
BBRes.Left := 2 * (FMain.Width div 4) - (BBRes.Width div 2);
BBExit.Left := 3 * (FMain.Width div 4) - (BBExit.Width div 2);
BBIns.Top := FMain.Height - ((FMain.Height div 5) - (BBIns.Height div 2));
BBTest.Top := FMain.Height - ((FMain.Height div 5) - (BBTest.Height div 2));
BBRes.Top := FMain.Height - ((FMain.Height div 5) - (BBRes.Height div 2));
BBExit.Top := FMain.Height - ((FMain.Height div 5) - (BBExit.Height div 2));

IPsi.Left := (FMain.Width div 4) - (IPsi.Width div 2);
ICub.Left := 3*(FMain.Width div 4) - (ICub.Width div 2);
IPsi.Top := FMain.Height - 3*(FMain.Height div 5) - (IPsi.Height div 2);
ICub.Top := FMain.Height - 3*(FMain.Height div 5) - (ICub.Height div 2);

BHi.Top := IPsi.Top - 20;
BHi.Height := IPsi.Height + 40;
BHi.Left := IPsi.Left - 20;
BHi.Width := (ICub.Left - IPsi.Left) + ICub.Width + 40;

LName.Width := (FMain.Width div 2) - IPsi.Width - ICub.Width;
LName.Left := 2*(FMain.Width div 4) - (LName.Width div 2);
LName.Top := BHi.Top + (BHi.Height div 2) - (LName.Height div 2);

BLo.Top := LName.Top;
BLo.Left := LName.Left;
BLo.Height := LName.Height;
BLo.Width := LName.Width;

LProgr.Left := 3 * (FMain.Width div 4) - (LProgr.Width div 2);
LNameProgr.Left := 3 * (FMain.Width div 4) - ((LProgr.Width div 2) - 10 - LProgr.Width);
LProgr.Top := FMain.Height - ((FMain.Height div 5) - (BBExit.Height div 2)) + 2 * LProgr.Height;
LNameProgr.Top := FMain.Height - ((FMain.Height div 5) - (BBExit.Height div 2)) + 2 * LProgr.Height;

LPsyholog.Left := LProgr.Left;
LNamePsyholog.Left := LNameProgr.Left;
LPsyholog.Top := LProgr.Top + LProgr.Height + 10;
LNamePsyholog.Top := LPsyholog.Top;

end;

procedure TFMain.BBExitClick(Sender: TObject);
begin
// завершить работу с программой
Close;
end;

end.
Соседние файлы в папке Курсовая ( Мюнсберга и Когана )
  • #
    26.05.2018127.26 Кб14Kogan.dcu
  • #
    26.05.20184.07 Mб14Kogan.dfm
  • #
    26.05.201881.48 Кб14Kogan.pas
  • #
    26.05.201812.25 Кб14Main.dcu
  • #
    26.05.2018238.62 Кб14Main.dfm
  • #
    26.05.20184.6 Кб14Main.pas
  • #
    26.05.20189.12 Кб14Result1.dcu
  • #
    26.05.20189.94 Кб14Result1.dfm
  • #
    26.05.20182.55 Кб14Result1.pas
  • #
    26.05.20182.52 Кб14Test.dpr
  • #
    26.05.201810.75 Кб14Test.dproj