eugeneloza / decoherence

Project moved to https://gitlab.com/EugeneLoza/decoherence
GNU General Public License v3.0
10 stars 7 forks source link

Use CastleProgress #575

Open eugeneloza opened 6 years ago

eugeneloza commented 6 years ago

see https://castle-engine.io/apidoc/html/CastleControls.TCastleProgressBar.html and https://castle-engine.io/apidoc/html/CastleProgress.TProgress.html

michaliskambi commented 6 years ago

Note that applications using TCastleWindow should usually not need to deal with TCastleProgressBar class directly. Instead you only use https://castle-engine.io/apidoc/html/CastleWindowProgress.html , and then everything using Progress.Init/Step/Fini (internal CGE stuff as well as your own) will have progress bar rendered.

Direct TCastleProgressBar usage is only necessary in case of TCastleControl... and I would prefer to eliminate it some day :), implementing something like CastleControlProgress that mimics CastleWindowProgress but works on TCastleControl. Or maybe even something like CastleContainerProgress that works on TUIContainer, and thus can be used with both TCastleWindow and TCastleControl.

eugeneloza commented 6 years ago

Sure, I'll route the output to DecoProgressBar :) It's I've just realized that I don't have to reinvent the wheel to monitor progress during the load/generation process.

michaliskambi commented 6 years ago

Ah, OK:)

In that case you can implement your own descendant of TProgressUserInterface , like https://castle-engine.io/apidoc/html/CastleWindowProgress.TWindowProgressInterface.html . This approach allows to use your own progress bar UI with CGE progress reporting:)