unit Ledlp_1e;

interface

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

type
  TWWRMarginForm = class(TForm)
    WWRMarginLabel: TLabel;
    WWRMarginEdit: TEdit;
    WWRMarginOKButton: TButton;
    WWRMarginCancelButton: TButton;
    procedure WWRMarginOKButtonClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  WWRMarginForm: TWWRMarginForm;

implementation

uses LEdlp_1a;

{$R *.DFM}

procedure TWWRMarginForm.WWRMarginOKButtonClick(Sender: TObject);
begin
  if StrToInt(WWRMarginEdit.Text) > High(Word) then
  begin
    LEditForm.WWRMargin := High(Word);
    WWRMarginEdit.Text := IntToStr(High(Word));
  end
  else if StrToInt(WWRMarginEdit.Text) < 0 then
  begin
    LEditForm.WWRMargin := 0;
    WWRMarginEdit.Text := '0';
  end
  else
    LEditForm.WWRMargin := StrToInt(WWRMarginEdit.Text);
end;

procedure TWWRMarginForm.FormShow(Sender: TObject);
begin
  WWRMarginEdit.SetFocus;
end;

end.
