unit _frmAddEditPreset;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, dxSkinsCore, dxSkinOffice2019Colorful,
  cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, Vcl.Menus, Vcl.StdCtrls,
  cxButtons, cxControls, cxContainer, cxEdit, cxMemo, cxTextEdit, Vcl.ExtCtrls;

type
  TfrmAddEditPreset = class(TForm)
    cxButton1: TcxButton;
    cxButton2: TcxButton;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    edtPresetName: TcxTextEdit;
    edtCategory: TcxTextEdit;
    Label3: TLabel;
    procedure cxButton1Click(Sender: TObject);
    procedure cxButton2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  frmAddEditPreset: TfrmAddEditPreset;

implementation

{$R *.dfm}

procedure TfrmAddEditPreset.cxButton1Click(Sender: TObject);
begin
  ModalResult := mrOk;
end;

procedure TfrmAddEditPreset.cxButton2Click(Sender: TObject);
begin
  ModalResult := mrCancel;
  Close;
end;

procedure TfrmAddEditPreset.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #27 then
  begin
    Key := #0;
    Close;
  end;
end;

procedure TfrmAddEditPreset.FormShow(Sender: TObject);
begin
  edtPresetName.SetFocus;
end;

end.
