unit uEnqueueTopX;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, MServClients;

type
  TFormEnqueueTopX = class(TForm)
    EditTopX: TLabeledEdit;
    BtnOK: TBitBtn;
    BtnCancel: TBitBtn;
    procedure FormShow(Sender: TObject);
    procedure EditTopXExit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

    procedure Execute();
  end;

var
  FormEnqueueTopX: TFormEnqueueTopX;

implementation

{$R *.dfm}

procedure TFormEnqueueTopX.FormShow(Sender: TObject);
begin
  EditTopX.SetFocus();
end;

procedure TFormEnqueueTopX.EditTopXExit(Sender: TObject);
begin
  try
    StrToInt(EditTopX.Text);
  except
    EditTopX.Text:=IntToStr(20);
  end;
end;

procedure TFormEnqueueTopX.Execute();
begin
  try
    if ShowModal=mrOK then
      MServClient.EnqueueTopX(StrToInt(EditTopX.Text));
  except
    on E:Exception do raise Exception.Create('TFormEnqueueTopX.Execute: '+E.Message);
  end;
end;

end.
