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.


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to