rmfImportFrm.pas 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. unit rmfImportFrm;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls, ExtCtrls;
  6. type
  7. TrmfImportForm = class(TForm)
  8. lePhase: TLabeledEdit;
  9. leStage: TLabeledEdit;
  10. Label1: TLabel;
  11. Label2: TLabel;
  12. btnOk: TButton;
  13. btnCancel: TButton;
  14. procedure btnOkClick(Sender: TObject);
  15. private
  16. { Private declarations }
  17. public
  18. { Public declarations }
  19. end;
  20. function GetMtfImportInfo(var APhase, AStage: Integer): Boolean;
  21. implementation
  22. {$R *.dfm}
  23. function GetMtfImportInfo(var APhase, AStage: Integer): Boolean;
  24. var
  25. vForm: TrmfImportForm;
  26. begin
  27. vForm := TrmfImportForm.Create(nil);
  28. vForm.ClientHeight := 94;
  29. vForm.ClientWidth := 418;
  30. try
  31. Result := vForm.ShowModal = mrOk;
  32. if Result then
  33. begin
  34. APhase := StrToIntDef(vForm.lePhase.Text, -1);
  35. AStage := StrToIntDef(vForm.leStage.Text, -1);
  36. end;
  37. finally
  38. vForm.Free;
  39. end;
  40. end;
  41. procedure TrmfImportForm.btnOkClick(Sender: TObject);
  42. var
  43. iPhase, iStage: Integer;
  44. begin
  45. iPhase := StrToIntDef(lePhase.Text, -1);
  46. iStage := StrToIntDef(leStage.Text, -1);
  47. if (iPhase >= 0) and (iStage >= 0) then
  48. ModalResult := mrOk;
  49. end;
  50. end.