Unit 'msestatfile' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#msegui]

tstatfile

[Properties (by Name)] [Methods (by Name)]

Persists component state to a UTF-8 text file (by default status.sta), in a simple [section] / name=value format

Declaration

Source position: msestatfile.pas line 63

type tstatfile = class(tactcomponent,istatfile)

public

  constructor create(); override;

  procedure initnewcomponent(); override;

  procedure readstat();

  procedure writestat();

  procedure updatestat();

  property mode: statfilemodety; [r]

published

  property filename: filenamety; [rw]

  property filedir: filenamety; [rw]

  

Can list several candidate directories (e.g. '"~/Podpiska" "."') — on reading, the last one where the file is actually found is used

  property encoding: charencodingty; [rw]

  property options: statfileoptionsty; [rw]

  property statfile: tstatfile; [rw]

  

Link a "sub" tstatfile to a master one by setting its statfile property to the master instance and its own options to include sfo_memory (kept in memory rather than its own file) and sfo_savedata (saved into the master statfile, under a unique filename, when the master is written)

  property savedmemoryfiles: msestring; [rw]

  property statvarname: msestring; [rw]

  property statpriority: Integer; [rw]

  property cryptohandler: tcustomcryptohandler; [rw]

  property activator: tactivator;

  property next: tstatfile; [rw]

  property onstatupdate: statupdateeventty; [rw]

  

To save additional values beyond the connected components' own state, use onstatread (with the read* functions of treader, e.g. readboolean/readinteger), onstatwrite (with the matching write* functions of twriter), or onstatupdate

  property onstatread: statreadeventty; [rw]

  property onstatwrite: statwriteeventty; [rw]

  property onstatbeforewrite: notifyeventty; [rw]

  property onstatafterwrite: notifyeventty; [rw]

  property onstatbeforeread: notifyeventty; [rw]

  property onstatafterread: notifyeventty; [rw]

  property onfilemissing: statfilemissingeventty; [rw]

end;

Inheritance

tstatfile

  

Persists component state to a UTF-8 text file (by default status.sta), in a simple [section] / name=value format

|

tactcomponent,istatfile

|

tmsecomponent,iactivatorclient

  

Extends the FPC tcomponent with object linking facilities and the like; base of every MSEgui component

|

tcomponent,ievent,iificommand,iificlient

|

tpersistent

|

TObject

Description

Persists component state to a UTF-8 text file (by default status.sta), in a simple [section] / name=value format. Most edit widgets (and many other components) have a statfile property: set it to a tstatfile instance to save and restore their state automatically. A form's own tstatfile is read and written automatically if fo_autoreadstat/ fo_autowritestat is set in tcustommseform.options; a datamodule has no such automatic mechanism, so call readstat in oncreate and writestat in ondestroy instead.


Documentation generated on: 2026-10-03