Sign in Join
FPDoc Onlineexperiment

TLazDockTree.InsertControl procedure

Member of TLazDockTreepublicIn unit LDockTree

InsertControl - undocks AControl and docks it into the tree.

Declaration

pascal
procedure InsertControl(AControl: TControl; InsertAt: TAlign; 
 DropControl: TControl); override

Description

InsertControl - undocks AControl and docks it into the tree.

It creates a new TDockZone for AControl and inserts it as a new leaf. It automatically changes the tree, so that the parent of the new TDockZone will have the Orientation for InsertAt.

Example 1:

A newly created TLazDockTree has only a DockSite (TLazDockForm) and a single TDockZone - the RootZone, which has as ChildControl the DockSite.

Visual:

+-DockSite--+
|           |
+-----------+

Tree of TDockZone:

RootZone (DockSite,doNoOrient)

Inserting the first control:

InsertControl(Form1,alLeft,nil);

Visual:

+-DockSite---+
|+--Form1---+|
||          ||
|+----------+|
+------------+

Tree of TDockZone:

RootZone (DockSite,doHorizontal)
 +-Zone2 (Form1,doNoOrient)

Dock Form2 right of Form1:

InsertControl(Form2,alLeft,Form1);

Visual:

+-DockSite----------+
|+-Form1-+|+-Form2-+|
||        ||       ||
|+-------+|+-------+|
+-------------------+

Tree of TDockZone:

RootZone (DockSite,doHorizontal)
  +-Zone2 (Form1,doNoOrient)
  +-Zone3 (Form2,doNoOrient)

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.