Forum > General
Saving a Form state (related to separating ui from logic)
Curt Carpenter:
I have a form representing an instrument control panel. The virtual panel contains a significant number of different lazarus visual controls (sliders, switches, edit boxes, combo boxes etc.). Is there a good way to take a "snapshot" of the state of all of those visual controls and store them to disk so that they can be read back from disk at a later time and restored to the form? This is a routine operation not difficult to build into a procedure, but writing the procedure is routine and tedious. Is there something like a "TSaveDialog" that saves the state of the controls on a form ("TSaveFormState" perhaps) rather than a file?
jamie:
Look at the "SessionsProperty" in the form.
Curt Carpenter:
A starting point. Thank you.
cdbc:
Hi
Maybe use RTTI to save all the published properties, of all the controls on the form to an ...xml-file?!? Lends itself, on the account of structuring, layout etc...
Just an idea 8-)
Regards Benny
Curt Carpenter:
Amazing -- and works like a charm. Decided to use the JSONProperties storage rather than XML. Many thanks!
Navigation
[0] Message Index
[#] Next page