Hello,
I am using TAdvCircularProgress but there is something I can't understand.
I drop the component on a form, rename it in "Progress1" and then I implement the OnClick method of a button:
procedure TForm1.btn1Click(Sender: TObject);
var
tot,perc:integer;
i:integer;
begin
tot:=100;
for i := 1 to 100 do begin
perc:=i*100 div tot;
Progress1.Position:=perc;
progress1.Refresh;
end;
end;
Progress.Position is not updated 100 times as I may think.
The first pass perc=1 but Progress1.Position=0, why is it ?
the second pass perc=2 and Progress1.Position=2,
the third pass perc=3 but Progress1.Position=2, why is it @
the forth pass perc=4 and Progress1.Position=2 and so on.
Am I using the component in a wrong way ? How can I make sure Progress1.Position is updated every time ?
Many thanks
Alberto
I have tested this here with the latest version of the component but can't see any issue.
Test code for a default TAdvCircularProgress:
Hello Bruno,
You are right if you use TAdvCircularProgress. But if you use TAdvSmoothCircularProgress I have different results (sorry the example I gave you was a bad one).
if you use the example below and you use TAdvSmoothCircularProgress you will see a few numbers in the property position are skipped.
var
tot,perc:integer;
i:integer;
begin
tot:=100;
for i := 1 to 100 do
begin
perc:=i*100 div tot;
advcircularProgress1.Position:=perc;
advcircularprogress1.Refresh;
listbox1.Items.Add(inttostr(perc)+':'+floattostr(AdvCircularProgress1.Position));
end;
caption := floattostr(advcircularProgress1.Position);
end;
Am I doing anything wrong ?
Many thanks
Alberto
Where in your original post would I have had to decipher you use TAdvSmoothCircularProgress?
Hi Bruno,
You are right, nowhere was written the example was referring to TAdvSmoothCircularProgress. I apologised for my mistake when I said "sorry the example I gave you was a bad one" in the previous message.
I made a few tests, I changed the component type but not the name in the source and this is why the misleading example came out.
Again, apologises for my mistake.
Alberto
TAdvSmoothCircularProgress uses animation to move to a new position. Hence, if you immediately read back the new position, it might not yet have reached the full new value.If you put some delay between the assignment of the position and reading back the position, the final value will have been reached.
I understand. Thank you for the answer.