Sign in Join
FPDoc Onlineexperiment

TComponent class

In unit Classes

Base class for all components that need owner-owned functionality.

Declaration

pascal
TComponent = class(TPersistent)

Inheritance

  1. TComponent
  2. TPersistent
  3. TObject

Descends from it: TBaseMediator TBaseSingleInstance TBasicAction TBuildEngine TCustomApplication TCustomConnection TCustomDaemonMapper TCustomInstaller TCustomLazComponentQueue TCustomPropertyStorage TCustomSession TCustomSQLStatement TCustomTimer TDaemonController TDataModule TDataSet TDataSource TDBLookup TDBTransaction TDictionary TDragManager TEventLog TExprBuiltInManager TField TFileVersionInfo TFPCustomHTTPClient TFPCustomTimer TFPExpressionParser TFPMimeTypes THelpDatabase THelpViewer THTTPContentProducer THTTPRouter TIPCBase TJSONApplier TJSONToPascal TLCLComponent TPascalCodeGenerator TPopupNotifier TProcess TSessionFactory TSimpleIPC TWebHandler TXMLConfig

Description

TComponent is the base class for any set of classes that needs owner-owned functionality, and which needs support for property streaming. All classes that should be handled by an IDE (Integrated Development Environment) must descend from TComponent, as it includes all support for streaming all its published properties.

Components can 'own' other components. TComponent introduces methods for enumerating the child components. It also allows to name the owned components with a unique name. Furthermore, functionality for sending notifications when a component is removed from the list or removed from memory altogether is also introduced in TComponent

TComponent introduces a form of automatic memory management: When a component is destroyed, all its child components will be destroyed first.

Properties

ComObjectpublicInterface reference implemented by the component.
ComponentspublicIndexed list (zero-based) of all owned components.
ComponentCountpublicCount of owned components.
ComponentIndexpublicIndex of component in it's owner's list.
ComponentStatepublicCurrent component's state.
ComponentStylepublicCurrent component's style.
DesignInfopublicInformation for IDE designer.
OwnerpublicOwner of this component.
VCLComObjectpublicNot implemented.
Observerspublic
NamepublishedName of the component.
TagpublishedTag value of the component.

Methods

GetObserversprotected
CanObserveprotected
ObserverAddedprotected
GetDeltaStreamsprotected
ReadDeltaStreamprotected
ReadDeltaStateprotected
ChangeNameprotectedActually sets the component name.
DefinePropertiesprotectedDefines fake top,left properties for handling in the IDE.
GetChildrenprotectedMust be overridden by descendants to return all child components that must be streamed.
GetChildOwnerprotectedReturns the owner of any children.
GetChildParentprotectedReturns the parent of any children.
GetOwnerprotectedReturns the owner of this component.
LoadedprotectedCalled when the component has finished loading.
Loadingprotected
NotificationprotectedCalled by components that are freed and which received a FreeNotification.
PaletteCreatedprotected
ReadStateprotectedRead the component's state from a stream.
RemoveFreeNotificationsprotected
SetAncestorprotectedSets the csAncestor state of the component.
SetDesigningprotectedSets the csDesigning state of the component.
SetDesignInstanceprotected
SetInlineprotected
SetNameprotectedWrite handler for Name property.
SetChildOrderprotectedDetermines the order in which children are streamed/created.
SetParentComponentprotectedSet the parent component.
UpdatingprotectedSets the state to csUpdating.
UpdatedprotectedEnds the csUpdating state.
UpdateRegistryprotectedFor compatibility only.
ValidateRenameprotectedCalled when a name change must be validated.
ValidateContainerprotected??
ValidateInsertprotectedCalled when an insert must be validated.
QueryInterfaceprotected
_AddRefprotected
_Releaseprotected
iicrGetComponentprotected
GetTypeInfoCountprotected
GetTypeInfoprotected
GetIDsOfNamesprotected
Invokeprotected
WriteStatepublicWrites the component to a stream.
CreatepublicCreates a new instance of the component.
DestroypublicDestroys the instance of the component.
BeforeDestructionpublicOverrides standard BeforeDestruction.
DestroyComponentspublicDestroy child components.
DestroyingpublicCalled when the component is being destroyed.
ExecuteActionpublicStandard action execution method.
FindComponentpublicFinds and returns the named component in the owned components.
FreeNotificationpublicAsk the component to notify called when it is being destroyed.
RemoveFreeNotificationpublicRemove a component from the Free Notification list.
FreeOnReleasepublicPart of the IVCLComObject interface.
GetEnumeratorpublicCreate an IEnumerator instance.
GetNamePathpublicReturns the name path of this component.
GetParentComponentpublicReturns the parent component.
HasParentpublicDoes the component have a parent ?
InsertComponentpublicInsert the given component in the list of owned components.
RemoveComponentpublicRemove the given component from the list of owned components.
SafeCallExceptionpublicPart of the IVCLComObject Interface.
SetSubComponentpublicSets the csSubComponent style.
UpdateActionpublicUpdates the state of an action.
IsImplementorOfpublicChecks if the current component is the implementor of the interface.
ReferenceInterfacepublicInterface implementation of Notification.
ToStringpublicReturn a string representation for the object.

Events

OnGetDeltaStreamspublic

Fields

FComponentStyleprotectedContains the component's style.
ToStringNameModepublic

Types and constants

TToStringNameModepublic

Inherited

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

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