バーが既に pbsPaused に設定されており、SmoothReverse が true であるため、既知のアニメーションの問題ではないことはわかっています。バーは、ftp 経由でファイルを送信する関数によって呼び出されます。次のようになります。
function sendLists(FTP: TIdftp; cBox: TComboBox): Boolean; Overload; // this sends ALL lists from combobox to ftp server
var
i, k: Integer;
idList, resList, filesList: TStringList;
begin
Result:=TRUE;
resList:=TStringList.Create;
filesList:=TStringList.Create;
progress.fmBar.Init(filesList, 0, filesList.Count, 1);// this initiates the bar (files, min, max, step)
for i := 0 to cBox.Items.Count-1 do //comboBox has 4 items in
begin
for k := 0 to idList.Count-1 do
begin
if (something is true) then
resList.Add(idList[k]);
end;
resList.SaveToFile('temp.dat');
resList.Clear;
progress.fmBar.StepBar;//this should be called 4 times
FTP.Put('temp.dat', cBox.Items[i]+'-List.dat'); //the 4 files are sent successfully so that confirms 4 passes are being done.
end;
resList.Free;
filesList.Free;
FTP.Disconnect;
end;
StepBar は次のようになります。
procedure Tfmbar.StepBar;
begin
pbMain.StepIt;
if pbMain.Position=pbMain.Max then btOk.Enabled:=TRUE;
pbMain.Update;
fmBar.Update;
end;
ラベルは正しく 100% を示しています。テストしたところ、pbMain.Position と pbMain.Max の両方が 4 を示しています。この場合、送信するファイルの数です。この同じ関数を別のタスクで使用したところ、完全に更新されました。多分私は何かを逃していますか?