Add support for Windows 7 task button progress. Unify all callers of ProgressBarStatus in a set of 5 functions in main unit instead of helpers, as this is where the progress bar is placed and also we need the handle of the main window.

This commit is contained in:
Ansgar Becker
2011-11-08 22:27:52 +00:00
parent f9e896fede
commit a69041d17d
7 changed files with 139 additions and 46 deletions

View File

@ -537,7 +537,7 @@ begin
FCancelled := False;
FObjectSizesDone := 0;
FObjectSizesDoneExact := 0;
EnableProgressBar(100);
MainForm.EnableProgress(100);
SessionNode := TreeObjects.GetFirstChild(nil);
while Assigned(SessionNode) do begin
DBNode := TreeObjects.GetFirstChild(SessionNode);
@ -607,7 +607,7 @@ begin
btnCloseOrCancel.Caption := 'Close';
btnCloseOrCancel.ModalResult := mrCancel;
Mainform.ProgressBarStatus.Hide;
MainForm.DisableProgress;
tabsTools.Enabled := True;
treeObjects.Enabled := True;
ValidateControls(Sender);
@ -793,7 +793,7 @@ begin
Percent := 100 / Max(FObjectSizes,1) * FObjectSizesDoneExact;
lblCheckedSize.Caption := 'Selected objects size: '+FormatByteNumber(FObjectSizes)+'. '+
FormatNumber(Percent, 1) + '% done.';
Mainform.ProgressBarStatus.Position := Round(Percent);
MainForm.SetProgressPosition(Round(Percent));
Application.ProcessMessages;
end;