Sign in Join
FPDoc Onlineexperiment

TControl.DoDock procedure

Member of TControlprotectedIn unit Controls

Adjusts the control position and extent for the new docksite.

Declaration

pascal
procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); virtual

Arguments

NewDockSite

The site where the control will be docked, or Nil when it becomes floating.

ARect

The control's new Bounds, in screen coordinates when NewDockSite is Nil, else in client coordinates of NewDockSite.

Description

DoDock is an Internal method, called by Dock, to performs actions needed when a control is docked to a docksite.

If NewDockSite=Nil, Parent is set to Nil (in preparation of floating the control). Otherwise ARect is ignored, and recomputed to fit approximately into the ClientRect of the NewDockSite.

Finally the computed coordinates are stored, in BoundsRectForNewParent when the NewDockSite differs from Parent, else in BoundsRect.

Errors

A correct implementation should allow for computations in a derived class, and accept and handle the changed bounds without any further adjustments.

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