Difference between revisions of "TXMLPropStorage"

From Lazarus wiki
Jump to navigationJump to search
m
Line 13: Line 13:
  
 
TINIPropStorage works the same way as TXMLPropStorage, except it stores the session information in an ini-file.
 
TINIPropStorage works the same way as TXMLPropStorage, except it stores the session information in an ini-file.
 +
 +
 +
'''A note on filenames''
 +
TXMLPropStorage has a default handler if you don't set a filename.
 +
Under windows/macos the settings will be saved in the application directory as PROGRAMNAME.xml
 +
 +
Under Unix likes it will be saved in the home directory of the current user as .PROGRAMNAME
 +
 +
It is therefore a very good idea to leave the filename blank for unix programs meant to be run by normal users.

Revision as of 20:28, 12 May 2006

Deutsch (de) English (en) español (es) français (fr) polski (pl) português (pt) русский (ru)

TXMLPropStorage is a component to save/restore selected properties (either TForm or any control on it) Works with TForm.SessionProperties property.

Usage:

  1. Drop a TXMLPropStorage component on form and set filename, for example: session.xml
  2. Open editor window for the SessionProperties property of TForm.
  3. Add here properties of form and/or controls to be stored inside session.xml.
  4. Compile the application.

Your application now will read selected property value from session.xml and apply it on runtime (like Width,Height,Left,Top for TForm)

TINIPropStorage works the same way as TXMLPropStorage, except it stores the session information in an ini-file.


'A note on filenames TXMLPropStorage has a default handler if you don't set a filename. Under windows/macos the settings will be saved in the application directory as PROGRAMNAME.xml

Under Unix likes it will be saved in the home directory of the current user as .PROGRAMNAME

It is therefore a very good idea to leave the filename blank for unix programs meant to be run by normal users.