unit Ledlp_1f;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;

type
  TCaretWidthForm = class(TForm)
    CaretWidthLabel: TLabel;
    CaretWidthEdit: TEdit;
    CaretWidthOKButton: TButton;
    CaretWidthCancelButton: TButton;
    procedure CaretWidthOKButtonClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  CaretWidthForm: TCaretWidthForm;

implementation

uses LEdlp_1a;

{$R *.DFM}

procedure TCaretWidthForm.CaretWidthOKButtonClick(Sender: TObject);
begin
  if StrToInt(CaretWidthEdit.Text) > High(Word) then
  begin
    LEditForm.FCaretWidth := High(Word);
    CaretWidthEdit.Text := IntToStr(High(Word));
  end
  else if StrToInt(CaretWidthEdit.Text) < 0 then
  begin
    LEditForm.FCaretWidth := 0;
    CaretWidthEdit.Text := '0';
  end
  else
    LEditForm.FCaretWidth := StrToInt(CaretWidthEdit.Text);
end;

procedure TCaretWidthForm.FormShow(Sender: TObject);
begin
  CaretWidthEdit.SetFocus;
end;

end.
