[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)

TDataModule

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

Container for non-visual components.

Declaration

Source position: classesh.inc line 1814

type TDataModule = class(TComponent)

protected

  procedure DoCreate; virtual;

  procedure DoDestroy; virtual;

  procedure DefineProperties(); override;

  procedure GetChildren(); override;

  function HandleCreateException; virtual;

  procedure ReadState(); override;

public

  constructor Create(); override;

  

Create a new instance of a TDataModule.

  procedure CreateNew();

  

  destructor Destroy; override;

  

Destroys the TDataModule instance.

  procedure AfterConstruction; override;

  

Overrides standard TObject behaviour.

  procedure BeforeDestruction; override;

  

  property DesignOffset: TPoint; [rw]

  

Position property needed for manipulation in an IDE.

  property DesignSize: TPoint; [rw]

  

Size property needed for manipulation in an IDE.

published

  property OnCreate: TNotifyEvent; [rw]

  

Event handler, called when the datamodule is created.

  property OnDestroy: TNotifyEvent; [rw]

  

Event handler, called when the datamodule is destroyed.

  property OldCreateOrder: Boolean; [rw]

  

Determines when OnCreate and OnDestroy are triggered.

end;

Inheritance

TDataModule

  

Container for non-visual components.

|

TComponent,IUnknown,IInterfaceComponentReference

  

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

|

TPersistent

  

Base class for streaming system and persistent properties.

|

TObject

  

Base class of all classes.

Description

TDataModule is a container for non-visual objects which can be used in an IDE to group non-visual objects which can be used by various other containers (forms) in a project. Notably, data access components are typically stored on a datamodule. Web components and services can also be implemented as descendents of datamodules.

TDataModule introduces some events which make it easier to program, and provides the needed streaming capabilities for persistent storage.

An IDE will typically allow to create a descendent of TDataModule which contains non-visual components in it's published property list.

See also

TDataModule.OnCreate

  

Event handler, called when the datamodule is created.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.