Sign in Join

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

Mailing lists / lazarus / 2008-03

SessionProperties limited size problem

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Paulo Malheiros

Hello,

I've been using SessionProperties intensely in my applications but a problem showed up when one of my Forms became to big. After restarting the project several properties previously added in SessionProperties disappeared.
I made a little test application and realized that the project is well saved, with all properties present in my "main.lfm" file, but after reopening and closing the project the same SessionProperties appear only with 255 characters.
It appears that while opening the project Lazarus is deleting some of this properties.
Does anyone have a suggestion on how to add more properties?

Best regards,
Paulo Malheiros

Reply by email

Mattias Gaertner
to Paulo Malheiros
Show quoted text 10 lines
Hello, I've been using SessionProperties intensely in my applications but a problem showed up when one of my Forms became to big. After restarting the project several properties previously added in SessionProperties disappeared. I made a little test application and realized that the project is well saved, with all properties present in my "main.lfm" file, but after reopening and closing the project the same SessionProperties appear only with 255 characters.

This works here.

It appears that while opening the project Lazarus is deleting some of this properties. Does anyone have a suggestion on how to add more properties?

Mattias

Reply by email

Paulo Malheiros
to Mattias Gaertner

Hello Mattias,

I made a test Application in Linux - SVN 14419
Added 23 TEdit to Form1 and its SessionProperties

   TForm1 = class(TForm)
     Edit1: TEdit;
     Edit10: TEdit;
     Edit11: TEdit;
     Edit12: TEdit;
     Edit13: TEdit;
     Edit14: TEdit;
     Edit15: TEdit;
     Edit16: TEdit;
     Edit17: TEdit;
     Edit18: TEdit;
     Edit19: TEdit;
     Edit2: TEdit;
     Edit20: TEdit;
     Edit21: TEdit;
     Edit22: TEdit;
     Edit23: TEdit;
     Edit3: TEdit;
     Edit4: TEdit;
     Edit5: TEdit;
     Edit6: TEdit;
     Edit7: TEdit;
     Edit8: TEdit;
     Edit9: TEdit;
     IniPropStorage: TIniPropStorage;
     procedure FormCreate(Sender: TObject);
   private
     { private declarations }
   public
     { public declarations }
   end;

All were saved correctly. Closing Lazarus and checking "unit1.lfm" I got

SessionProperties =
'Edit1.Text;Edit10.Text;Edit11.Text;Edit12.Text;Edit13.Text;Edit14.Text;Edit15.Text;Edit16.Text;Edit17.Text;Edit18.Text;Edit19.Text;Edit2.Text;Edit20.Text;Edit3.Text;Edit4.Text;Edit5.Text;Edit6.Text;Edit7.Text;Edit8.Text;Edit9.Text;Edit21.Text;Edit22.Text;Edit23.Text'

After reopening Lazarus and opening SessionProperties Dialog one property was missing.
After saving and exiting Lazarus reopened "unit1.lfm" I got

SessionProperties =
';Edit1.Text;Edit10.Text;Edit11.Text;Edit12.Text;Edit13.Text;Edit14.Text;Edit15.Text;Edit16.Text;Edit17.Text;Edit18.Text;Edit19.Text;Edit2.Text;Edit20.Text;Edit21.Text;Edit22.Text;Edit3.Text;Edit4.Text;Edit5.Text;Edit6.Text;Edit7.Text;Edit8.Text;Edit9.Text'

Edit23.Text is missing.

Finally, If I change TStringPropertyEditor.GetEditLimit in PropEdits.pp, from 255 to a
bigger value all works fine.

function TStringPropertyEditor.GetEditLimit: Integer;
begin
   if GetPropType^.Kind = tkString then
     Result := GetTypeData(GetPropType)^.MaxLength else
     //Result := 255;
     Result := 1023;
end;

Is it possible to make SessionProperties without limit?

Regards,
Paulo

Quoting Mattias Gaertner :

Show quoted text 27 lines
On Tue, 04 Mar 2008 16:44:25 +0000 Paulo Malheiros wrote: > Hello, > > I've been using SessionProperties intensely in my applications but a > problem showed up when one of my Forms became to big. > After restarting the project several properties previously added in > SessionProperties disappeared. > I made a little test application and realized that the project is > well saved, with all properties present in my "main.lfm" file, but > after reopening and closing the project the same SessionProperties > appear only with 255 characters. This works here. > It appears that while opening the project Lazarus is deleting some > of this properties. > Does anyone have a suggestion on how to add more properties? Mattias _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bogusław Brandys
to Paulo Malheiros
Paulo Malheiros wrote 68 lines
Hello Mattias, I made a test Application in Linux - SVN 14419 Added 23 TEdit to Form1 and its SessionProperties TForm1 = class(TForm) Edit1: TEdit; Edit10: TEdit; Edit11: TEdit; Edit12: TEdit; Edit13: TEdit; Edit14: TEdit; Edit15: TEdit; Edit16: TEdit; Edit17: TEdit; Edit18: TEdit; Edit19: TEdit; Edit2: TEdit; Edit20: TEdit; Edit21: TEdit; Edit22: TEdit; Edit23: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit; Edit7: TEdit; Edit8: TEdit; Edit9: TEdit; IniPropStorage: TIniPropStorage; procedure FormCreate(Sender: TObject); private { private declarations } public { public declarations } end; All were saved correctly. Closing Lazarus and checking "unit1.lfm" I got SessionProperties = 'Edit1.Text;Edit10.Text;Edit11.Text;Edit12.Text;Edit13.Text;Edit14.Text;Edit15.Text;Edit16.Text;Edit17.Text;Edit18.Text;Edit19.Text;Edit2.Text;Edit20.Text;Edit3.Text;Edit4.Text;Edit5.Text;Edit6.Text;Edit7.Text;Edit8.Text;Edit9.Text;Edit21.Text;Edit22.Text;Edit23.Text' After reopening Lazarus and opening SessionProperties Dialog one property was missing. After saving and exiting Lazarus reopened "unit1.lfm" I got SessionProperties = ';Edit1.Text;Edit10.Text;Edit11.Text;Edit12.Text;Edit13.Text;Edit14.Text;Edit15.Text;Edit16.Text;Edit17.Text;Edit18.Text;Edit19.Text;Edit2.Text;Edit20.Text;Edit21.Text;Edit22.Text;Edit3.Text;Edit4.Text;Edit5.Text;Edit6.Text;Edit7.Text;Edit8.Text;Edit9.Text' Edit23.Text is missing. Finally, If I change TStringPropertyEditor.GetEditLimit in PropEdits.pp, from 255 to a bigger value all works fine. function TStringPropertyEditor.GetEditLimit: Integer; begin if GetPropType^.Kind = tkString then Result := GetTypeData(GetPropType)^.MaxLength else //Result := 255; Result := 1023; end; Is it possible to make SessionProperties without limit? Regards, Paulo

I think you should fill a bugreport. Apparently additional property to set this limit is needed.

Regards
Boguslaw

Reply by email

Mattias Gärtner
to Bogusław Brandys

Zitat von Bogus??aw Brandys :

Show quoted text 5 lines
[...] > Is it possible to make SessionProperties without limit? [...] I think you should fill a bugreport. Apparently additional property to set this limit is needed.

If you are talking about a user option:
Think about someone with a big limit gives the sources to someone with a lower limit.

If you are talking about SessionProperties:
GetEditLimit is a virtual property. So it would be possible to extend the limit for only this property.
But IMO the small edit box in the OI is only for 'short' string values. If you want to edit longer properties the property editor should provide a better editor. And it already does. Of course you are welcome to improve the editor.

Mattias

Reply by email