View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003720 | JEDI VCL | 00 JVCL Components | public | 2006-05-22 10:45 | 2006-06-09 04:07 |
Reporter | ain | Assigned To | obones | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | 3.30 | |||
Summary | 0003720: JvXPProgressBar doesnt work as expected | ||||
Description | When executing code like JvXPProgressBar1.Max:= 10; for x:= JvXPProgressBar1.Min to JvXPProgressBar1.Max do JvXPProgressBar1.StepIt; then in the end of the loop progrss bar is about 2/3 filled. I expect it to be 100%. Or when executing JvXPProgressBar1.Max:= 1000; for x:= JvXPProgressBar1.Min to JvXPProgressBar1.Max do JvXPProgressBar1.StepIt; then the bar shows 100% way before the completion of the loop. | ||||
Tags | No tags attached. | ||||
|
Looking at the code TJvCustomXPProgressBar.DrawBar, seems to be issues around the building of the blocks and integer maths, it works in whole pixels, so you can get n pixels under or over on every block, instead using real numbers or division to decide where to draw the blocks. Not a problem with StepIt per se. I have tested (just for this case) and it works much better procedure TJvBaseProgressBar.Paint; var ASize: Integer; begin if (Max - Min <= 0) or (Width <= 0) or (Height <= 0) then Exit; // calculate the size of the bar based on Min, Max, Position and Width or Height ASize := MulDiv(GetMaxBarSize, (Position - Min), (Max - Min)); if not Smooth then ASize := (ASize div steps) * steps; DrawBar(Canvas, ASize); end; Before there was a line: APos := APos - APos mod Steps; which I can not see doing the job. JAC. |
|
Hmm, in my quick test it doesn't make a difference... just drop JvXPPrpgress bar onto form and: procedure TForm1.Button1Click(Sender: TObject); var x: Integer; begin for x:= JvXPProgressBar2.Min to JvXPProgressBar2.Max do begin JvXPProgressBar2.StepIt; JvXPProgressBar2.Refresh; Sleep(60); end; ShowMessage('Done'); end; I see the progrssbar to show 100% way before message box pops up. If I include JvXPProgressBar2.Steps:= 1; in front of the loop, progress bar stays at 0% |
|
This is now solved in SVN. Note that setting stepping above the max value (when Steps is greater than 1 for instance) will stay at the max value as soon as it reached it. It is the same behaviour that is displayed by TJvGradientProgressBar. |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-05-22 10:45 | ain | New Issue | |
2006-05-23 04:38 | jac2 | Note Added: 0009340 | |
2006-05-23 13:18 | ain | Note Added: 0009345 | |
2006-06-09 04:06 | obones | Status | new => resolved |
2006-06-09 04:06 | obones | Resolution | open => fixed |
2006-06-09 04:06 | obones | Assigned To | => obones |
2006-06-09 04:06 | obones | Note Added: 0009530 |