unit Ledlp_1d;

interface

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

type
  TWWWidthForm = class(TForm)
    WordWrapWidthLabel: TLabel;
    WWWidthEdit: TEdit;
    WWWidthOKButton: TButton;
    WWWidthCancelButton: TButton;
    procedure WWWidthOKButtonClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  WWWidthForm: TWWWidthForm;

implementation

uses LEdlp_1a;

{$R *.DFM}

procedure TWWWidthForm.WWWidthOKButtonClick(Sender: TObject);
begin
  if StrToInt(WWWidthEdit.Text) > High(Word) then
  begin
    LEditForm.WWWidth := High(Word);
    WWWidthEdit.Text := IntToStr(High(Word));
  end
  else if StrToInt(WWWidthEdit.Text) < 0 then
  begin
    LEditForm.WWWidth := 0;
    WWWidthEdit.Text := '0';
  end
  else
    LEditForm.WWWidth := StrToInt(WWWidthEdit.Text);
end;

procedure TWWWidthForm.FormShow(Sender: TObject);
begin
  WWWidthEdit.SetFocus;
end;

end.
