[SOLVED] Possible to stream a TActionList ? lazarus / 31-LCL ---------------------------------------------------------------------- Basile B. · 2015-05-10 07:28 Is it possible to stream a TActionList ? i've tried something a bit like this (the problem is not here, streaming object is a routine...). Code: [Select]with TMemoryStream.create do try   WriteComponent(myActionList);   // + convertion to text   SaveToFile(myFile.txt); finally   free; end; but the output text doesn't contain the actions (I was particularly interested by the shortcuts...) but only the properties Top, Left and ImageList... Maybe this is only allowed when componentState = csDesigning ? By the way after a search i've landed there: http://www.devsuperpage.com/search/Articles.asp?ArtID=66912 but it didn't help. Anyone knows ? ---------------------------------------------------------------------- Blaazen · 2015-05-10 10:08 No idea why it does not work; the linked page makes sense. Try to use some buid-in functions, like Code: [Select]WriteComponentAsTextToStream();from unit LResources. Maybe it will help. ---------------------------------------------------------------------- howardpc · 2015-05-10 11:26 Built-in streaming code is designed only to read/write published properties, and the Actions in a TActionList are only accessible via an indexed public property - i.e. completely invisible to the streaming system. To stream actions you would have to write a TActionList descendant that published the Actions property and overrode the ReadComponent/WriteComponent methods suitably. However, there is another problem: TContainedAction does not publish the properties you are interested in (such as Shortcut). In fact TContainedAction (the type of TActionList's Actions[] property) does not even have a Shortcut property. It is not declared until the descendant class TCustomAction. All in all, I think what you want can probably only be achieved by writing your own streaming functionality from scratch, and not trying to adapt the LCL routines which have not been designed to straightforwardly allow all TAction properties to be streamable. The current streaming system provides the minimum functionality required for LCL components to work with the Form Designer: no less, but no more than that. ---------------------------------------------------------------------- Basile B. · 2015-05-10 12:10 Thx, for the explanations. After reading your answers i remember that someone explained me a few years ago that component streaming from TStream is as, you said, not exactly the same as the one used for the IDE, which explains why actions are written from the designer but not from a stream.