📄 frmpubwaitprogressunt.pas
字号:
{ 有进度条的窗体 }
unit frmPubWaitProgressUnt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TfrmPubWaitProgress = class(TForm)
pbProgress: TProgressBar;
labProgressMsg: TLabel;
antAnimate: TAnimate;
private
{ Private declarations }
public
{ Public declarations }
end;
procedure ShowPubWaitProgressDlg(const ACaption, AProgressText: string;
AMaxPos, AMinPos, APosition: Integer);
procedure ClosePubWaitProgressDlg;
procedure AddWaitProgPosition(AIncPos: Integer);
procedure GotoWaitProgPosition(APosition: Integer);
procedure UpdateWaitProgCaption(const ACaption: string);
procedure UpdateWaitProgProgress(const AProgressText: string);
var
frmPubWaitProgress: TfrmPubWaitProgress;
implementation
{$R *.dfm}
procedure ShowPubWaitProgressDlg(const ACaption, AProgressText: string;
AMaxPos, AMinPos, APosition: Integer);
begin
if frmPubWaitProgress = nil then
frmPubWaitProgress := TfrmPubWaitProgress.Create(Application);
with frmPubWaitProgress do
begin
pbProgress.Max := AMaxPos;
pbProgress.Min := AMinPos;
pbProgress.Position := APosition;
Caption := ACaption;
labProgressMsg.Caption := AProgressText;
antAnimate.Active := True;
Show;
end;
Application.ProcessMessages;
end;
procedure ClosePubWaitProgressDlg;
begin
if frmPubWaitProgress <> nil then
with frmPubWaitProgress do
begin
antAnimate.Active := False;
Free;
frmPubWaitProgress := nil;
end;
end;
procedure AddWaitProgPosition(AIncPos: Integer);
begin
with frmPubWaitProgress do
pbProgress.Position := pbProgress.Position + AIncPos;
Application.ProcessMessages;
end;
procedure GotoWaitProgPosition(APosition: Integer);
begin
with frmPubWaitProgress do
pbProgress.Position := APosition;
Application.ProcessMessages;
end;
procedure UpdateWaitProgCaption(const ACaption: string);
begin
with frmPubWaitProgress do
Caption := ACaption;
Application.ProcessMessages;
end;
procedure UpdateWaitProgProgress(const AProgressText: string);
begin
with frmPubWaitProgress do
labProgressMsg.Caption := AProgressText;
Application.ProcessMessages;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -