[MSEide-MSEgui-talk] Using sta files.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] Using sta files.

fredvs
Hello Martin.

Is it possible to use sta files to save/load a layout at runtime.

The result of using a sta file is perfect while closing-running a program.

But is it possible to save at runtime the layout (with a custom name for the
sta file) and then reload it when needed ?

If all this is possible, could you give some code explaining how to do ?

Is it possible to save/load a sta file only for one form (saving for example
a grid-entry) ?

Thanks.

Fre;D

 



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Using sta files.

mse
Administrator
On Sunday 08 July 2018 13:50:41 fredvs wrote:
> Hello Martin.
>
> Is it possible to use sta files to save/load a layout at runtime.
>
> The result of using a sta file is perfect while closing-running a program.
>
> But is it possible to save at runtime the layout (with a custom name for
> the sta file) and then reload it when needed ?
>
Yes, call tstatfile.writestat() and readstat().

> If all this is possible, could you give some code explaining how to do ?
>
See the signatures:
"
   procedure readstat(const stream: ttextstream = nil); overload;
   procedure readstat(const afilename: filenamety); overload; //disk file

   procedure writestat(const stream: ttextstream = nil); overload;
   procedure writestat(const afilename: filenamety); overload; //disk file
"

> Is it possible to save/load a sta file only for one form (saving for
> example a grid-entry) ?
>
Yes, tstatfile saves/loads only components where the statfile property is set
to the given tstatfile. If loading/saving should work automatically select
the tstatfile into the statfile property of the form.
What also often is used are sub-statfiles for individual forms which
load/store from memory files by activating sfo_memory and a main statfile
which writes the memory files to disk by entering a filenamemask for the
memory files in the main tstatfile.savedmemoryfiles, for example *.sta if all
memory statfiles have the ".sta" extension.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Using sta files.

fredvs
Hello Martin.

Thanks for light.

I will study/test it.

Write you later.


Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Using sta files.

fredvs
Hello Martin.

Works like charm with only 2 lines of code!

msesta.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msesta.mp4>  

Many thanks.

Fre;D




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Using sta files.

fredvs
Hello.

And here using sta file to create custom playlist...
msestagrid.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msestagrid.mp4>  

By the way, do you have some idea (+code) how to move a row, with the mouse,
inside the tstringgrid ?

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Using sta files.

mse
Administrator
On Tuesday 10 July 2018 14:04:40 fredvs wrote:
>
> By the way, do you have some idea (+code) how to move a row, with the
> mouse, inside the tstringgrid ?
>
The grid must have a fixed column. Please activate <grid>.optionsgrid
og_rowmoving. Drag the row by clicking into the fixed column.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Using sta files.

fredvs
> The grid must have a fixed column.

Ha, OK:

msegridmoverow.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msegridmoverow.mp4>  

Excellent !

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk