unit U_JTView;

interface

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

type
  TfrmJTView = class(TForm)
    Panel1: TPanel;
    SpeedButton21: TSpeedButton;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    SpeedButton4: TSpeedButton;
    Panel2: TPanel;
    SpeedButton5: TSpeedButton;
    SpeedButton6: TSpeedButton;
    SpeedButton7: TSpeedButton;
    SpeedButton8: TSpeedButton;
    SpeedButton9: TSpeedButton;
    SpeedButton10: TSpeedButton;
    SpeedButton11: TSpeedButton;
    SpeedButton12: TSpeedButton;
    SpeedButton13: TSpeedButton;
    SpeedButton14: TSpeedButton;
    SpeedButton15: TSpeedButton;
    SpeedButton16: TSpeedButton;
    SpeedButton17: TSpeedButton;
    SpeedButton18: TSpeedButton;
    SpeedButton19: TSpeedButton;
    SpeedButton20: TSpeedButton;
    SpeedButton22: TSpeedButton;
    SpeedButton23: TSpeedButton;
    SpeedButton24: TSpeedButton;
    SpeedButton25: TSpeedButton;
    SpeedButton26: TSpeedButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure SpeedButton21Click(Sender: TObject);
    procedure SpeedButton5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    JTInfo:string;
  end;

var
  frmJTView: TfrmJTView;

implementation

{$R *.dfm}

procedure TfrmJTView.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action:=caFree;
end;

procedure TfrmJTView.SpeedButton21Click(Sender: TObject);
var
  i,j:Integer;
  JTStr:string;
begin
  j:=StrToInt(TSpeedButton(Sender).Hint);
  with Panel2 do
  begin
    for i:=0 to 19 do
    begin
      JTStr:=IntToStr(j*20+i+1);
      if Length(JTStr)=1 then
      begin
        JTStr:='00'+JTStr;
      end else
      if Length(JTStr)=2 then
      begin
        JTStr:='0'+JTStr;
      end;
      if Controls[i] is TSpeedButton then
      begin
        TSpeedButton(Controls[i]).Caption:=JTStr;
      end;
    end;
  end;

end;

procedure TfrmJTView.SpeedButton5Click(Sender: TObject);
begin
  JTInfo:=TSpeedButton(Sender).Caption;
  ModalResult:=1;
end;

end.
