Procedure ReadComponentFromBinaryStream(AStream: TStream;var RootComponent: TComponent; OnFindComponentClass: TFindComponentClassEvent; TheOwner: TComponent = nil);. AStream is the stream containing one component in binary format. Everything behind that component in the stream is not read, including other components. RootComponent is either an existing component, which data will be overwritten, or it is nil and a new component will be created. OnFindComponentClass is a function, that is used by TReader to get the class from the classnames in the stream.
TypeTMyComponent = class(TComponent)privateFID: integer;FRect1: TRect;FRect2: TRect;protectedprocedure DefineProperties(Filer: TFiler); override;publicproperty Rect1: TRect read FRect1 write FRect1;property Rect2: TRect read FRect2 write FRect2;publishedproperty ID: integer read FID write FID;end;procedure TMyComponent.DefineProperties(Filer: TFiler);begininherited DefineProperties(Filer);DefineRectProperty(Filer, 'Rect1', @FRect1,nil);DefineRectProperty(Filer, 'Rect2', @FRect2,nil);end;This component can now be saved, loaded or used by the. You don't need to write any further code.Writing and Reading components from/to LFMSee unit lresources function ReadComponentFromTextStream and WriteComponentAsTextToStream for examples.Writing and Reading components from/to XMLStreaming components is simple:See the example in lazarus/examples/xmlstreaming/.Names. All components of one component (Owner) must have distinct names. So two forms owned by applications must have distinct names. And two labels on a form must have distinct names. But two labels on two different forms can have the same name.
And a form can have the same name as one of its children. TComponent.Name can be empty and you can have more than one component without a name. TWriter will write it, but TReader will not find the component and reading will fail. Therefore the IDE's Object Inspector does not allow that. Names must be valid Pascal identifiers.
Pascal - Program Structures - Before we study basic building blocks of the Pascal programming language, let us look a bare minimum Pascal program structure so that we can take it as a refere.
When referencing other forms: All root components (forms, datamodules.) referenced by other (forms,etc) must have unique names. They don't need to be owned by the application, but then the programmer himself must make sure the names are unique. Forms and Datamodules are found via the Screen object, where all forms and datamodules register themselves automatically.
You can create many forms with the name Form1, for example via TForm1.Create(nil). If a Form2 references a Form1.OpenDialog, then the first Form1 in Screen is used. A Form1 and an embedded frame can have both a child Label1. When the Label1 is referenced then it should be unique on the whole form including all embedded frames. So it is recommended to give all components unique names. Global fixup: TReader reads a component stream.
If it finds an embedded frame a second TReader is created, which reads the frame stream. Then it returns and continues. References to other components (e.g.
Form1.Button1) are saved to a global fixup list in the unit classes (see ). The references are fixed up after reading. TReader and TWriter use the special name Owner to refer to the current Owner.ConclusionRTTI is a powerful mechanism for streaming entire classes easily. RTTI also helps you to avoid repeatedly writing a lot of boring load/save code.See also.
This is a news site. All the information listed here is to be found on the web elsewhere. We do not host, upload or link to any video, films, media file, live streams etc.Kodiapps is not responsible for the accuracy, compliance, copyright, legality, decency, or any other aspect of the content streamed to/from your device.We are not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation.We provide no support for third party add-ons installed on your devices, as they do not belong to us.It is your responsibility to ensure that you comply with all your regional legalities and personal access rights regarding any streams to be found on the web.
![Pineur Pineur](http://image.noelshack.com/fichiers/2015/34/1440021816-pascal-le-grand-frere-pineur-2.jpg)
If in doubt, do not use.