Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-08

StringGrid.LoadFromFile not loading col and row sizes

10 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jürgen Hestermann

When I store a StringGrid with

StringGrid1.SaveOptions := [soDesign,soPosition,soAttributes,soContent];
StringGrid1.SaveToFile(filename);

and reload it later with LoadFromFile() it does not reload the column widths and row heigths. I can see that they are stored in the XML file but are ignored on loading. Am I doing something wrong?

Reply by email

Salvatore Coppola
to Jürgen Hestermann

2012/8/13 J?rgen Hestermann :

Show quoted text 10 lines
When I store a StringGrid with StringGrid1.SaveOptions := [soDesign,soPosition,soAttributes,soContent]; StringGrid1.SaveToFile(filename); and reload it later with LoadFromFile() it does not reload the column widths and row heigths. I can see that they are stored in the XML file but are ignored on loading. Am I doing something wrong?

Are you setting
StringGrid1.SaveOptions := [soDesign,soPosition,soAttributes,soContent]; before
LoadFromFile() ?
Salvatore

Show quoted text 5 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Jürgen Hestermann
to Salvatore Coppola
Salvatore Coppola wrote 11 lines
2012/8/13 J?rgen Hestermann : > When I store a StringGrid with > StringGrid1.SaveOptions := [soDesign,soPosition,soAttributes,soContent]; > StringGrid1.SaveToFile(filename); > and reload it later with LoadFromFile() it does not reload the column widths > and row heigths. > I can see that they are stored in the XML file but are ignored on loading. > Am I doing something wrong? Are you setting StringGrid1.SaveOptions := [soDesign,soPosition,soAttributes,soContent]; before LoadFromFile() ?

Well, I was under the impression that the SaveOptions are for saving only (therefore the name) so I use these settings before *saving*. But there are no LoadOptions as far as I know. Therefore I didn't set it again before loading.

But now that you wrote it I tried it and yes, this seems to change it! Totaly illogical but works.
Thanks for this information.

I even added a bug report ( http://bugs.freepascal.org/view.php?id=22640 ) which can be closed now (can I close it myself somehow?).

Reply by email

Reinier Olislagers
to Jürgen Hestermann
J?rgen Hestermann wrote
Am 2012-08-16 11:22, schrieb Salvatore Coppola: > 2012/8/13 J?rgen Hestermann :

<snip>

> StringGrid1.SaveOptions := [soDesign,soPosition,soAttributes,soContent]; > before LoadFromFile() ?

<snip>

Show quoted text 6 lines
But now that you wrote it I tried it and yes, this seems to change it! Totaly illogical but works. Thanks for this information. I even added a bug report ( http://bugs.freepascal.org/view.php?id=22640 ) which can be closed now (can I close it myself somehow?).

IMO this non-obvious behaviour needs to at least be documented. Added a documentation patch to the issue; please apply if ok.

Reply by email

Reinier Olislagers
to Jürgen Hestermann
J?rgen Hestermann wrote 6 lines
Am 2012-08-16 12:27, schrieb Reinier Olislagers: > IMO this non-obvious behaviour needs to at least be documented. Added > a documentation patch to the issue; please apply if ok. -- You mean you already changed it on http://wiki.freepascal.org/Grids_Reference_Page ?

No, I updated the Lazarus XML documentation files (that end up in LCL.CHM=>F1 offline help). See the bugtracker issue for the patch.

Yes, that explains it unambiguously now. Thanks a lot.

Thanks to whoever did that ;)

Reply by email

Reinier Olislagers
to Jürgen Hestermann: You mean you already changed it on http://wiki.freepascal.org/Grids_Reference_Page ? Yes,…
J?rgen Hestermann wrote 7 lines
Am 2012-08-16 12:27, schrieb Reinier Olislagers: > IMO this non-obvious behaviour needs to at least be documented. Added > a documentation patch to the issue; please apply if ok. -- You mean you already changed it on http://wiki.freepascal.org/Grids_Reference_Page ? Yes, that explains it unambiguously now.

Ehm, last edit:
20:27, 14 July 2012? JuhaManninen (Talk | contribs)? (56,197 bytes) (?Sorting Columns or Rows)

... so it was there all along ;)

Reply by email

Sven Barth
to Jürgen Hestermann
"J?rgen Hestermann" wrote
Am 2012-08-16 12:49, schrieb Reinier Olislagers: > Ehm, last edit: 20:27, 14 July 2012? JuhaManninen (Talk | contribs)?

(56,197 bytes) (?Sorting Columns or Rows) ... so it was there all along ;)

> > > Hmm. Strange. I though I had extensively looked at everything I found about StringGrids. > But could be that I only looked at the german translation at http://wiki.freepascal.org/Grids_Reference_Page/de > which is not very clear about it. Maybe this is a good reason to mainly use the English wiki which is better maintained. ;) Regards, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120817/aa41da2c/attachment.html>

Reply by email

Jürgen Hestermann
to Sven Barth
Sven Barth wrote 7 lines
> Hmm. Strange. I though I had extensively looked at everything I found about StringGrids. > But could be that I only looked at the german translation at http://wiki.freepascal.org/Grids_Reference_Page/de > which is not very clear about it. Maybe this is a good reason to mainly use the English wiki which is better maintained. ;)

Yes, in general that's what I try too. But when searching in Google I sometimes find hits for german translations before the english ones and sometimes don't know that an english version exists. I just read without paying much attention to where the link is from. Maybe the german translation should be removed. I can't think of anybody using Lazarus not beeing able to read the english documentation.

Reply by email