[Overview][Types][Classes][Variables][Index] | Reference for unit 'LCLClasses' (#lcl)

# TLCLReferenceComponent

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for all components having an associated widget with a handle.

## Declaration

Source position: lclclasses.pp line 68

`type TLCLReferenceComponent = class(TLCLComponent)`
`protected`
`procedure CreateParams(); virtual;` |  | Override this method to supply specific widget creation parameters.
`procedure DestroyReference;` |  | Destroys the reference object.
`function GetReferenceHandle; virtual; abstract;` |  | Override this method to return the Handle from the reference.
`procedure ReferenceCreated; virtual;` |  | Called after the Reference is created.
`procedure ReferenceDestroying; virtual;` |  | Called before the Reference is destroyed.
`procedure ReferenceNeeded;` |  | Creates the widgetset Reference for the class, if it has not already been allocated.
`function WSCreateReference(); virtual;` |  | Tells the widgetset to create a Reference.
`procedure WSDestroyReference; virtual;` |  | Tells the widgetset to destroy the Reference.
`public`
`destructor Destroy; override;` |  | Destructor for the class instance.
`property HandleAllocated: Boolean; [r]` |  | If True, a Reference has been allocated for this component.
`property ReferenceAllocated: Boolean; [r]` |  | If True, a Reference has been allocated for this component.
`end;`

## Inheritance

`TLCLReferenceComponent` |  | Base class for all components having an associated widget with a handle.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

The widget is created by the LCL control whenever required, and its reference is stored in the FReferencePtr member. This reference is for internal use by the LCL control, and not by application code.

This reference is different from the OS/window manager-specific window Handle.

Applications only can send messages to a windowed control, using its window Handle.

## Version info

Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type as the return value for the GetReferenceHandle method.

## See also

TLCLReferenceComponent.GetReferenceHandle |  | Override this method to return the Handle from the reference.
TLCLReferenceComponent.ReferenceNeeded |  | Creates the widgetset Reference for the class, if it has not already been allocated.
TLCLHandle |  | The type used for handles in LCL applications, components, controls, and widget set classes.