unit SinAxis;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,globalvar;

type
  TAxisControl = class(TForm)
    LbSetValue: TLabel;
    EdSetValue: TEdit;
    btnEnter: TButton;
    btnCancel: TButton;
    LbMessage: TLabel;
    Label1: TLabel;
    CbAxisSel: TComboBox;
    procedure EdSetValueExit(Sender: TObject);
    procedure EdSetValueKeyPress(Sender: TObject; var Key: Char);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  AxisControl: TAxisControl;

implementation

{$R *.dfm}

procedure TAxisControl.EdSetValueExit(Sender: TObject);
begin
  if (EdSetValue.Text='') or (StrToInt(EdSetValue.Text)<0)  then
   begin
 	if lang=1 then
       		ShowMessage('输入值错误，重新输入')
       	else
        	ShowMessage('error input，please reinput');
       	EdSetValue.SetFocus();
       	exit;
   end;
end;

procedure TAxisControl.EdSetValueKeyPress(Sender: TObject; var Key: Char);
begin
  if not (key in DigitsSet) then
   begin
       key:=#0;
       exit;
   end;
end;

procedure TAxisControl.FormShow(Sender: TObject);
begin
  if lang=1 then
   begin
      btnEnter.Caption:='确定(&o)';
      btnCancel.Caption:='取消(&c)';
   end
   else begin
      btnEnter.Caption:='Confirm(&o)';
      btnCancel.Caption:='Cancel(&c)';
   end;
end;

end.
