[fpc-pascal] Directory Tree

Jean SUZINEAU jean.suzineau at wanadoo.fr
Thu Apr 15 18:20:11 CEST 2021


Le 15/04/2021 à 15:31, James Richters via fpc-pascal a écrit :
>
> How did you make the TVirtualStringTree open the first level?  I've been looking to see how you did it but I don't see how that was done.
unit uFileVirtualTree, line 360,  method 
ThVirtualStringTree.vst_expand_first_level;
> I would like to have the second TVirtualStringTree expanded all the way out.
it's easier, just : vst.FullExpand;
You'll find it line 373, method ThVirtualStringTree.vst_expand_full;

> Is there a way to export the file list and the second TVirtualStringTree to a PDF file?
As far as I know, there is no way to directly export it. I will have a 
look if I have some time.
> I would like to save settings to an INI file, things like window size, divider positions, ect.. I have done this with INI files in my console apps, I just write out every variable I want to save and read them back in.. but I'm curious if Lazarus is more sophisticated.. maybe it has a way to save all settings for a form by itself?  Or do I do it the same way as my console app and save each variable myself?
> Where is the proper place to load the INI file, where it would happen before the forms are displayed, and where is the proper place to save the INI file right before the program is closed?
 From tab "Misc", just drop a TIniPropStorage on your form. You need to 
set the ini filename in the component.
Then in the properties of the form, you'll find the SessionProperties 
property with a "..." button on the right. This opens a dialog which 
allows you to configure which properties of which components you want to 
persist.

I have added this , configured for a "Configuration.ini" file and 
"fFileTree" section.

The following link is for TXMLPropStorage, but it work nearly the same 
for TIniPropStorage. Just read the first paragraph "Using 
TForm.SessionProperties and TXMLPropStorage"
https://wiki.freepascal.org/Remember_form_position_and_size#Using_TForm.SessionProperties_and_TXMLPropStorage
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210415/19c9d816/attachment.htm>


More information about the fpc-pascal mailing list