Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TDockTree

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

A docking manager for tree-style layouts.

Declaration

Source position: controls.pp line 2612

type TDockTree = class(TDockManager)

protected

  FRootZone: TDockZone;

  

The root zone for the DockTree.

  function HitTest(); virtual;

  

Returns the control and the part of the dockzone at the given coordinates.

  procedure PaintDockFrame(); virtual;

  

Paints the dock header of the zone containing AControl.

  procedure UpdateAll;

  

Updates the internal TDockTreeFlags to reflect the update status for the control

  procedure SetDockZoneClass();

  

The class of all dock zones in this tree.

public

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure BeginUpdate; override;

  

Starts an update process for the class instance.

  procedure EndUpdate; override;

  

Finishes an update process for the class instance.

  procedure AdjustDockRect(); virtual;

  

Adjusts the zone rectangle for AControl.

  procedure GetControlBounds(); override;

  

Returns the zone bounds of a docked control.

  procedure InsertControl(); override;

  

Positions DropCtl relative Control, using the alignment specified by InsertAt.

  procedure LoadFromStream(); override;

  

Has an empty implementation in TDockTree.

  procedure MessageHandler(); override;

  

Has an empty implementation in TDockTree.

  procedure PositionDockRect(); override;

  

Determines the DockRect while dragging a control over the docksite.

  procedure RemoveControl(); override;

  

Removes the undocked control from the docksite layout.

  procedure SaveToStream(); override;

  

Saves the docksite layout to Stream.

  procedure SetReplacingControl(); override;

  

Specifies the control to be replaced subsequently.

  procedure ResetBounds(); override;

  

ResetBounds refreshes the layout of the docksite.

  procedure PaintSite(); override;

  

Handles special painting of the docksite.

  procedure DumpLayout(); virtual;

  

Stores the layout in an file.

  property DockZoneClass: TDockZoneClass; [r]

  

The class of all dock zones in this tree.

  property DockSite: TWinControl; [rw]

  

The parent control whose docked clients are managed

  property RootZone: TDockZone; [r]

  

The root zone for the DockTree.

end;

Inheritance

TDockTree

  

A docking manager for tree-style layouts.

|

TDockManager

  

The layout manager for a docksite.

|

TObject

Description

A tree-style layout is organized in layers of a specific (horizontal or vertical) orientation. Every node in the tree is either a container for other nodes, or represents a zone with a single docked control. All child zones of an node have the same DockOrientation.

The following documentation is copied from the Controls unit. It is of historical interest only, since it effectively describes the AnchorDocking, implemented in TCustomAnchoredDockManager. AnchorDocking is not related to visual drag-dock procedures, it merely is an attempt to implement just an layout manager.

Remark: The TLazDockTree implementation never was finished, due to problems with the anchor "docking" mechanism. Use the EasyDockManager (examples/dockmanager) instead.

This is an abstract class. A real implementation is e.g. in ldocktree.pas.

Docking means here: Combining several windows to one. A window can here be a TCustomForm or a floating control (undocked) or a TDockForm. A window can be docked to another to the left, right, top, bottom or "into". The docking source window will be resized, to fit to the docking target window.

Example1: Docking "A" (source window) left to "B" (target window)

+---+    +-----+
| A | -> |  B  |
|   |    |     |
+---+    +-----+

Result: A new docktree will be created. Height of "A" will be resized to the height of "B". A splitter will be inserted between "A" and "B". And all three are children of the newly created TLazDockForm of the newly created TDockTree.

+------------+
|+---+|+----+|
|| A ||| B  ||
||   |||    ||
|+---+|+----+|
+------------+

Analog for docking "C" left to "A":

+------------------+
|+---+|+---+|+----+|
|| C ||| A ||| B  ||
||   |||   |||    ||
|+---+|+---+|+----+|
+------------------+

Example2: Docking A into B

+-----+
|     |  +---+
|  B <+--| A |
|     |  +---+
+-----+

Result: A new docktree will be created. "A" will be resized to the size of "B". Both will be put into a TLazDockPages control which is the child of the newly created TDockTree.

+-------+
|[B][A] |
|+-----+|
||     ||
||  A  ||
||     ||
|+-----+|
+-------+

Every DockZone has siblings and children. Siblings can either be:

InsertControl - undock a control and dock it into the dock site. For example, to dock Form1 left to a Form2:

InsertControl(Form1,alLeft,Form2);

To dock into a TDockPage, use:

Align=alCustom;

PositionDockRect - calculates where a control would be placed, if it would be docked via InsertControl.

RemoveControl - removes a control from the dock site.

GetControlBounds - TODO: for Delphi compatibility.

ResetBounds - TODO: for Delphi compatibility.

SetReplacingControl - TODO: for Delphi compatibility.

PaintSite - TODO: for Delphi compatibility.

See also

TDockManager

  

The layout manager for a docksite.