TLazDockTree class
Implements a docking manager using a simple layout.
Declaration
TLazDockTree = class(TDockTree)Inheritance
- TLazDockTree
- TDockTree
- TDockManager
- TPersistent
- TObject
Description
TLazDockTree is a TDockTree descendant which contains a
a tree of
TLazDockZones found in a docked window.
Example 1: Docking "A" (source window) to the left of "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 || || ||| ||| || |+---+|+---+|+----+| +------------------+
Example 2: 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
Undocks the control and docks it into the manager. For example, to dock Form1 to the left of Form2:
InsertControl(Form1,alLeft,Form2);
To dock Form1 "into" Form2, into a TDockPage, use Align=alNone.
InsertControl(Form1,alNone,Form2);
PositionDockRect
Calculates where a control would be placed, if it were to be docked using 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
Properties
AutoFreeDockSite | public | AutoFreeDockSite - determines whether the dock site is free. |
Methods
AnchorDockLayout | protected | AnchorDockLayout - sets up anchors between all docked controls and helper controls. |
CreateDockLayoutHelperControls | protected | CreateDockLayoutHelperControls - creates any splitters and pages needed for the dock layout, including recursive creation for child controls. |
ResetSizes | protected | ResetSizes - splits available size of Zone between children. |
BreakAnchors | protected | BreakAnchors - detach the anchors of all child controls. |
PaintDockFrame | protected | PaintDockFrame - finds the cursor position and paints the dock frame of the specified size on the nominated canvas. |
UndockControlForDocking | protected | UndockControlForDocking - frees anchors from parent and sibling controls. |
DefaultDockGrabberSize | protected | DefaultDockGrabberSize - returns the default size for the dock grabber. |
Create | public | Create - constructor for TLazDockTree: creates a docking form if required, sets up a dock manager then calls inherited Create. |
Destroy | public | Destroy - destructor for TLazDockTree: frees the dock site, annuls the Docksite manager, destroys any images then calls inherited Destroy. |
AdjustDockRect | public | AdjustDockRect - offset one of the borders of control rect in order to get space for frame. |
InsertControl | public | InsertControl - undocks AControl and docks it into the tree. |
RemoveControl | public | RemoveControl - destroy child zone and all parents if they does not contain anything else, then removes the dock control. |
BuildDockLayout | public | BuildDockLayout - breaks the current anchors, forms the appropriate helper controls then re-establishes the anchors. |
FindBorderControls | public | FindBorderControls - makes splitters for all bordering controls along the specified Side. |
FindBorderControl | public | Gets the control with the specified dock zone and anchor side. |
GetAnchorControl | public | GetAnchorControl - find a control to anchor the Zone's Side. |
PaintSite | public | PaintSite - paint bounds for each control and close button (using the supplied handle). |
MessageHandler | public | MessageHandler - checks the state of the mouse and takes the appropriate action. Checks whether redraw is needed because of mouse move or change in mouse button status, text needs to be added, etc. |
DumpLayout | public | DumpLayout - writes layout of Zone to a file, for debugging purposes etc. |
Inherited
From TDockTree (14)
BeginUpdate DockSite DockZoneClass EndUpdate GetControlBounds HitTest LoadFromStream PositionDockRect ResetBounds RootZone SaveToStream SetDockZoneClass SetReplacingControl UpdateAll
From TDockManager (4)
AutoFreeByControl CanBeDoubleDocked GetDockEdge IsEnabledControl
From TPersistent (8)
Assign AssignTo DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers GetNamePath GetOwner
From TObject (40)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
