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

# TDockTree

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

TDockTree - A tree of dock zones - every docked window has one tree

## Declaration

Source position: controls.pp line 2134

`type TDockTree = class(TDockManager)`
`protected`
`FRootZone: TDockZone;` |  |
`function HitTest(); virtual;` |  | HitTest - performs a Hit test at the specified mouse position, and returns the Control present there
`procedure PaintDockFrame(); virtual;` |  | PaintDockFrame - paints the nominated control's canvas at the specified position
`procedure UpdateAll;` |  | UpdateAll - bring all data up to date
`procedure SetDockZoneClass();` |  | SetDockZoneClass - specifies the class of dock zone
`public`
`constructor Create(); virtual;` |  | Create - constructor for TDockTree: sets up the DockSite, performs inherited Create and sets default BorderWidth, creates the RootZone for the Tree
`destructor Destroy; override;` |  | Destroy - destructor for TDockTree: deletes the RootZone then performs inherited Destroy
`procedure BeginUpdate; override;` |  | BeginUpdate - start updating the dock process
`procedure EndUpdate; override;` |  | EndUpdate - finish updating the dock process
`procedure AdjustDockRect(); virtual;` |  | AdjustDockRect - adjust the position of the docking rectangle for the nominated control
`procedure GetControlBounds(); override;` |  | GetControlBounds - finds the bounds of the control for docking
`procedure InsertControl(); override;` |  | InsertControl - insert the specified DropCtl into the nominated Control, using the alignment specified by InsertAt
`procedure LoadFromStream(); override;` |  | LoadFromStream - loads object for docking from a stream
`procedure MessageHandler(); override;`
`procedure PositionDockRect(); override;` |  | PositionDockRect method for determining the position ( DockRect) where the DropCtl is to be placed on the Client, aligned according to DropAlign
`procedure RemoveControl(); override;` |  | RemoveControl - delete the specified control
`procedure SaveToStream(); override;` |  | SaveToStream - saves the docking object to a stream
`procedure SetReplacingControl(); override;` |  | SetReplacingControl - specify the control for replacing
`procedure ResetBounds(); override;` |  | ResetBounds to their default values
`procedure PaintSite(); override;` |  | PaintSite - a handle for the site to be painted
`procedure DumpLayout(); virtual;` |  | DumpLayout - stores layout in a file
`property DockZoneClass: TDockZoneClass; [r]` |  | DockZoneClass - the class of dock zone
`property DockSite: TWinControl; [rw]` |  | DockSite - the site for docking
`property RootZone: TDockZone; [r]` |  | RootZone - the zone that forms the root of the current Dock Tree
`end;`

## Inheritance

`TDockTree` |  | TDockTree - A tree of dock zones - every docked window has one tree
`TDockManager` |  | A base class for managing the docking process
`TPersistent`
`TObject`

## Description

    TDockTree - a tree of TDockZones - Every docked window has one tree

        This is an abstract class. The real implementation is 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  ||
           ||   |||    ||
           |+---+|+----+|
           +------------+

          If "A" or "B" were floating controls, the floating dock sites are freed.
          If "A" or "B" were forms, their decorations (title bars and borders) are
          replaced by docked decorations.
          If "A" had a TDockTree, it is freed and its child dockzones are merged to
          the docktree of "B". Analog for docking "C" left to "A":

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

        Example2: Docking A into B
                    +-----+
           +---+    |     |
           | A | ---+-> B |
           +---+    |     |
                    +-----+

          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
        - horizontally (left to right, splitter),
        - vertically (top to bottom, splitter)
        - or upon each other (as pages, left to right).

        InsertControl - undock control and dock it into the manager. For example
                        dock Form1 left to a Form2:
                        InsertControl(Form1,alLeft,Form2);
                        To dock "into", into a TDockPage, use Align=alNone.
        PositionDockRect - calculates where a control would be placed, if it would
                           be docked via InsertControl.
        RemoveControl - removes a control from the dock manager.

        GetControlBounds - TODO for Delphi compatibility
        ResetBounds - TODO for Delphi compatibility
        SetReplacingControl - TODO for Delphi compatibility
        PaintSite - TODO for Delphi compatibility

## See also

TDockManager |  | A base class for managing the docking process

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