[fpc-pascal] Directory Tree

Jean SUZINEAU jean.suzineau at wanadoo.fr
Sun Apr 25 20:00:25 CEST 2021


Le 25/04/2021 à 02:54, James Richters via fpc-pascal a écrit :
> RE: [fpc-pascal] Directory Tree
>
> I’ve been trying make “Load from file”happen automatically when the 
> program starts.. I would like it to happen after configuration.ini 
> restores the file name and also after the form is on the screen so I 
> can see the load bargraph.
>
> I tried putting it in Panel1 OnEnter but the form doesn’t have the 
> buttons on it yet when it does the load.. and it is also doing the 
> load when I push a button.. which is not what I want to happen.Any 
> idea how to do the load once automatically after the screen is up so I 
> can see the load progress bar and after all the buttons are on the form?
>
The persistence of configuration is managed by the ips:TIniPropStorage 
component. Digging a bit , I found that TIniPropStorage has an event 
OnRestoreProperties which fired after the configuration is restored 
(Ctrl+Click on TIniPropStorage, then on  OnRestoreProperties, which 
leads you do TCustomPropertyStorage, where you'll find with a search on 
FOnRestoringProperties that FOnRestoringProperties is called in 
procedure TCustomPropertyStorage.Restore after restoring properties).

I added LoadFromFile in this event.

I have extracted the pdf generation to a unit uText_to_PDF with a class 
TText_to_PDF to make a pdf from a string. You can even use it in a 
console app.
3 pdf are generated now: List, Tree, List+Tree.

I added a page break between list and tree in the odt.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210425/045ccd80/attachment-0001.htm>


More information about the fpc-pascal mailing list