Skip to content

TDataModule

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

Container for non-visual components.

Declaration

Source position: classesh.inc line 2282

Type
  TDataModule = class (TComponent)
  private
    FDPos : TPoint;
    FDSize : TPoint;
    FDPPI : Integer;
    FOnCreate : TNotifyEvent;
    FOnDestroy : TNotifyEvent;
    FOldOrder : Boolean;
    procedure ReadP(Reader: TReader);
    procedure WriteP(Writer: TWriter);
    procedure ReadT(Reader: TReader);
    procedure WriteT(Writer: TWriter);
    procedure ReadL(Reader: TReader);
    procedure WriteL(Writer: TWriter);
    procedure ReadW(Reader: TReader);
    procedure WriteW(Writer: TWriter);
    procedure ReadH(Reader: TReader);
    procedure WriteH(Writer: TWriter);
  protected
    procedure DoCreate;  Virtual;
    procedure DoDestroy;  Virtual;
    procedure DefineProperties(Filer: TFiler);  Override;
    procedure GetChildren(Proc: TGetChildProc; Root: TComponent);  Override;
    function HandleCreateException : Boolean;  Virtual;
    procedure ReadState(Reader: TReader);  Override;
  public
    constructor Create(AOwner: TComponent);  Override;
    constructor CreateNew(AOwner: TComponent);
    constructor CreateNew(AOwner: TComponent; CreateMode: Integer);  Virtual;
    destructor Destroy;  Override;
    procedure AfterConstruction;  Override;
    procedure BeforeDestruction;  Override;
    DesignOffset : TPoint;
    DesignSize : TPoint;
    DesignPPI : Integer;
  published
    OnCreate : TNotifyEvent;
    OnDestroy : TNotifyEvent;
    OldCreateOrder : Boolean;
  end
  ;

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 descendants 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 descendant of TDataModule which contains non-visual components in it's published property list.

Members

Member Type Visibility Description
AfterConstruction Method public Overrides standard TObject behaviour.
BeforeDestruction Method public
Create Method public Create a new instance of a TDataModule.
CreateNew Method public
DefineProperties Method protected
DesignOffset Property public Position property needed for manipulation in an IDE.
DesignPPI Property public Design Time PPI
DesignSize Property public Size property needed for manipulation in an IDE.
Destroy Method public Destroys the TDataModule instance.
DoCreate Method protected
DoDestroy Method protected
FDPos Field private
FDPPI Field private
FDSize Field private
FOldOrder Field private
FOnCreate Field private
FOnDestroy Field private
GetChildren Method protected
HandleCreateException Method protected
OldCreateOrder Property published Determines when OnCreate and OnDestroy are triggered.
OnCreate Property published Event handler, called when the datamodule is created.
OnDestroy Property published Event handler, called when the datamodule is destroyed.
ReadH Method private
ReadL Method private
ReadP Method private
ReadState Method protected
ReadT Method private
ReadW Method private
WriteH Method private
WriteL Method private
WriteP Method private
WriteT Method private
WriteW Method private

Inheritance

Class Description
TDataModule Container for non-visual components.

See also

Name Description
Integer A signed 16-bits integer
Integer A signed 16-bits integer
TDataModule.OnCreate Event handler, called when the datamodule is created.
TNotifyEvent Standard event handler type.
TNotifyEvent Standard event handler type.
TNotifyEvent Standard event handler type.
TNotifyEvent Standard event handler type.
TPoint Special type to handle a fake TComponent position
TPoint Special type to handle a fake TComponent position
TPoint Special type to handle a fake TComponent position
TPoint Special type to handle a fake TComponent position