ScProgressFrm.pas 864 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. unit ScProgressFrm;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, ComCtrls, StdCtrls;
  6. type
  7. TProgressFrm = class(TForm)
  8. ProgressBar: TProgressBar;
  9. lblMessage: TLabel;
  10. private
  11. { Private declarations }
  12. public
  13. { Public declarations }
  14. end;
  15. procedure ShowFloatProgress(Text: string; Position: Integer);
  16. procedure CloseFloatProgress;
  17. implementation
  18. {$R *.dfm}
  19. var
  20. ProgressFrm: TProgressFrm = nil;
  21. procedure ShowFloatProgress(Text: string; Position: Integer);
  22. begin
  23. if ProgressFrm = nil then
  24. ProgressFrm := TProgressFrm.Create(nil);
  25. ProgressFrm.lblMessage.Caption := Text;
  26. ProgressFrm.ProgressBar.Position := Position;
  27. ProgressFrm.Show;
  28. ProgressFrm.Update;
  29. end;
  30. procedure CloseFloatProgress;
  31. begin
  32. if ProgressFrm <> nil then
  33. FreeAndNil(ProgressFrm);
  34. end;
  35. end.