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

TDockTree

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

A docking manager for tree-style layouts.

Declaration

Source position: controls.pp line 2516

type TDockTree = class(TDockManager) end;

protected

  FRootZone: TDockZone;

  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;

  

  procedure SetDockZoneClass();

public

  constructor Create(); override;

  destructor Destroy; override;

  procedure BeginUpdate; override;

  

Start updating the DockSite layout.

  procedure EndUpdate; override;

  

Finish updating the DockSite layout.

  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;

  procedure MessageHandler(); override;

  procedure PositionDockRect(); override;

  procedure RemoveControl(); override;

  procedure SaveToStream(); override;

  procedure SetReplacingControl(); override;

  procedure ResetBounds(); override;

  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 of the DockTree.

Inheritance

TDockTree

  

A docking manager for tree-style layouts.

|

TDockManager

  

The layout manager for a docksite.

|

TPersistent

?

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.
[todo: make this description an topic]

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  ||
       ||   |||    ||
       |+---+|+----+|
       +------------+

      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 notebook pages).


    InsertControl - undock control and dock it into the dock site. For example
                    dock Form1 left to a Form2:
                    InsertControl(Form1,alLeft,Form2);
                    To dock "into", 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

#lcl.Controls.TDockManager

  

The layout manager for a docksite.

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