https://bitbucket.org/anders_melander/better-translation-manager/src/master/Source/amProgress.API.pas
and another, slightly older, version of the same:
https://bitbucket.org/anders_melander/dwscriptstudio/src/master/Source/amProgress.pas
and even a DWScript wrapper (the second & third screenshots are actually from a DWScript):
https://bitbucket.org/anders_melander/dwscriptstudio/src/master/Source/ScriptRTL/amScriptModuleUserInterfaceProgress.pas
Displays a non-modal form with a progress bar, a status message, and an optional cancel button.
Defer the initial display of the progress form (what you call lazy loading). Default delay is 500 mS.
Limit rate of progress update to minimize UI overhead. Default is max 1 update per 100 mS.
Selectively pumps message queue to avoid application freeze and enable user to move/cancel progress dialog during use.
Progressive or marquee mode.
The current implementation uses DevExpress label and button controls but these can just be replaced with regular VCL controls without any loss of functionality.
Usage:
var Progress := ShowProgress('Hello world', False);
Progress.EnableAbort := True;
Progress.Progress(psBegin, 0, 100, 'Charging flux capacitor...');
for var i := 0 to 100 do
begin
Sleep(100);
Progress.AdvanceProgress;
end;
and in Marquee mode:
var Progress := ShowProgress('Hello world', False);
Progress.EnableAbort := True;
Progress.Marquee := True;
Progress.UpdateMessage('Charging flux capacitor...');
while (not Progress.Aborted) do
begin
Sleep(100);
Progress.AdvanceProgress;
end;