Sign in Join
FPDoc Onlineexperiment

TClipboard.GetComponent function

Member of TClipboardpublicIn unit Clipbrd

Gets a TComponent instance with the specified owner and parent from the clipboard.

Declaration

pascal
function GetComponent(Owner: TComponent; Parent: TComponent)
: TComponent
procedure GetComponent(var RootComponent: TComponent; 
 OnFindComponentClass: TFindComponentClassEvent; 
 Owner: TComponent=Nil; Parent: TComponent=Nil)

Arguments

Owner

TComponent instance which owns the component on the clipboard.

Parent

TComponent instance which is the parent for the component on the clipboard.

RootComponent
OnFindComponentClass

Function result

TComponent instance created from the clipboard data, or Nil when not found.

Description

GetComponent is an overloaded method in TClipboard used to read a TComponent instance that was previously stored to the clipboard.

GetComponent allocates a temporary TMemoryStream which is used to read the content stored to a pcfComponent clipboard format (when found). The OnFindComponentClass argument is called to retrieve the class type needed to re-create the TComponent instance. The ReadComponentFromBinaryStream routine (in LResources) is called to create the component in the return value using the arguments to the method.

The return value is Nil if there is no component on the clipboard with the Owner and Parent specified in the arguments to the method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.