unit fkeydlg;

{$IFDEF FPC}
  {$MODE DELPHI}{$H+}
{$ENDIF}
(***************************************)
(* Copyright (C) 2003, SHIRAISHI Kazuo *)
(***************************************)


interface

uses
    SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    StdCtrls, ExtCtrls , LResources, Buttons,Menus;

type

  { TFkeysDlg }

  TFkeysDlg = class(TForm)
    OKBtn: TButton;
    CancelBtn: TButton;
    HelpBtn: TButton;
    Bevel1: TBevel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Step: TRadioGroup;
    Run: TRadioGroup;
    procedure HelpBtnClick(Sender: TObject);
  private
    { Private 宣言 }
  public
    procedure execute;
  end;

var
  FkeysDlg: TFkeysDlg;

implementation
uses
     base0,MainFrm,htmlhelp;
 {$R *.lfm}

procedure TFkeysDlg.HelpBtnClick(Sender: TObject);
begin
  OpenHelp(HelpContext);
  //Application.HelpContext(HelpContext);
end;


procedure TFkeysDlg.execute;
begin
  Edit1.Text:=Shift_F5;
  Edit2.Text:=Shift_F6;
  Edit3.Text:=Shift_F7;
  Edit4.Text:=Shift_F8;
  Run.ItemIndex:=(FrameForm.Run2.ShortCut)-119 ;
  Step.ItemIndex:=byte(FrameForm.Step1.ShortCut=121);
  if Step.ItemIndex=0 then
     Edit4.Enabled:=false;
    
  If ShowModal=mrOk then
     begin
        Shift_F5:=Edit1.Text;
        Shift_F6:=Edit2.Text;
        Shift_F7:=Edit3.Text;
        Shift_F8:=Edit4.Text;

        FrameForm.Run2.ShortCut:=Run.ItemIndex + 119 ;
        
        case Step.itemIndex of
          0:begin
              FrameForm.Step1.ShortCut:=ShortCut(119, [ssShift]);
              Shift_F8:='';
            end;
          1:begin
              FrameForm.Step1.ShortCut:=121;
              Edit4.Enabled:=true;
            end;
        end;
     end;
end;

initialization


end.
