Skip to content

Commit

Permalink
Merge pull request #7 from kalwados/patch-1
Browse files Browse the repository at this point in the history
Update NativeProgressForm.pas
  • Loading branch information
landrix authored Mar 21, 2022
2 parents 7791110 + 41ea9b6 commit 3ecaaa2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,17 @@ procedure TNativeProgressForm.SetMaxFiles(const Value: Integer);
// WriteLn(Form.Components[I].Name + ': ' + Form.Components[I].ClassName);

pnErrors := Form.FindComponent('pnErrors') as TControl;
// In Delphi 11.1 the ProgressBar must be placed below the "Hints" panel:
{$IF declared(RTLVersion111)}{$IF RTLVersion111}
pnErrors := Form.FindComponent('pnHints') as TControl;
{$IFEND}{$IFEND}
TotalLines := GetLabel('TotalLines');
if (pnErrors is TPanel) and (TotalLines <> nil) then
begin
X := Form.ScreenToClient(pnErrors.ClientToScreen(Point(0, 0))).X;
Y := Form.ScreenToClient(TotalLines.ClientToScreen(Point(TotalLines.Top, 0))).Y;
FProgressBar.SetBounds(X, Y + 2, pnErrors.Width, 7);
FProgressBar.ScaleForPPI(Form.CurrentPPI);
FProgressBar.SetBounds(X, Y + 2, pnErrors.Width, TotalLines.Height div 2);
end
else // Fallback
FProgressBar.SetBounds(384, 187 + 2, 162, 7);
Expand Down

0 comments on commit 3ecaaa2

Please sign in to comment.