Difference between revisions of "TXMLPropStorage"
Silentcoder (talk | contribs) m |
|||
Line 1: | Line 1: | ||
{{TXMLPropStorage}} | {{TXMLPropStorage}} | ||
− | + | == Introduction == | |
− | |||
− | Usage | + | TXMLPropStorage is a component to save and restore selected properties (either TForm or any control on it). It's work with TForm.[[doc:lcl/forms/tform.sessionproperties.html|SessionProperties]] property. It's available on '''Misc''' tab of component palette. |
− | # Drop a [[doc:lcl/xmlpropstorage/txmlpropstorage.html|TXMLPropStorage]] component on form and set filename, for example: session.xml | + | |
− | # | + | == Usage == |
− | # Add here properties of form and/or controls to be stored inside session.xml. | + | # Drop a [[doc:lcl/xmlpropstorage/txmlpropstorage.html|TXMLPropStorage]] component on form and set filename property, for example: session.xml |
+ | # Select form, go to Object Inspector and open editor window for the [[doc:lcl/forms/tform.sessionproperties.html|SessionProperties]] property of TForm. | ||
+ | # Add here properties of form and/or controls to be stored inside session.xml (example: width;height). | ||
# Compile the application. | # 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) | + | Your application now will read selected property value from session.xml and apply it on runtime (like Width, Height, Left, Top for TForm). |
− | |||
− | |||
+ | TINIPropStorage component works the same way as TXMLPropStorage, except it stores the session information in an [http://lazarus-ccr.sourceforge.net/docs/fcl/inifiles/index.html IniFile]. | ||
− | + | == Notes == | |
TXMLPropStorage has a default handler if you don't set a filename. | TXMLPropStorage has a default handler if you don't set a filename. | ||
− | Under | + | 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 | 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. | 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:18, 9 March 2008
│
Deutsch (de) │
English (en) │
español (es) │
français (fr) │
polski (pl) │
português (pt) │
русский (ru) │
Introduction
TXMLPropStorage is a component to save and restore selected properties (either TForm or any control on it). It's work with TForm.SessionProperties property. It's available on Misc tab of component palette.
Usage
- Drop a TXMLPropStorage component on form and set filename property, for example: session.xml
- Select form, go to Object Inspector and open editor window for the SessionProperties property of TForm.
- Add here properties of form and/or controls to be stored inside session.xml (example: width;height).
- 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 component works the same way as TXMLPropStorage, except it stores the session information in an IniFile.
Notes
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.