This unit contains basic classes for visual controls.
Modal dialog left with None button.
Modal dialog left with OK button.
Modal dialog left with Cancel button.
Modal dialog aborted.
Modal dialog left with Retry button.
Modal dialog left with Ignore button.
Modal dialog left with Yes button.
Modal dialog left with No button.
Modal dialog left with All button.
Modal dialog left with NoToAll button.
Modal dialog left with YesToAll button.
Last (highest) value of modal results.
TWinControlClass
- class of

TWinControl
TControlClass
- class of

TControl
Date expressed in the encoded date-time type
Time of day expressed in the encoded date-time type
TCMMouseWheel - record holding data about the Mouse Wheel

    Details held include:
              the Message associated with the wheel;
              the shift state (ie whether Shift, Alt, Control etc keys have been pressed);
              wheel data which can either be
    	  a position (X, Y coordinates) or
    	  a position plus an integer result.

Alignment options for a control, within its parent control.

alNone
  fixed position and extent
alTop
  stacked at top, full width
alBottom
  stacked at bottom, full width
alLeft
  stacked at left, full height
alRight
  stacked at right, full height
alClient
  filling entire remaining client area
alCustom
  other alignment, in drag-dock: notebook

At most one control can have alClient alignment.

The order of multiple controls of the same (stackable) alignment is determined by their Left or Top coordinate.

The precedence of conflicting alignment requests (e.g. one at top, one at right) is resolved [how???]

[which provisions exist for alCustom implementation?]

Set of options of type TAlign defining possible ways of aligning
Enumerated type listing the possible positions for alignment of a control

    akTop,
      akLeft,
      akRight,
      akBottom

Set of possible anchor positions
A string type for the caption of a control: may be translated
TCursor
- integer type defining range of values for cursor
A subset of TFormBorderStyle, listing only the styles available to a control that is not a form
Type defining the three mouse buttons (left, middle, right)
Highest defined cursor constant.
Default (parent) cursor constant (0)
Invisible cursor constant: no cursor (-1)
Arrow cursor constant (-2)
Cross cursor constant (-3)
I-Beam cursor constant, often used in text editors (-4)
Sizing cursor constant (-22), alias for crSizeAll.
crSizeNESW - cursor constant: runs diagonally from NorthEast to SouthWest (-6)
crSizeNS - cursor constant: cursur runs from North to South (-7)
crNWSE - cursor constant: cursor runs from NorthWest to SouthEast
Horizontal Size cursor constant (-9)
cursor constant
crSizeN - cursor constant: cursor North (-24)
crSizeNW - cursor constant: NorthWest (-23)
cursor constant
Right size cursor constant[?]
cursor constant
Up Arrow cursor constant (-10)
Busy cursor constant (wait while action proceeds) (-11)
Dragging cursor constant (-12)
No Drop Allowed cursor constant (-13)
Horizontal Splitter cursor constant (-14)
Vertical Split cursor constant (-15)
Multiple Object Drag cursor constant (-16)
Waiting for SQL cursor constant (-17)
"No" cursor constant (-18), see also crNoDrop.
"What's This" Help cursor constant (-20)
Pointing hand cursor constant (-21)
Size All Directions cursor constant (-22)
Lowest defined cursor constant.
TControlStyleType - enumerated type describing features of the Control

    Enumerated type comprising:
        csAcceptsControls, // can have children in the designer
        csCaptureMouse,
        csDesignInteractive, // wants mouse events in design mode
        csClickEvents,
        csFramed,
        csSetCaption,
        csOpaque,
        csDoubleClicks,// control understands mouse double clicks
        csTripleClicks,// control understands mouse triple clicks
        csQuadClicks,  // control understands mouse quad clicks
        csFixedWidth,
        csFixedHeight, // control cannot change its height (for example combobox)
        csNoDesignVisible,
        csReplicatable,
        csNoStdEvents,
        csDisplayDragImage,
        csReflector,
        csActionClient,
        csMenuEvents,
        csNoFocus,
        csNeedsBorderPaint, // not implemented
        csParentBackground, // not implemented
        csDesignNoSmoothResize, // no WYSIWYG resizing in designer
        csDesignFixedBounds, // control can not be moved nor resized in designer
        csHasDefaultAction, // control implements useful ExecuteDefaultAction
        csHasCancelAction,   // control implements useful ExecuteCancelAction
        csNoDesignSelectable, // control can not be selected at design time
        csOwnedChildsSelectable // child controls owned by this control are selectable in the designer

As long as Name=Text, changing the Name will set the Caption
When for example a button's Name and Caption have the value 'Button1' and the Name is changed to 'Button2' then the Caption is changed as well. When Name and Caption differs this flag has no effect. This flag has no effect during loading.
Set of permissible control styles
TControlStateType - an enumerated type listing the possible states (status) of Control

Enumerated type comprising

    csLButtonDown,
        csClicked,
        csPalette,
        csReadingState,
        csAlignmentNeeded,
        csFocusing,
        csCreating,
        csPaintCopy,
        csCustomPaint,
        csDestroyingHandle,
        csDocking,
        csVisibleSetInLoading

Set of permissible Control States
The base class for the canvas property of several graphic controls, such as TGraphicControl and TCustomControl
TGraphicControl TCustomControl TCanvas
CreateFont
- creates font by calling inherited

CreateFont
TFPCustomCanvas.CreateFont
Create
- constructor for TControlCanvas: calls inherited

Create
then initialises local variables to show an empty control
TFPCustomCanvas.create
Destroy
- destructor for

TControlCanvas
: frees handle and calls inherited

Destroy
TPersistent.Destroy TCanvas.Destroy
The Control object for which this is the Canvas
Reads or writes a flag to determine the identity of the Control object
TDragImageList
- a list of Images to be dragged

A drag image is shown when a DragImageList is supplied at all, and when no accepting target is under the mouse, or the source control style includes csDisplayDragImage, or AlwaysShowDragImage is set in the DragObject.

In drag-dock operations typically no drag image is shown, since the DockRect frame already gives all required visual feedback.

    This is a vague idea of the usage of this class:

    SetDragImage selects an image from the list, and defines the hotspot within this image.

    DragLock specifies a window (handle), to which the image should be attached [what exactly does this mean?]

    ShowDragImage shows the image, combined with the mouse cursor. The HotSpot indicates the shift of the image, relative to the current mouse position.

    HideDragImage hides the image, shown at its last position.

DragManager message types.

All messages are sent to the target control, except dmDragDrop and dmDragCancel is sent to the source control.

    dmDragEnter: mouse enters control
    dmDragLeave: mouse leaves control
    dmDragMove: mouse moves over control (after dmDragEnter)
    dmDragDrop: control dropped
    dmDragCancel: dragging aborted
    dmFindTarget: find child control under the mouse

Base class for managing drag operations and feedback.

Every dragging operation has an associated DragObject, holding references to the source and target controls, and other parameters for the customization of the visual user feedback.

A default DragObject is created automatically when a dragging operation starts, and is destroyed when the operation has ended, so that you must not take special care on it. But an application can provide a customized DragObject in the or handlers of the source control (being dragged).

TDragObject is the ancestor of an whole tree of dragging objects, with the main branches supporting either drag-drop or dock-drop operations. The type of the operation is determined from the property of the source control. In contrast to the Delphi implementation, Lazarus has moved a couple of methods into the drag performers, so that these are no more available for customization.

A Lazarus DragObject mainly supplies the cursor and images, used in visual user feedback. Drag-drop operations typically signal acceptance of an possible drop by variations of the mouse cursor, and optionally can attach to it shapes of the dragged object(s). Dock-drop operations instead show a docking rectangle, that snaps to possible target locations when the mouse moves over docksites.

[entire review DoDi 2010-02-16]

Returns the dragging cursor type.
In drag-drop operations the cursor signals acceptance or rejection of an drop, depending on Accepted.
Returns a list of images for dragging.
The returned provides methods for the selection and display of an image, shown while dragging.
Destroy this instance of TDragObject
Assigns a particular source to this drag object
Finds out a lot of information about the source object, such as its operating-system handle, size, position, how much the mouse is allowed to move before the object is moved, and whether the object is to be kept visible during the drag process.
The object, with all its properties, that is to be dragged
Find name of the object for dragging
The object's name returned as a string
Hides the drag image
ShowDragImage
// exist only for compatibility
zero
Shows the drag image
HideDragImage
Is this drag object being cancelled?
Reads or sets flag to determine whether this drag image is being cancelled. Property has a boolean value, true if cancelling
Finds Operating-System handle for this object
Reads or writes flag for operating-system handle
Mouse position in screen coordinates.
Mouse position in client coordinates of the DragTarget (site)
The control to which the current object is dragged (target).
Indicates whether the drag object has been dropped yet.
False while dragging is in progress, or when dragging has been aborted.
A class type.
An ancestor class for many drag control objects
Creates an instance of this object
The control object that is to be dragged
Reads or writes flag with identity of object for dragging
Assigns source object
Overrides definition in parent class
The object that is to be dragged
The identity of the control to be dragged
Reads or writes flag with identity of control object
A drag object for dragging a control.
The dragged control is used to determine the DragCursor and DragImages.

This object type serves two main purposes: it allows to distinguish between drag-drop and dock-drop operations, and it implements docking specific information and behaviour.

The primary use is for tree docking, as assumed in the TControl and TWinControl methods.

[entire review DoDi 2010-02-16]

A drag object for docking.
Adjust the DockRect relative to the dragging hotspot (DockOffset).
Finish docking.
Invokes Control.DoEndDock.
Screen coordinates of a possible drop location.
How the dragged control will be docked, relative to the target control.
The control to which the dragged control will be docked.
The final state of the dragged control (after drop).
True when the dragged control becomes or stays floating.
Start updating the DockSite layout.
Finish updating the DockSite layout.
Returns the zone bounds of a docked control.

The TDockTree manager returns the bounds of the dockzone, including the dock header.

When the control is not docked, an empty Rect(0,0,0,0) is returned.

Position DropCtl relative Control, using the alignment specified by InsertAt.

InsertControl determines the layout and appearance of the just docked control, forcing a repaint of the container control if necessary.

When SetReplacingControl has been called with a non-Nil Control before, the dropped control only should replace that control.

An overloaded version passes the DragDockObject to the dockmanager, allowing to pass more information about the drop. It allows to implement other than tree-style docksites.

Restores the layout of the docksite from Stream.
The controls to be docked can be retrieved by ReloadDockedControl from the docksite; this method returns only existing controls of the given name, owned by the owner of the docksite, by default.
Handles special painting of the docksite.
While the docked controls paint themselves. eventual dockheaders and other decoration have to be painted by the DockManager.
Determines the DockRect while dragging a control over the docksite.

This method updates DockRect for the visual feedback, when a control is dragged over the docksite.

The Delphi compatible version only can use the parameters determined by the default processing in the docksite.

The Lazarus specific version can update the DockObject with better suited parameters. A DockManager here can implement any algorithm for the placement of a dropped control. The default implementation calls the Delphi compatible version.

The DragDockObject.DockRect spans the entire DockSite.

Removes the undocked control from the docksite layout.
When SetReplacingControl has been called with a non-Nil argument before, the layout of the docksite should not be changed. Instead the next inserted control should take the place and role of this control.
ResetBounds
refreshes the layout of the docksite

This method typically notifies the DockManager of a Resize of the docksite.

When the extent of the docksite really has changed, the DockManager should reposition and resize all docked controls accordingly.

The layout always should be refreshed when Force is True. This is required when e.g. the visibility of docked controls has changed, but not the size of the docksite.

Saves the docksite layout to Stream.
Specifies the control to be replaced subsequently.

This method is called by ReplaceDockedControl, to announce a pending replacement of Control by another control. The next RemoveControl should be ignored, and InsertControl should only exchange the controls, without reorganizing the layout of the docksite. When Control is Nil, this call signals the end of the exchange [obsolete].

The name "SetReplacingControl" is a misnomer, it should read "SetControlToBeReplaced".

Holds maximum and minimum values that can be used in sizing objects.
Method for achieving a Change in the constraints
AssignTo
- copies constraints to destination if it is of the same type and has different values, else calls inherited

AssignTo
TPersistent.AssignTo
SetMaxHeight
- specifies a maximum value for height
SetMaxWidth
- specifies a maximum value for width
SetMinHeight
- specifies a minimum value for height
SetMinWidth
- specifies a minimum value for width
Create
- constructor for

TSizeConstraints
: calls inherited

Create
and sets some default (zero) constraints
TObject.Create
UpdateInterfaceConstraints
- updates the constraints on size for the Interface
SetInterfaceConstraints
- specifies the constraints for the interface
EffectiveMinWidth
- returns the effective value for minimum width, given the local and interface constraints
EffectiveMinHeight
- returns the effective value for minimum height, given the local and interface constraints
EffectiveMaxWidth
- returns the effective value for maximum width, given the local and interface constraints
EffectiveMaxHeight
- returns the effective value for maximum height, given the local and interface constraints
MinMaxWidth
the difference between Minimum and Maximum width
MinMaxHeight
the difference between Minimum and Maximum height
MaxInterfaceHeight
- the maximum height allowed by the interace
MaxInterfaceWidth
- the maximum width allowed by the interace
MinInterfaceHeight
- the minimum height allowed by the interface
MinInterfaceWidth
- the minimum width allowed by the interface
The Control to which these constraints apply
Options
for determining constraints
OnChange
- event handler for a change in contraints
MaxHeight
- the maximum height
MaxWidth
- the maximum width
MinHeight
- the minimum height
MinWidth
- the minimum width
TControlBorderSpacing
- the spacing around a Control
{ TControlBorderSpacing defines the spacing around a control.

The spacing around its children and between its children is defined in TWinControl.ChildSizing.

Left, Top, Right, Bottom: integer; minimum space left to the autosized control. For example: Control A lies left of control B. A has borderspacing Right=10 and B has borderspacing Left=5. Then A and B will have a minimum space of 10 between.

Around: integer; same as Left, Top, Right and Bottom all at once. This will be added to the effective Left, Top, Right and Bottom. Example: Left=3 and Around=5 results in a minimum spacing to the left of 8.

InnerBorder: integer; This is added to the preferred size. For example: A buttons widget returns 75x25 on GetPreferredSize. CalculatePreferredSize adds 2 times the InnerBorder to the width and height.

CellAlignHorizontal, CellAlignVertical: TControlCellAlign; Used for example when the Parents.ChildSizing.Layout defines a table layout.

}
Change
- software emulation of the

OnChange
event
Create
- constructor for

TControlBorderSpacing
: sets some default positions, dimensions and alignments, then performs inherited

Create

Create - constructor for TControlBorderSpacing: sets some default positions, dimensions and alignments, then performs inherited

Create

Overrides ancestor constructors, and may be overridden

TObject.Create
Assign
the contents of

Source
to the current control. If it is of the same type, copies selected spacing properties, otherwise calls inherited

Assign
TPersistent.Assign
AssignTo
- calls the

Assign
procedure for the Destination control
TPersistent.AssignTo
IsEqual
- returns True if the specified spacing equals the current value
GetSpaceAround
- finds the space around the edge
GetSpace
- finds the space required by the specified Anchor kind
The control for which border spacing is defined
The kind of anchor to used in calculating spacing
Event handler for a change in border spacing
The size of the space at the left border
The size of the space at the top border
The size of the space at the right border
The size of the space at the bottom border
The size of the space all around the control
TAnchorSide
- the side on which anchoring is to be performed for the current control

    TAnchorSide

        Class holding the reference sides of the anchors of a TControl.
        Every TControl has four AnchorSides:
        AnchorSide[akLeft], AnchorSide[akRight], AnchorSide[akTop] and
        AnchorSide[akBottom].
        Normally if Anchors contain akLeft, and the Parent is resized, the LCL
        tries to keep the distance between the left side of the control and the
        right side of its parent client area.
        With AnchorSide[akLeft] you can define a different reference side. The
        kept distance is defined by the BorderSpacing.

        Example1:
           +-----+  +-----+
           |  B  |  |  C  |
           |     |  +-----+
           +-----+

          If you want to have the top of B the same as the top of C use
            B.AnchorSide[akTop].Side:=asrTop;
            B.AnchorSide[akTop].Control:=C;
          If you want to keep a distance of 10 pixels between B and C use
            B.BorderSpacing.Right:=10;
            B.AnchorSide[akRight].Side:=asrLeft;
            B.AnchorSide[akRight].Control:=C;

          Do not setup in both directions, because this will create a circle, and
          circles are not allowed.

        Example2:
                +-------+
          +---+ |       |
          | A | |   B   |
          +---+ |       |
                +-------+

          Centering A relative to B:
            A.AnchorSide[akTop].Side:=arsCenter;
            A.AnchorSide[akTop].Control:=B;
          Or use this. It's equivalent:
            A.AnchorSide[akBottom].Side:=arsCenter;
            A.AnchorSide[akBottom].Control:=B;

Create
- constructor for

TAnchorSide
: calls inherited

Create
, copies arguments to local variables and sets default anchor to Top
TObject.Create
GetSidePosition
- returns the position of the side used for anchoring
Assign
- copies anchoring information from

Source
if it is of the same type as the current control, otherwise calls inherited

Assign
TPersistent.Assign
Owner
- the Control that owns the current control that is to be anchored
The Kind of anchoring to be used
The control whose anchoring properties are being determined
The side on which anchoring is to be performed
TControlActionLink
- links the current control to an action

TControlActionLink - links the current control to an action

Defines a number of protected methods (inherited from TActionLink) for checking which parts of the control are linked to the action

Local variable that identifies the client control that is to be linked to the action
IsOnExecuteLinked
- returns True if the OnExecute event is linked
DoShowHint
- method to display hint; returns True if successful
SetCaption
- specifies the caption for the control
TActionLink.SetCaption
SetEnabled
- specifies whether or not the link is enabled
SetHint
- specifies the string to use for the hint
SetHelpContext
- specifies the context-based help variable to use
SetHelpKeyword
- specifies the help keyword
SetHelpType
- specifies the type of help to use
SetVisible
- specifies the visiblity
SetOnExecute
- specifies the Execute event handler
TControlActionLinkClass
- class of

TControlActionLink
Flag showing position of cursor
Function to get text-string associated with control
Uses RealGetText rather than GetTextBuf to avoid unnecessary read-writes to PChar buffers
GetTextBuf
The function returns the required text as a string
Procedure to set the position of the cursor
Stores text in buffer
Uses RealSetText rather than SetTextBuf to avoid unnecessary read-writes to PChar buffer
RealSetText SetTextBuf
The text string to be stored in the buffer
Procedure to set Visible flag and ensure the control can be seen
Flag showing the set of states for this control
Is autosizing in progress?
DoAutoSize
- method for actually performing the AutoSize

TControl.DoAutoSize

IMPORTANT: Many Delphi controls override this method and many call this method directly after setting some properties.

During handle creation not all interfaces can create complete Device Contexts which are needed to calculate things like text size.

That's why you should always call AdjustSize instead of DoAutoSize.

AutoSize topic TControl.AdjustSize
AutoSizeCanStart
- checks whether

DoAutoSize
is permitted to start

    function TControl.AutoSizeCanStart: boolean;

      Returns true if DoAutoSize can start. That means, it tests the minimum
      requirements to start. Some controls need even more.

      It returns false if
      - AutoSize=false
      - or the control is currently autosizing
      - or the control is in design state (csDesigning) and is not a top level control (form, frame)
      - or the control is not visible
      - or the control is destroying

Procedure invoked when the anchor side is changed
Set up the Align rules for this control
Set the rules for anchoring this control
Set the boolean variable that determines whether autosize can function
Procedure invoked when the bounds of the control have been changed.
Procedure to execute a change in the control's constraints
Procedure to execute a change in the control's border spacing
Send a message to the system if the size and/or position of the control change
Procedure for performing a resize within defined boundaries (constraints)
CalculatePreferredSize
- find default/preferred height and width

CalculatePreferredSize - find default/preferred height and width

procedure TControl.CalculatePreferredSize

(var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);

Calculates the default/preferred width and height for a control, which is used by the LCL autosizing algorithms as default size. Only positive values are valid. Negative or 0 are treated as undefined and the LCL uses other sizes instead.

TWinControl overrides this and asks the interface for theme dependent values. See

TWinControl.CalculatePreferredSize for more information.

WithThemeSpace: If true, adds space for stacking.

For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be some space around. This space is theme dependent, so the parameter is passed to the widgetset.

Calls OnResize
Calls the OnChangeBounds event handler
Checks for changes and calls DoOnResize
Smart calling Parent.AlignControls
Update the basic boundaries of the control - essential if there has been a lot of re-sizing
Lock the base bounds, so that they do not change even if surrounding controls are changed
Unlock the base bounds so that they are free to change as surrounding controls are changed
Update the rules for anchoring the control
Sets the bounds (top. left, height, width) of the control.
Perform the actual setting of the boundary rectangle.
Change the scale factor (multiplier and divider) for drawing the control
Function to determine if autosizing is possible, and if so, gets the new width and height
Try to set the automatic changed bounds

    { try to set the automatic changed bounds
      If the interface does not like our bounds, it sends a message with the real
      bounds, which invokes the automatic realigning of the control, .. a circle.
      To break the circle, only bounds that are different from the last try will
      be sent.
    }

Returns the screen coordinates of the control's origin.

Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.

Visual size of client area
Get the visible part of the logical client area.
The origin reflects the ScrollOffset in a TScrollingWinControl, Bottom and Right are adjusted accordingly.
Get the visible part of a possibly scrolled client area.
If Scrolled is False, the ScrollOffset is ignored.
The function returns the coordinates of the child rectangle
True if the rectangle is scrolled
Find the offset for scrolling of the client
Find the origin (top left pixel) of this control on the screen

Returns the screen coordinate of the topleft coordinate 0,0 of the control area. (The topleft pixel of the control on the screen)

Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.
Protected messages to system - when left mouse button is down
Protected messages to system - when right mouse button is down
Protected messages to system - when middle button is down
Protected messages to system - when left button is double-clicked
Protected messages to system - when right button is double-clicked
Protected messages to system - when middle button is double-clicked
Protected messages to system - when left button is triple-clicked
Protected messages to system - when right button is triple-clicked
Protected messages to system - when middle button is triple-clicked
Protected messages to system - when left button is quadruple-clicked
Protected messages to system - when right button is quadruple-clicked
Protected messages to system - when middle button is quadruple-clicked
Protected messages to system - when mouse cursor has moved
Protected messages to system - when left button is up
Protected messages to system - when right button is up
Protected messages to system - when middle button is up
Protected messages to system - when the control is moved
Protected messages to system - when control is sized
Protected messages to system - when window position is changed
LCL Message when capture method is changed
Control Message when Enabled status is changed
Control Message for Hit Test
Control Message for exit of mouse
Control Message for a change in parent colour
Control Message for a change in parent hinting status
Control Message for a change in visibility
Saves the docked and undocked extent of the control.

In floating state sets UndockWidth/Height to the current Width/Height.

In docked state sets LRDockWidth/TBDockHeight to the current Width/Height.

[Note: should save both in any case, independent from DockOrientation or host Align. Rationale: a DockManager will either ignore these values, or use them according to the *new* alignment. Without a DockManager both extents are required, because no (valid) alignment information applies.]
Create a floating dock site within the Bounds specified as an argument
Find out which edge is used for docking (returned in Result)
Guess whether the control is floating.
Floating state is assumed when the control has a HostDockSite of FloatingDockSiteClass, and is the only docked client.
Returns the class of the floating dock site
Start the AutoDrag process.
Adjust the DockRect for floating state (not over a DockSite)
Adjust the control's position and extent for the new docksite.

If NewDockSite=Nil, Parent is set to Nil (in preparation of floating the control).

Otherwise ARect is adjusted to fit into the logical ClientRect of the NewDockSite. The origin is adjusted according to Align[??? should be DropAlign!], so that the control sits at the according side of the NewDockSite.

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

ARect is the perfect BoundsRect for the control, in screen coordinates when it becomes floating, or in client coordinates of the target docksite.

Dispatch a drag message, sent by the DragManager
On dmFindTarget: return Self for the DropOnControl.

On dmDragEnter/Leave/Move: invokes DragOver or, if docking, the target.DockOver. Result indicates acceptance of an drop. When the DragObject has been AutoCreated, the dragged control is passed to DragOver as the Sender; otherwise the DragObject itself is passed as Sender.

On dmDragDrop: invokes DragDrop or, if docking, the target.DockDrop. Returns nothing!
Invokes the OnEndDock handler
Invokes the OnEndDrag handler
Invokes the OnStartDock handler
Invokes the OnStartDrag handler
DragCanceled
- method for signalling that a drag is cancelled
Determines whether a drop is acceptable, using the OnDragOver handler.

An OnDragOver handler is required, or any drop will be rejected (Accept becomes False).

When an OnDragOver handler is installed, Accept is set to True and can be changed by the handler.

Caution: Sender can be either a TDragObject, or the dragged control.
Get the DockRect for an drop.
Either calls the DockManager.PositionDockRect of the target site, or DragDockObject.AdjustDockRect after moving the undocked control rectangle to the DragPos. AdjustDockRect takes the hotspot of the DockRect into account.
SetDragMode
- specify the mode for dragging
Click
- a procedure that allows the programmer to simulate a mouse click over the control, and initiates the same

Action
as that associated with the

OnClick event
DblClick
- a procedure that allows the programmer to simulate a mouse double-click over the control, and initiates the same

Action
as that associated with the

OnDblClick event
TripleClick
- a procedure that allows the programmer to simulate a mouse triple-click over the control, and initiates the same

Action
as that associated with the

OnTripleClick event
QuadClick
- a procedure that allows the programmer to simulate a mouse quadruple-click over the control, and initiates the same

Action
as that associated with the

OnQuadClick event
MouseDown
- a procedure that allows the programmer to simulate a mouse button being down over the control, and initiates the same

Action
as that associated with the

OnMouseDown event

MouseDown - a procedure that allows the programmer to simulate a mouse button being down over the control, and initiates the same

Action as that associated with the

event

X, Y show mouse position

which buttons are down
which of Ctrl, Shift or Alt keys are also pressed
MouseMove
- a procedure that allows the programmer to simulate a mouse being moved over the control, and initiates the same

Action
as that associated with the

OnMouseMove event

MouseMove - a procedure that allows the programmer to simulate a mouse being moved over the control, and initiates the same

Action as that associated with the

event

Shift signifies whether Ctrl, Shift or Alt keys are also pressed;

X, Y show mouse position

MouseUp
- a procedure that allows the programmer to simulate a mouse button being Up over the control, and initiates the same

Action
as that associated with the

OnMouseUp event

MouseUp - a procedure that allows the programmer to simulate a mouse button being Up over the control, and initiates the same

Action as that associated with the

event

Button specifies which mouse button;

Shift signifies whether Ctrl, Shift or Alt keys are also pressed;

X, Y show mouse position

MouseEnter
- a procedure that allows the programmer to simulate a mouse entering the control, and initiates the same

Action
as that associated with the

OnMouseEnter event
MouseLeave
- a procedure that allows the programmer to simulate a mouse leaving the control, and initiates the same

Action
as that associated with the

OnMouseLeave event
DialogChar
- a LCL Key Message; returns True if a Dialog character has an associated message
Changed
- method to signal that a change has occured
GetPalette
- returns a handle to the palette for this control
ChildClassAllowed
- returns True if the specified class is allowed to be a child of this class
Loaded
- called when the component has finished loading. Calls inherited

Loaded
then copies various properties from client and parent
TComponent.Loaded
DefineProperties
- declare any properties not specified elsewhere
TComponent.DefineProperties TPersistent.DefineProperties
AssignTo
- if the Destination is a CustomAction, copies some specified properties to the Destination, otherwise calls inherited

AssignTo

AssignTo - if the Destination is a CustomAction, copies some specified properties to the Destination, otherwise calls inherited

AssignTo

The copied properties are:

- Enabled
- Hint
- Caption
- Visible
- OnExecute (copied to OnClick)
- HelpContext
- HelpKeyword
- HelpType

InvalidateControl
- method to render the Control non-valid; visibility and opacity are specified
InvalidateControl
- method to render the Control non-valid; visibility and opacity are specified and instructions can be given to ignore Window Controls
FontChanged
- method for dealing with a changed font
Find the action needed for operation of this control
Function to get a text-string associated with the control
This is the function that is actually used by GetTextBuf, and loads a string rather than performing read-write to a PChar buffer
GetTextBuf RealSetText SetTextBuf
The Function returns the required text as a string
Procedure to store text associated with the control in a string
This is the procedure that is actually used by SetTextBuf, and stores text as a string rather than performing read-write to a PChar buffer
SetTextBuf RealGetText GetTextBuf
The text-string that is to be stored
Set up the action to be associated with this control
Set up the colour to be used by the control
Set up the flag to determine whether the control is to be enabled
Set up the hinting pop-up for this control
Set the name of the control
Find who the parents are and store the information
SetParentComponent
- specify a new component to be the parent
WndProc
- message handler for the procedure of this window
ParentFormHandleInitialized
- called by

ChildHandlesCreated
of parent form

The form is a real connection to the target screen.

For example, the gtk under X gathers some screen information, but not before form creation.

But this information is needed to create DeviceContexts, which are needed to calculate Text Size and such stuff needed for AutoSizing.

That's why AdjustSize delays AutoSizing till this moment.

Now do the AutoSize.

CaptureChanged
- the method for data capture has changed
Notification
- calls inherited

Notification
, then takes action depending on Operation

Notification - calls inherited

Notification, then takes action depending on Operation

If Operation is removal, then nullifies any popupmenus or actions. disconnects all anchors.

CanTab
- if True, the Tab key can be used to navigate to this control
GetDeviceContext
- returns a device handle to correspond with the nominated

WindowHandle
GetEnabled
- returns the

Enabled
status
GetPopupMenu
- returns a popup menu for use with this control
DoOnShowHint
- perform the code for the

OnShowHint
event handler
VisibleChanging
- method to use when the

Visible
property is changing
AddHandler
- add a control handler of the nominated type, using the specified method
RemoveHandler
- remove a control handler of the nominated type, using the specified method
DoContextPopup
- perform the action to display a context-sensitive popup window, at the specified mouse position
GetActionLinkClass
- returns the class of the action link
ActionChange
- method for changing an action
Link to the default action associated with this control
Whether auto-size is to be used

// standard properties, which should be supported by all descendants

AutoSize permits the size of a control to be adjusted automatically, for example a button can become bigger or smaller to accommodate a longer or shorter caption.

Reads logical (boolean) flag to see whether auto-sizing is to be operated, or writes the flag to say it should be done. Default is false, ie no auto-sizing

Autosize topic
Ctl3D
- retained for Delphi compatibility; even there it is deprecated
DragCursor
- the style of cursor to be used during the Drag process
Default is crDrag. When no drop is allowed, the cursor changes temporarily to crNoDrop.
DragKind
- what sort of dragging? Drag or Dock
Set to dkDrag to allow for drag-drop, or to dkDock to allow for drag-dock.
DragMode
- whether manual or automatic

Default is dmManual, meaning that dragging must be started in code.

Set to dmAutomatic to allow the user to drag this control. In this mode dragging can start immediately (on left mouse button press) or delayed, after the mouse has been moved away by a number of pixels (Threshold).

Are mouse messages captured by this control?

Mouse messages can be sent to a capturing control. This occurs automatically when a control is dragged. In normal operation all mouse messages are sent to the control under the mouse pointer.

Applications should capture mouse events only for special purposes, and release the capture as soon as a the target position has been determined. Limited user feedback is possible while the mouse is captured, but not all application controls will work properly so long.

ParentFont
- should the control use the same font as the parent? Default is true
ParentColor
- should the control have the same colour as the parent? Default is true
ParentShowHint
- does the control adopt the same hinting behaviour as its parent? Default is true
The stored (saved) properties of the current session, expressed as a string
Text
- the character string in the name or caption of the control

Text - the character string in the name or caption of the control

But BEWARE: Text is used in another context in editing controls such as TEdit and TCustomEdit, TLabeledEdit and TCustomLabeledEdit, where it contains the character string that is being edited in the Edit Box.

Event Handler for constrained resize

Event handler needs to be supplied to cover the need to resize a control within the given constraints of maximum and minimum width and height

Event handler to supply information when a context-sensitive pop-up menu is required
Event Handle for mouse double-click

Double-clicking is much more common in a Windows environment than in Unix or Linux, where single-clicking is the default method for selecting an object. However, in all environments there could be valid use for a double-click, and a method should be supplied if appropriate.

Event handler for mouse triple-click
Event handler for quadruple click
Event handler for the drop of a control onto this control.

The handler determines what shall happen when another control is dropped onto this (Sender) control.

Sender is the target control onto which the Source control is dropped.

X and Y are the client coordinates of the drop.

Event handler for the case when a control is dragged over another control
Event handler for the end of a docking operation

This message is sent to the dragged control.

Sender is the control to be docked.

Target is the control into which the Sender is docked, or Nil when dragging has been aborted.

X and Y are the screen coordinates of the drop.

Event handler for the end of a dragging process

This message is sent to the dragged control.

Sender is the dragged control.

Target is the control onto which the Sender has been dropped, or Nil when dragging has been aborted.

X and Y are the screen coordinates of the drop.

Event handler for when a mouse button is pressed down
Event handler for mouse movement within the current control
Event handler for when the mouse button is released, ie "up"
Event handler for when the mouse enters the area of the current control
Event handler for when the mouse leaves the area of the current control
Event handler for the start of a docking operation

The handler can provide a special DragDock object, otherwise a default object is created.

Event handler for start of dragging operation

The handler can provide a special DragControl object, otherwise a default object is created.

Event handler when editing is done
FCompStyle
- deprecated

    // DEPRECATED. Enables (valid) use of 'IN' operator (this
          // is a hack for speed. It will be replaced by the use of the widgetset
          // classes.
          // So, don't use it anymore.

Invokes the OnDragDrop handler, when the control is dropped
The object to be dragged and dropped
The X co-ordinate to which the object is to be dropped (target)
The Y co-ordinate to which the object is to be dropped (target)
Move the control into a new docksite.

Removes the control from the DockClients of the old docksite, and adds it to the DockClients of the new docksite. Adjusts the position and extent for the new docksite, then calls the DoAdd/RemoveDockClient methods of the old and new docksite.

Performs checks that there is already a valid host control to which the present control is to be docked, removes old controls from the list of docked controls and adds the new control to the list, then calls DoDock to position the control.

An exception is raised if there is already a docking process in progress for this control
The host control to which which the current control is to be docked
The position at which the control is to be docked
Docks a control programmatically.

Docks this control into NewDockSite, relative to DropControl. When NewDockSite is Nil, the control becomes floating.

When the new docksite uses an DockManager, and DropControl is not Nil, the control will be docked relative to DropControl, as specified by ControlSide. The interpretation of ControlSide depends on the DockManager of NewDockSite, or on the OnDockDrop handler in an unmanaged docksite. A tree docking manager (TDockTree) should interpret alCustom as NoteBook docking, i.e. a tabbed notebook is created in place of DropControl, and both DropControl and this control are docked into pages of this notebook.

The function returns True if a manual dock has been successfully performed
The new site to which the control is docked, if DropControl has been found to be nil
If nil (default) then ignored else used as the control for docking, on side specified by ControlSide
The side on which the control is to be docked, if DropControl is not nil
Undocks the control into floating state.
TWinControls float for themselves, for TControls a floating dock site is created, and the control is docked into it.
The function returns True if a manual float has been succesfully performed
The rectangle within which the floating control is located
The rectangle within which the floating control is located
(ie the location of the floating dock site to which the control is docked)
Remove a previously docked control and put a new control in its place

This method works only when the control to replace resides in a managed docksite (using an DockManager), or is not docked at all. Even then exist situations where it won't work as expected, depending on the used DockManager and other subtle conditions.

When the control to replace is docked, then it's replaced by this control; otherwise this control becomes floating (seems to be a design flaw).

Finally the control to replace is docked into NewDockSite, according to DropControl and ControlSide (see ).

This method primarily exists for use by the DockManager itself, for NoteBook docking. It should not be used in application code.

Returns True if a docked control has been successfully replaced with a new one
The old control that was previously docked at this site
The new site for docking; used if DropControl is nil
The control site to be used for docking, unless it is nil when it is igored. Passed straight through as an argument to ManualDock
The side to which the new control is to be aligned; passed straight through as an argument to ManualDock
Returns True if the control is being dragged
Returns True if the control is being dragged
AdjustSize
- Smart way to

DoAutoSize

TControl.AdjustSize calls

DoAutoSize in a smart fashion.

During loading and handle creation the calls are delayed.

This method initially does the same as TWinControl.DoAutoSize. But since DoAutoSize is commonly overriden by descendant components, it is not useful to perform all tests, which can result in too much overhead. To reduce this the LCL calls AdjustSize instead.

Auto-sizing has been delayed until some other process is complete
Returns True if auto-sizing has been delayed
AnchorToNeighbour
- anchoring instructions

    {------------------------------------------------------------------------------
      procedure TControl.AnchorToNeighbour(Side: TAnchorKind; Space: integer;
        Sibling: TControl);

      Setup AnchorSide to anchor one side to the side of a neighbour sibling.
      For example Right side to Left side, or Top side to Bottom.
     ------------------------------------------------------------------------------}

The side on which we should anchor
The size of the space to be left around the control when anchoring
The sibling control to which we should anchor
AnchorParallel
- instructions for anchoring beside another control

AnchorParallel - instructions for anchoring beside another control

Sibling - another control beside which the current control is to be anchored

The side on which we should anchor to the sibling
The size of the space to be left around the control when anchoring
The sibling control to which we should anchor in a parallel manner
AnchorHorizontal
- instructions for anchoring
Another control to which the current control is to be anchored, centred horizontally
AnchorVertical
- instructions for anchoring
Another control to which the current control is to be anchored, centred vertically
Sets the bounds (top. left, height, width) of the control.
[What's the difference between BoundsRect and ClientRect?] Does nothing but call ChangeBounds.
The X co-ordinate of the top left pixel of the control
The Y co-ordinate of the top left pixel of the control
The width of the control
The height of the control
Sets the bounds of the control initially, when it is created
Checks that this is a new control, then calls SetBounds to set up coordinates defining its position
SetBounds
X co-ordinate of top left pixel
Y co-ordinate of top left pixel
Width of control
Height of control
Set the bounds, keeping the base values
Returns default/preferred height and width, to be used in autosizing algorithms

GetPreferredSize - find default/preferred height and width

    procedure TControl.GetPreferredSize
            (var PreferredWidth, PreferredHeight: integer;
              WithThemeSpace: Boolean);

Returns the default/preferred width and height for a control, which are used by the LCL autosizing algorithms as default size. Only positive values are valid. Negative or 0 are treated as undefined and the LCL uses other sizes instead.

WithThemeSpace: If true, adds space for stacking.

For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be some space around. This space is theme dependent, so the parameter is passes to the widgetset

TWinControl overrides this and asks the interface for theme dependent values. See

TWinControl.CalculatePreferredSize for more information.

Mark the preferred size no longer valid, for this control and all parents (implies that we will look for another).

Create a new Control - Constructor. Overrides constructors of ancestor classes and sets a number of defaults. Often overridden by descendant classes.

Defaults set by the Constructor include ControlStyle, Constraints, BorderSpacing, Anchoring, alignment, CaptureMouseBottons, Color, Visibility, Hinting, Cursor, Font, The WindowProcedure to be used, the Help type, the FloatingDockSite and Enabled properties

TComponent.Create TLCLComponent.Create
Create
- constructor for

TControl
and derived classes: calls inherited

Create
and sets a number of defaults

Destructor for Control. Detaches control from parents, removes graphics, frees memory and Operating System handles, pointers etc.

Overrides destructors of ancestor classes, and in turn may be overridden by descendant classes.

TComponent.Destroy TLCLComponent.Destroy
Destroy
- Destructor for

TControl
. Detaches control from parents, removes graphics, frees memory and Operating System handles, pointers etc
EditingDone
- what to do when you have finished editing; calls the

OnEditingDone
event handler if assigned

TControl.EditingDone

Called when user has finished editing. This procedure can be used by data links to commit the changes.

For example:

- When focus switches to another control (default)
- When user selected another item

It's totally up to the control, what events will commit.

What to do when the RETURN button is pressed, signifying default action
What to do when ESCAPE is hit (or the CANCEL button is selected) - signifying CANCEL
If True, start dragging right now.
Minimum movement of cursor before dragging starts (in pixels); ignored if Immediate=True.
BeginDrag
- starts the dragging of a control. In this version BringToFront applies
If False, start drag only after the cursor has moved.
Bring the control to the front of the viewed screen
Returns True if Colour is stored
Function returns True if colour has been stored
HasParent
- returns True if there is a parent component responsible for streaming

HasParent - returns True if there is a parent component responsible for streaming

This function will be called during streaming to decide if a component has to be streamed by its owner or parent

TComponent.HasParent
Function returns True if there is a parent
This control is the parent of another (specified) control

This control is the parent of another control.

AControl: the control of which this is a parent.

Result: true if this is a parent

Function returns True if this control is a parent, ie there is a child control
The control of which this control is a parent (ie the Child control)
Returns True if the control is visible on the current desktop
Function returns True is control is visible
Hide
this control
Refresh
the data on this control
Repaint
the control, ie refill its canvas
Render this control non-valid
Function checks whether a particular child class is allowed
Function returns True if child class has been checked and is allowed
The child class which is being checked to see whether it is allowed
Boolean set to True if a non-valid class is found and an exception has been raised
Checks a new parent for this control
The new parent associated with this control
Send to back, ie place this control behind all other controls in the current screen; it will not be visible unless the controls in front are transparent
SetTempCursor
- set a temporary cursor
The temporary cursor which has been set
Update the roles for this form; see whether there have been any changes in its role
Gets text associated with the control from a buffer

    * The VCL implementation relies on the virtual Get/SetTextBuf to
     * exchange text between widgets and VCL. This means a lot of
     * (unnecesary) text copies.
     * The LCL uses strings for exchanging text (more efficient).
     * To maintain VCL compatibility, the virtual RealGet/SetText is
     * introduced. These functions interface with the LCLInterface. The
     * default Get/SetTextbuf implementation calls the RealGet/SetText.
     * As long as the Get/SetTextBuf isn't overridden Get/SetText
     * calls RealGet/SetText to avoid PChar copying.
     * To keep things optimal, LCL implementations should always
     * override RealGet/SetText. Get/SetTextBuf is only kept for
     * compatibility.

RealGetText GetText
Pointer to the buffer containing the text
Pointer to the buffer containing the string
Length of the buffer
Get the length of the specified text
Stores text associated with the control in a buffer

    * The VCL implementation relies on the virtual Get/SetTextBuf to
     * exchange text between widgets and VCL. This means a lot of
     * (unnecesary) text copies.
     * The LCL uses strings for exchanging text (more efficient).
     * To maintain VCL compatibility, the virtual RealGet/SetText is
     * introduced. These functions interface with the LCLInterface. The
     * default Get/SetTextbuf implementation calls the RealGet/SetText.
     * As long as the Get/SetTextBuf isn't overridden Get/SetText
     * calls RealGet/SetText to avoid PChar copying.
     * To keep things optimal, LCL implementations should always
     * override RealGet/SetText. Get/SetTextBuf is only kept for
     * compatibility.

RealSetText SetText
Pointer to the buffer where the text is to be stored
Perform
an Action specified by the message and parameters
Adjust from Screen co-ordinates to Client-relative co-ordinates
Convert from Client into Screen coordinates.
Adjust from Screen co-ordinates to Control-relative co-ordinates
Convert from control-relative co-ordinates to absolute screen co-ordinates
Makes the control visible.
Perform the Update method specified by the parent control (if there is one)
SetZOrder
- specify this control's place in the Z-order (ie front-to-back) of controls
HandleObjectShouldBeVisible
- returns True if the Handle Object is required to be visible
ParentHandlesAllocated
- returns True if the parent handles have been allocated
InitiateAction
- method to start the action associated with this control
AddHandlerOnResize
- method for adding a handler for the

OnResize
event
RemoveHandlerOnResize
- method for removing a handler for the

OnResize
event
AddHandlerOnChangeBounds
- method for adding a handler for the

OnChangeBounds
event
RemoveHandlerOnChangeBounds
- method to remove a handler for the

OnChangeBounds
event
The action to be associated with this control

// standard properties, which should be supported by all descendants

The (default) action to be associated with this control

Can either read the action already associated with the control (GetAction), or write an action to be associated (SetAction)

Used to align the control to the top, bottom, left or right of its client.

// standard properties, which should be supported by all descendants

Either reads a flag containing alignment instructions (FAlign) or writes alignment instructions (SetAlign)

May have no alignment, may have custom or client alignment, or can be aligned to top, bottom, left or right

TAlign
The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

Finds which side to use for anchor

// standard properties, which should be supported by all descendants

Finds which side is to be used to anchor this control, and what relationships it has to other controls nearby.

For complex relationships, use the Side property of the parent class TAnchorSide, and make a reference eg using asrCenter

Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

The TopLeft and BottomRight of the control in client coordinates.

The BoundsRect rectangle describes the TopLeft and BottomRight coordinates of the control, relative to its parent. The values are based on the Top, Left, Width and Height of the control.

Set BoundsRect to move the control.

Bounding rectangle (top-left, bottom-right) is defined in TRect

BoundsRectForNewParent
- get or set the bounding rectangle for a new parent control

The rectangle describes the placement of the control when its Parent is changed later.

Setting the rectangle also sets a flag, indicating that the values are available.

Caption
- the text-string appearing on the Control, usually used to identify its function

Gets caption as a text-string (GetText), or stores the new caption (SetText). Shows flag if caption is stored (IsCaptionStored).

By default, the Caption appears the same as the control Name in the Object Inspector, and the developer needs to set it explicitly to some new text.

The VCL implementation relies on the virtual Get/SetTextBuf to exchange text between widgets and VCL. This means a lot of (unnecesary) text copies.

The LCL uses strings for exchanging text (more efficient). To maintain VCL compatibility, the virtual RealGet/SetText is introduced. These functions interface with the LCLInterface.

The default Get/SetTextBuf implementation calls the RealGet/SetText. As long as the Get/SetTextBuf isn't overridden Get/SetText calls RealGet/SetText to avoid PChar copying.

To keep things optimal, LCL implementations should always override RealGet/SetText. Get/SetTextBuf is only kept for compatibility.

ClientHeight
- determines the height of the client within which the control exists

// standard properties, which should be supported by all descendants

Finds or sets the client height, and sets a flag if it has been stored

ClientOrigin
- Top left pixel of the client within which the control exists

// standard properties, which should be supported by all descendants

Finds origin of client (read-only)

The visible client area of the control.
The origin is always (0,0). Bottom and Right reflect the Width and Height of the control.
ClientWidth
- determines the width of the client within which the control exists

// standard properties, which should be supported by all descendants

ClientWidth - determines the width of the client within which the control exists; reads the width of the client control or sets the value. Sets flag if value is stored

Determine the colour for the current control

// standard properties, which should be supported by all descendants

Reads the value for colour, or stores the value, and sets a flag if the colour is stored.

The default colour is the same as the window in which the control is located.

Determine Constraints (max and min height and width) for this control

// standard properties, which should be supported by all descendants

Determine Constraints (max and min height and width) for this control; reads the size constraints or stores new ones.

ControlOrigin
- top left pixel of this control

// standard properties, which should be supported by all descendants

Reads value for the Origin (top left pixel) of this control. (read-only)

ControlState
- whether mouse has been clicked, data being read, control being re-drawn, etc

// standard properties, which should be supported by all descendants

ControlState - whether mouse has been clicked, data being read, control being re-drawn, etc. Reads or stores the state of the control.

ControlStyle
- whether the control responds to mouse clicks, can be re-sized, has particular actions, etc

// standard properties, which should be supported by all descendants

ControlStyle - whether the control responds to mouse clicks, can be re-sized, has particular actions, etc. Reads the stored style, or saves the new style

Whether the control is Enabled (read/write). If not, it usually appears 'greyed-out'
The font to be used for text in this control (read/write).
Reads or writes a flag to deterine whether this object is actually a control
// standard properties, which should be supported by all descendants
Reads a logical (boolean) flag or sets it to determine whether this object is a control.
Reads a flag to determine whether the mouse entered the control
// standard properties, which should be supported by all descendants
Reads logical (boolean) flag to see whether mouse has entered the control
Event handler for a change in bounds of the control

// standard properties, which should be supported by all descendants

Reads or Writes flag if bounds are changed

Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

Event Handler for resize of control

This event is triggered whenever the Width, Height, ClientWidth or ClientHeight of the control has changed. During autosize the size can change multiple times and only the last change triggers the OnResize. Use OnResize to react to resizes or to put your custom aligning, positioning code into this. To react to moves use the OnChangeBounds event.

Common mistake: Keep in mind that ClientWidth and ClientHeight can change even when Width, Height stays the same. For example when the theme or the font changes the Width, Height of a TForm, TGroupBox, TPageControl stays, but the frame changes and thus the ClientWidth, ClientHeight too. This does not happen that often under windows, but it happens quite often on other platforms.

Especially it is not sufficient to write only a TForm.OnResize handler to resize all controls on the form. This is a common bug in Delphi applications.

Event Handler when a hint needs to be shown
// standard properties, which should be supported by all descendants
Reads or Writes a flag when a hint (a small pop-up box, appearing when the mouse hovers over an object) is to be shown
PopupMenu
- a context-sensitive menu that pops up when the right mouse button is clicked over this control
// standard properties, which should be supported by all descendants
Reads the details of the pop-up menu, or stores them.
Properties are defined in the parent class TPopupMenu
Flag to determine: Is hint to be displayed for this control?
// standard properties, which should be supported by all descendants
Reads flag or writes one to determine if a hint is to be shown when mouse hovers over this control. If value is stored, a storage flag is set. Display of the actual hint is controlled by OnShowHint
OnShowHint
Visible
- can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
Reads or writes a message associated with this window
// standard properties, which should be supported by all descendants
Reads message from flag area, or stores a message
TWndMethod TLMessage
DockOrientation
- whether docking is oriented horizontally, vertically, according to pages or not at all
FloatingDockSiteClass
- reads or writes the class of the floating dock site
HostDockSite
- the host site to which this control is docked
LRDockWidth
- the docked width from left to right
TBDockHeight
- the docked height from top to bottom
UndockHeight
- the height of the undocked control
UnDockWidth
- the undocked width of the control
Anchor to the left side
Anchor to the Top
Anchor to the right side
Anchors to the bottom
The type of cursor to be used with this control
Left
- the coordinate of the left edge of the control
Height
- the vertical dimension of the control
Hint
- a small informative pop-up box that appears when the mouse 'hovers' over a control

Requires ShowHint to be True

Width
- the horizontal dimension of the control
The type of help to be used with this control - keyword or context
The keyword to be used for Help in this control
The context-sensitive help message to be used with this control
Integer type defining width of the border of a control
How Child controls are to be sized relative to parent
{ TControlChildSizing }

{ LeftRightSpacing, TopBottomSpacing: integer; minimum space between left client border and left most children. For example: ClientLeftRight=5 means child's Left position is at least 5.

HorizontalSpacing, VerticalSpacing: integer; minimum space between each child horizontally }

{ Defines how child controls are resized/aligned.

cesAnchorAligning, cssAnchorAligning Anchors and Align work like Delphi. For example if Anchors property of the control is [akLeft], it means fixed distance between left border of parent's client area. [akRight] means fixed distance between right border of the control and the right border of the parent's client area. When the parent is resized the child is moved to keep the distance. [akLeft,akRight] means fixed distance to left border and fixed distance to right border. When the parent is resized, the controls width is changed (resized) to keep the left and right distance. Same for akTop,akBottom.

Align=alLeft for a control means set Left leftmost, Top topmost and maximize Height. The width is kept, if akRight is not set. If akRight is set in the Anchors property, then the right distance is kept and the control's width is resized. If there several controls with Align=alLeft, they will not overlapp and be put side by side. Same for alRight, alTop, alBottom. (Always expand 3 sides).

Align=alClient. The control will fill the whole remaining space. Setting two children to Align=alClient does only make sense, if you set maximum Constraints.

Order: First all alTop children are resized, then alBottom, then alLeft, then alRight and finally alClient.

cesScaleChilds, cssScaleChilds Scale children, keep space between them fixed. Children are resized to their normal/advised size. If there is some space left in the client area of the parent, then the children are scaled to fill the space. You can set maximum Constraints. Then the other children are scaled more. For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and C.Width=30 (total=60). If the Parent's client area has a ClientWidth of 120, then the children are scaled with Factor 2. If B has a maximum constraint width of 30, then first the children will be scaled with 1.5 (A.Width=15, B.Width=30, C.Width=45). Then A and C (15+45=60 and 30 pixel space left) will be scaled by 1.5 again, to a final result of: A.Width=23, B.Width=30, C.Width=67 (23+30+67=120).

cesHomogenousChildGrowth, cssHomogenousChildDecrease Enlarge children equally. Children are resized to their normal/advised size. If there is some space left in the client area of the parent, then the remaining space is distributed equally to each child. For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and C.Width=30 (total=60). If the Parent's client area has a ClientWidth of 120, then 60/3=20 is added to each Child. If B has a maximum constraint width of 30, then first 10 is added to all children (A.Width=20, B.Width=30, C.Width=40). Then A and C (20+40=60 and 30 pixel space left) will get 30/2=15 additional, resulting in: A.Width=35, B.Width=30, C.Width=55 (35+30+55=120).

cesHomogenousSpaceGrowth Enlarge space between children equally. Children are resized to their normal/advised size. If there is some space left in the client area of the parent, then the space between the children is expanded. For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and C.Width=30 (total=60). If the Parent's client area has a ClientWidth of 120, then there will be 60/2=30 space between A and B and between B and C. }

Change
- software emulation of the

OnChange
event
Create
- constructor for

TControlChildSizing
: performs inherited

Create
then sets some default alignments and sizes

Create - constructor for

TControlChildSizing: performs inherited

Create then sets some default alignments and sizes

Overrides ancestors, may be overridden

TObject.Create
Assign
- if source is the same type as current control, copies a large number of explicit properties from source, else calls inherited

Assign
TPersistent.Assign
AssignTo
- calls the

Assign
method for the destination control
TPersistent.AssignTo
IsEqual
- returns True if the specified sizing is the same as the current value
The Control to which childsizing is to be applied
OnChange
- event handler for a chaange in sizing
EnlargeHorizontal
- make larger in the horizontal plane
EnlargeVertical
- make larger in the vertical plane
ShrinkHorizontal
- make smaller in the horizontal plane
ShrinkVertical
- make smaller in the vertical plane
LeftRightSpacing
- spacing from left to right
TopBottomSpacing
- spacing from top to bottom
HorizontalSpacing
- spacing in the horizontal plane
VerticalSpacing
- spacing in the vertical plane
TWinControlActionLink
- same as

TControlActionLink
TWinControlActionLinkClass
- class of

TWinControlActionLink
FWinControlFlags
- local variable to hold status flags
Create DockManager
AdjustClientRect
- method for adjusting the size and position of the client control
AlignControls
- align the specified control with a given client rectangle
DoAlignChildControls
- method for aligning child controls from a list; returns True if successful
DoChildSizingChange
- method for changing size of a child component
Dispatch a drag message, sent by the DragManager

On dmFindTarget a TWinControl returns the child control under the mouse, or Self if none is found.

All other messages are handled by .

CMShowingChanged
- control message when Showing property is changed
CMVisibleChanged
- control message when Visible property is changed
This component contains a specified control
ControlsAligned
- called by AlignControls after aligning controls
DoSendBoundsToInterface
- sends information about the control's bounds to the interface
RealizeBounds
- checks for changes and calls DoSendBoundsToInterface
CreateSubClass
- creates a sub-class using the supplied parameters
DoSetBounds
- anticipate the new clientwidth/height and call inherited method

Anticipate the new clientwidth/height and call inherited method

Normally the clientwidth/clientheight is adjusted automatically by the interface. But it is up to interface when this will be done. The gtk for example just puts resize requests into a queue. The LCL would resize the child components just after this procedure due to the clientrect. On complex forms with lots of nested controls, this would result in thousands of resizes.

Changing the clientrect in the LCL to the most probable size reduces unneccessary resizes.

DoAutoSize
- performs a lot of calculations and adjustments of child components in the window before automatically adjusting the size of the window itself

- Checks whether Autosize is in fact permitted
- Checks for unaligned child components and fits them in as best it can
- Moves the constrained (aligned) child components to the correct position
- Adjusts the size of the client rectangle
- Adjusts the bounds of the whole control

Because this method involves so much overhead, the simpler TControl.AdjustSize is often called instead.

TControl.DoAutoSize
CalculatePreferredSize
- calculates the default/preferred width and height for a TWinControl, which is used by the LCL autosizing algorithms as default size

procedure TWinControl.CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);

Calls the inherited method to calculate the default/preferred width and height for a TWinControl, which is used by the LCL autosizing algorithms as default size. Only positive values are valid. Negative or 0 are treated as undefined and the LCL uses other sizes instead.

TWinControl overrides this:

- If there are child components, their total preferred size is calculated
- If this value can not be computed (e.g. the children depend too much on their parent clientrect), then the interface is asked for the preferred size

For example the preferred size of a TButton is the size, where the label fits exactly. This depends heavily on the current theme and widgetset.

This value is independent of constraints and siblings, only the inner parts are relevant.

WithThemeSpace: If true, adds space for stacking. For example:

TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be some space around. This space is theme dependent, so it is passed as a parameter to the widgetset.

TControl.CalculatePreferredSize
GetChildren
- makes a list of all the child components for this control
TComponent.GetChildren
ChildClassAllowed
- returns True if the given child class is permitted
PaintControls
- method for painting a series of controls
PaintHandler
- message handler for painting
PaintWindow
- method for painting a window
CreateBrush
- method to create a brush for painting
CMEnabledChanged
- control message for a change in the

Enabled
property
CMShowHintChanged
- control message for a change in the

ShowHint
property
WMEraseBkgnd
- LCL message for erasing background
WMNotify
- LCL Notify message
WMSetFocus
- LCL Message to set focus
WMKillFocus
- LCL Message to kill focus
WMShowWindow
- LCL Message to show window
WMEnter
- LCL Message for entry to the control
WMExit
- LCL Message for exit from control
WMKeyDown
- LCL Message for a key down
WMSysKeyDown
- LCL Message for a system key down
WMKeyUp
- LCL Message for a key up
WMSysKeyUp
- LCL Message for a system key up
WMChar
- LCL Message signifying a character
WMSysChar
- LCL Message signifying a system character
WMPaint
- LCL Message for Paint
WMDestroy
- LCL Message for control destruction
WMMove
- LCL Message for movement
WMSize
- LCL Message for sizing control
CNKeyDown
- control message for key down
CNSysKeyDown
- control message for system key down
CNKeyUp
- control message for key up
CNSysKeyUp
- control message for system key up
CNChar
- control message specifying a character
Adjust the Parent of the docked Client.
The default action is to set the Parent to the new docksite (this control), so that the client is displayed within the new site.
Position DockRect, invoke OnDockOver (via DoDockOver)

Called on dragmanager messages dmEnter/Leave/Move, to get the DockRect to show.

Accept has been set to True, to signal acceptance.

Everything can be overridden by the OnDockOver handler, if installed.

Invoke the OnDockOver handler.
Perform special actions on removal of an docked client.
The default implementation does nothing.
Notifies an OnUnDock handler and DockManager of the undocked client control.
The OnUnDock handler can deny to undock the control.
Return information about this dock site (InfluenceRect).
The InfluenceRect determines the screen coordinates, within which a drop is accepted.
The InfluenceRect is the slightly inflated WindowRect of the dock site, adjustable in an OnGetSiteInfo handler.
Returns the docked control of the specified name.

The control is searched in the controls owned by the owner of this control.

Override to search other places, or to create a control of the requested name.

Returns the DockManager for this control.
If DockManager is nil, and UseDockManager is True, a new default DockManager is created.
Invoke the OnEnter event handler.
Invoke the OnExit event handler.
DoKeyDownBeforeInterface
- issues a message to the interface and returns True if a key was already down
DoRemainingKeyDown
- issues a LCL message and returns True if a key remains down
DoRemainingKeyUp
- issues a LCL message and returns True if a key remains up
DoKeyPress
- issues a LCL message and returns True if a key is pressed
DoUTF8KeyPress
- issues a LCL message and returns True if there has been a UTF8 key press
DoKeyUpBeforeInterface
- issues an interface message and returns True if a key was already up
ChildKey
- LCL message: returns True if this is a child key
ControlKeyDown
- contains the set of special keys (shift, control, alt, meta) that are pressed
ControlKeyUp
- contains the set of special keys (shift, control, alt, meta) that are not pressed ('up')
KeyDown
- emulate the action of pressing the specified key (makes

OnKeyDown
respond)
KeyDownBeforeInterface
- informs interface that the specified key (with defined shift state) was already pressed
KeyDownAfterInterface
- informs interface that the specified key (with defined shift state) was pressed after an event
KeyPress
- simulates the action of pressing the specified key
KeyUp
- emulates the action of a key being released (makes

OnKeyUp
respond)
KeyUpBeforeInterface
- informs interface that the specified key (with defined shift state) was already up
KeyUpAfterInterface
- informs interface that the specified key (with defined shift state) was released (up) after an event
UTF8KeyPress
- simulates the action of pressing the specified (UTF8) key
FindNextControl
- returns the next control on the list; optionally checks if it is a TabStop or a parent control
GetBorderStyle
- returns the style of the border

Returns the screen coordinate of the topleft coordinate 0,0 of the control area. (The topleft pixel of the control on the screen)

Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.
The screen coordinates of the control.

Returns the screen coordinates of the topleft pixel of the control on the screen.

Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.
IsControlMouseMsg
- returns True if the specified message is a control mouse message
CreateHandle
- generates an operating system handle
CreateParams
- create parameters for this windowed class

CreateParams - create parameters for this windowed class

Definition of parameters:

    TCreateParams = record
        Caption: PChar;
        Style: Cardinal;
        ExStyle: Cardinal;
        X, Y: Integer;
        Width, Height: Integer;
        WndParent: HWnd;
        Param: Pointer;
        WindowClass: TWndClass;
        WinClassName: array[0..63] of Char;
    End;

CreateWnd
- Creates the Window

Creates the interface object, sets parameters and assigns the handle

DestroyHandle
- removes the handle for this window
DestroyWnd
- destroy the window for this control

Removes handles and restores colour and font flags

DoFlipChildren
- reverses the order of the children
FixupTabList
- renders the Tab list into a suitable state
InitializeWnd
- initialise the window for this control

InitializeWnd - initialise the window for this control

Gets called after the Handle is created and before the child handles are created

Works out the correct bounds, sets style, fonts and colours, performs any pending resize operations

Loaded
makes a number of checks, using client size if specified, and copying appropriate flags, fonts, text etc, makes list of child controls to notify them of any changes, then calls inherited

Loaded
TControl.Loaded
MainWndProc
- issus a LCL message that this is the main window procedure
Called after all children handles of the ParentForm are created. Tells all wincontrols about the final end of the handle creation phase
TControl.ParentFormHandleInitialized
ChildHandlesCreated
- called after a child's handles are created
ReAlign
- realign all children
RemoveFocus
from this WinContro
SetBorderStyle
- specify the style for the border
ShowControl
- method for showing the specified control
UpdateControlState
- update the state of the control
UpdateShowing
- update the value of the

Showing
property
WndProc
- makes specific reactions according to the message passed, then calls inherited

WndProc

LM_SETFOCUS: gets parent form and show this control as focused

LM_KILLFOCUS: removes focus fromthis control

LM_NCHITTEST: check transparency etc

Mouse and Button messages: process any docking instructions

TControl.WndProc
BorderStyle
- none, or single
OnGetSiteInfo
- event handler for finding out information about the (docking) site
Property to determine width of the window's border
// properties which are supported by all descendants
Either reads a flag to find the width or sets the width.
Default is set to zero.
Finds how many of the Bounds are locked
// properties which are supported by all descendants
Find which type of brush to use for drawing the control
Stored value of client height (read-only).
Stored value of Client Width (read-only).
Definitions how any child control is to be sized (read/write).
The number of controls associated with this window (read-only).
The indexed list of child controls in this window (read-only).
Numerical value to identify the control within the window
The default procedure to be associated with the window
// properties which are supported by all descendants
reads or writes a flag to define what is the default procedure
The number of clients docked into this control.
The docked controls can be accessed inDockClients[]. DockClientCount is equivalent to DockClients.Count, but handles also the special case when DockClients is Nil.
The indexed list of controls docked into this control
Index of the docked client.
The docking layout manager for this control.

A docksite can be managed (using an DockManager) or unmanaged (positioning docked controls in the event handlers). The DockManager determines the placement of docked controls, by setting DropOnControl and DropAlign before the drop, and by resizing and positioning the control when it's dropped.

A DockManager is used only when UseDockManager also is True. Setting UseDockManager to True creates an DockManager of the DefaultDockManagerClass for this docksite, if none was previously installed.

An unmanaged docksite, without an DockManager, can handle the placement of dropped controls in the OnDockOver and OnDockDrop event handlers.

Is this a dock site? (read/write, default is False)
Enable this to use the DockManager automatically. For example to call DockManager.ResetBounds when the control resizes.
Is painting of this window double buffered? (read/write)
Operating System Handle for identifying and manipulating this window (read/write).
Is the window being re-sized?
Reads or writes flag to indicate re-sizing
The place this control occupies in the list of tabs
Reads or writes information in flag; default is -1
Is the control in the sequence of controls accessed by successive presses of the Tab key?

Use the TabStop to allow or disallow access to the control using the Tab key.

If the TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't press the Tab key to move to the control.

Event handler for the drop of a control to be docked.
Event handler for moves of a control over this docksite.
OnEnter
- event handler for when the mouse enters the control, and the control receives focus
OnExit
- event handler for when the mouse leaves the control and it loses focus
OnKeyDown
- event handler for instance when key is down while control has focus

OnKeyDown - event handler for instance when key is down while control has focus

Differs from OnKeyPress in that the key may have already been down when the control received focus; with OnKeyPress the key needs to become pressed while the control has focus.

OnKeyPress - event controller for a key being pressed while the control has focus. To properly handle national chars use UTF8KeyPress instead.

OnKeyPress - event controller for a key being pressed while the control has focus

Differs from OnKeyDown in that the key needs to become pressed while the control has focus; with OnKeyDown the key may have already been down when the control received focus.

Note: we recommend you to use OnUTF8KeyPress to prevent data lost. National chars are converted from UTF8 to the system encoding in OnKeyPressEvent. This can cause a data lost if symbol cannot be converted, which means OnKeyPress is not called or with Char=#0. OnUTF8KeyPress does not perform this conversion.

OnKeyUp
- event handler for instance when a key is up (not pressed) while the control has focus

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

The key may already have been up when the control received focus, or a pressed key may become released during the time the control has focus.

Event handler for any movement of the mouse wheel
Event handler for downward movement of the mouse wheel
Event handler for upward movement of the mouse wheel
Event handler for control becoming disconnected (undocked) from parent.
UTF8KeyPress - event controller for a key being pressed while the control has focus.

OnUTF8KeyPress - event controller for a key being pressed while the control has focus

Differs from OnKeyDown in that the char does not converts to the system encoding

ParentCtl3D
- does it inherit Ctl3D properties from parents? (Deprecated)
Is the window showing? (similar to Visible in other contexts)
Create DockManager for docking (read/write)
The DockManager is created via a call to CreateDockManager.
The number of visible docked controls.
BeginUpdateBounds
- start updating the bounds of the current WinControl
EndUpdateBounds
- finishes updating the bounds setting
LockRealizeBounds
- make the realized bounds unaccessible
UnlockRealizeBounds
- unlock the previously locked realized bounds
Get the child control at the given client position.
capfHasScrollOffset: Take into account scroll offset of scrollable wincontrol. (when not???) capfWinControls: skip wincontrols if False (when???) capfRecursive: find child of wincontrol

WinControls are found before Controls (if overlapping).
Returns the child control at the specified client coordinates.
Returns the child control at the specified client coordinates.
DoAdjustClientRectChange
- perform any adjustments needed when the client rectangle changes
InvalidateClientRectCache
- render invalid any information in the client rectangle cache
ClientRectNeedsInterfaceUpdate
- True if update needed
Sets the control bounds and adjusts child and docked controls.
CreateParented
- constructor for a window that is the child of a specified parent
CreateParentedControl
- returns a newly created window control that has a specified window as its parent
Destroy
- destructor for

TWinControl
and derived classes. Removes handles and docked controls, frees resources, then calls inherited

Destroy

Destroy - destructor for

TWinControl and derived classes

Destroys any allocated handles, removes any docking links, and frees the resources used by the control, then performs inherited Destroy

Overrides ancestor destructors, and may in turn be overridden

TControl.Destroy
A dragged control has been dropped onto this docksite
Asks the dropped control to dock itself into the target control, updating its Parent, HostDockSite and the DockClients of the old and new DockSite. When a DockManager is installed, asks the DockManager to position the docked control (InsertControl). Finally sends an OnDockDrop event.
CanFocus
- is the current window allowed to receive focus?
GetControlIndex
- find the index value for the given control
SetControlIndex
- set a new index value for the given control
Focused
- is the current window receiving focus?
PerformTab
- perform a tab - is it in the forward direction?
ControlByName
- returns the identity of a control whose name is given as an argument
SelectNext
- move to the next windowed control and give it focus
BroadCast
- send

ToAllMessage
to all recipients
NotifyControls
- send

Msg
(a message) to all controls
DefaultHandler
- performs

CallDefaultWndHandler
TObject.DefaultHandler
EnableAlign
- turn on the alignment process
InsertControl
- insert the specified control into the list, optionally with the specified index
RemoveControl
- remove the specified control from the list
FindChildControl
- find what controls are descended from the current one
FlipChildren
- reverse the order of the child components
GetTabOrderList
- find the list with the Tab Order
HandleAllocated
- find if the operating system has allocated a handle to this control
HandleNeeded
- tell the Operating System that this control requires a handle
BrushCreated
- has a brush been created for this control?
EraseBackground
- remove all material from the background
IntfUTF8KeyPress
- returns the UTF8 value of the pressed key from the interface
TGraphicControl
is the base class for all lightweight controls.

TGraphicControl supports simple lightweight controls that do not need the ability to accept keyboard input or contain other controls.

Since lightweight controls do not wrap GUI screen objects, they are faster and use fewer resources than controls based on TWinControl.

TGraphicControl provides a

Canvas property for access to the control's drawing surface and a virtual

Paint method called in response to paint requests received by the parent control.

A reference to the parent's Canvas.
The canvas isn't "owned" by the TGraphicControl, but by its parent.
Virtual Paint method called in response to paint requests.
Virtual Paint method called in response to paint requests received by the parent control.
Create
- constructor for

TGraphicControl
: performs inherited

Create
then creates local

Canvas

Create - constructor for

TGraphicControl: performs inherited

Create then creates local

Canvas

Overrides ancestor and may be overridden

TControl.Create
Destroy
- destructor for

TGraphicControl
: frees local canvas and performs inherited

Destroy

Destroy - destructor for

TGraphicControl: frees local canvas and performs inherited

Destroy

Overrides ancestor destructors, and may be overridden

TControl.Destroy
A clipping window to the parent canvas.

The TGraphicsControl.Canvas is a clipping window to the parent canvas.

If you ask for the Canvas.Width or Canvas.Height, you are actually getting the parent control's Canvas dimensions.

To get the dimensions of the TGraphicControl, you must query the ClientRect.

TCanvas
OnPaint
- event handler for request to paint canvas
TCustomControl
- a base class for many window controls

Contains simple basic definitions to create, destroy and paint window controls and set basic properties like canvas and border

TWinControl TControl
WMPaint
- LCL message for painting
Paint handler plug-in
This is a plug-in in TWinControl to get the DC,
assign it to our canvas and call the paint method for
descendants to do the actual painting
TWinControl.PaintWindow
The Device Context in which to paint
Create
- constructor for

TCustomControl
: performs inherited

Create
, then creates local

Canvas
and sets

DoubleBuffered
to be False
TControl.Create TWinControl.Create
Owner, ie the component that called this control
Destroy
- destructor for

TCustomControl
: frees local

Canvas
then performs inherited

Destroy

Destroy - destructor for

TCustomControl: frees local

Canvas then performs inherited

Destroy

Overrides ancestor destructors, may be overridden

TControl.Destroy TWinControl.Destroy
If the custom control has been destroyed, free its handle as well
The default paint handler for the class
If using a control derived from this parent, the developer needs to write a specific paint handler to override this one
The area of a control on which its components are drawn or painted
The Canvas is the area of screen on which the various components are drawn.
This inherits its properties from TCanvas,
and that description should be read to understand their definitions more fully.
TCanvas
Only a restricted series of options is available: none or a single border.
Event handler for painting
A list of images, as used for dragging.
Represents an node in an .
It encapsulates a dock zone, containing either other zones or a single control.
GetHeight
- returns height for dock zone
GetLeft
- returns the position of the left hand border
GetLimitBegin
- returns the limit for the beginning of the zone
GetLimitSize
- returns the limit for the size of the zone
GetTop
- returns the position of the top
GetVisible
- returns the

Visible
status
GetVisibleChildCount
- returns the number of visible children
GetWidth
- returns the width of the zone
GetNextVisibleZone
- returns the next visible zone

Create - constructor for

TDockZone: sets local variables to show the

Tree to which the zone belongs and the

ChildControl which it contains, sets default bounds and then performs inherited

Create

Overrides ancestor constructors, and may be overridden

Create
- constructor for

TDockZone
: sets local variables to show the

Tree
and the

ChildControl
, sets default bounds and then performs inherited

Create
TObject.Create
The dock tree to which this zone belongs
FirstVisibleChild
- returns the first visible child zone
NextVisible
- returns next visible
PrevVisible
- returns the previous visible
The dock tree of which this dock zone is a part
The number of child controls for docking
The height of the Dock Zone
The position of the left side to the control
The beginning limit of the DockZone (Left or Top)
The size of the limits of the DockZone (Width or Height)
The top coordinate of this control
Is the control visible?
VisibleChildCount
- the number of visible child controls
The width of this control
Class of .
TDockTreeClass
- class of

.
A docking manager for tree-style layouts.

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.

Both the TLazDockTree and TCustomAnchoredDockManager implementation never was finished, due to problems with the anchor "docking" mechanism.

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

AdjustDockRect
- adjust the docking rectangle for AControl
ARect initially describes the dockzone into which the control is docked. From that area the zone decoration is excluded, so that ARect describes the area reserved for the docked control.

AdjustDockRect is not part of the general docking model. It can implemented and used for any purpose in a dock tree manager. Most docking managers will replace it by a method with more arguments, that allow to identify the zone and its properties immediately.
HitTest
- performs a Hit test at the specified mouse position, and returns the Control present there
InsertControl
- position

DropCtl
relative

Control
, using the alignment specified by

InsertAt
InsertControl determines the layout and appearance of the just docked control, forcing a repaint of the container control if necessary.

When SetReplacingControl has been called with a non-Nil Control before, the dropped control only should replace that control.

A tree docking manager organizes the docksite into layers of horizontol or vertical orientation. As long as no more than one control is docked into a docksite, the tree has no orientation at all. The second docked control determines the orientation of the docksite and the dock tree. All further drops are either isogonal (in direction of the zone orientation) or orthogonal (opposite to the zone orientation). On an isogonal drop a new leaf zone is created for the dropped control, as a sibling of the already existing child zones. On an orthogonal drop the zone containing the DropControl becomes the root of another subtree, whose initial members are the leaf zones for Control and DropCtl.

One value of InsertAt (alCustom) is reserved for notebook docking, where DropCtl is replaced by a tabbed notebook, and Control and DropCtl are moved into pages of the notebook. The notebook is a docksite of its own, further drops into the notebook are handled by the notebook itself, the DockManager of the host docksite is not involved.
PaintDockFrame
- paints the nominated control's canvas at the specified position
UpdateAll
- bring all data up to date
DockSite
- the site for docking
Create
- constructor for

TDockTree
: sets up the

DockSite
, performs inherited

Create
and sets default

BorderWidth
, creates the

RootZone
for the Tree

Create - constructor for

TDockTree: sets up the

DockSite, performs inherited

Create and sets default

BorderWidth, creates the

RootZone for the Tree

Overrides ancestor constructors, may be overridden

TObject.Create
The window control that is to be the site for docking
Destroy
- destructor for

TDockTree
: deletes the

RootZone
then performs inherited

Destroy

Destroy - destructor for

TDockTree: deletes the

RootZone then performs inherited

Destroy

Overrides ancestor destructors, and may be overridden

TPersistent.Destroy
DockZoneClass
- the class of dock zone
Some properties of the Mouse.
Contains information about current mouse position, whether messages are captured by an object, whether it is dragging an object, and how far the mouse must move before a control starts dragging.
Create
- constructor for

TMouse
: calls inherited

Create
TObject.Create
Can be a locally defined method to override the method specified by the parent object
Destroy
- destructor for

TMouse
: calls inherited

Destroy
TObject.Destroy
System handle for the captured object
Reads or writes a system variable identifying the captured object
The screen position of the cursor
Reads or writes a variable to determine the position of the cursor (a point with X, Y co-ordinates)
Does the object get dragged as soon as the mouse moves?
Reads or writes a flag to determine whether to move the object immediately the mouse moves: default is true
The least distance the mouse must move before the captured object is moved
Reads or writes a flag to deterine the threshold movement (if DragImmediate was false). Default is 5 pixels
Is the mouse being used to drag an object?
Array of names for the elements.
The names include the "al;" prefix, e.g. alNone.
Get control at screen position.
Disabled controls should be excluded, but are not due to an bug in FindControlAtPosition.
Get control at screen position.
When AllowDisabled is True, also a disabled control will be found. In the current implementation AllowDisabled is ignored (assumed to be True).

First a window at the given screen position is searched, then a control within it.
Return the TWinControl of the given Handle.

The result is very interface specific. Use FindOwnerControl when Handle may be a non-TWinControl handle.

Returns the TWinControl for the given Handle; the parent control for a non-TWinControl Handle.

Handle can also be a child handle (of a TControl), in which case the returned control is the parent of the desired control. Parent, not Owner as suggested by the function name![?]

[Remark] The function recursively tries GetParent(Handle), so the result depends on the implementation (meaning) of a parent handle.

Returns a string for the name of the cursor as identified by an integer constant
Calls CursorToIdent to find correct entry in look-up table
Returns a string with the name of the cursor type corresponding to the integer constant
StringToCursor
- returns the cursor value corresponding to the name supplied

StringToCursor - returns the cursor value corresponding to the name supplied

Finds the numeric cursor value corresponding to the name S in the cursor look-up table

The numeric cursor value from the look-up table
The name of the cursor for which the numeric value is sought
Uses look-up table to find cursor identifier corresponding to integer cursor constant
Returns true if a valid entry is found in the look-up table
Searches the Cursor name table for the given cursor name; returns True if found.
If found, the cursor value (handle[?]) is returned in Cursor.
Returns True if a valid entry was found in the look-up table.
The name of the cursor for which the numeric value is sought.
The numeric value of the named cursor.
Adjust space round border of this control

RemainingClientRect: remaining clientrect without CurBorderSpace

CurBorderSpace: current borderspace around RemainingClientRect

Left, Top, Right, Bottom: apply these borderspaces to CurBorderSpace

CurBorderSpace will be set to the maximum of CurBorderSpace and Left, Top, Right, Bottom.

RemainingClientRect will shrink.

RemainingClientRect will not shrink to negative size.

Register the components provided by this unit or package, so that they can be instantiated.
Also can be used to register the controls required by an application.[?]
BiDiMode
- enabling bi-directional writing
Allows Languages such as Arabic and Hebrew to be used
ParentBiDiMode
- does the control follow the BiDiMode settings of its parent?
Initialize
the list of images for dragging
TCustomImageList.Initialize
BeginDrag
- start the drag process; returns True if successful
DragLock
- returns True if dragging has been locked for the specifies window at given location
DragMove
- move dragged images to specified location and return True if successful
DragUnlock
- unlock the list of images for dragging
EndDrag
- retuns True if the drag process has ended
HideDragImage
- method for making dragged image invisible
Determines the image to be shown
ShowDragImage
- display the dragged image
DragCursor
- the cursor for use during the dragging process
DragHotspot
- the position of the HotSpot (usually the pointer of the cursor)
Dragging
- True if dragging is proceeding
Remembers the dragged control.
TObject.Create
Should the image of dragged objects always be shown?
This is another chance for enforcing the display of a drag image, even if a drop is acceptable. [where to describe the various conditions?]
The control that is dragged (source).
Determines whether the dock site shall be enlarged.
Not normally used, perhaps a special AnchorDocking property?
The currently visible DockRect, to be removed later.
A special value indicates that the DockRect already has been removed.
The abstract base class for managing the dragging of controls (to be dropped or docked).

This is the OO version of the Delphi drag manager, implemented in TDragManagerDefault.

The registered dock sites should be stored in a persistent list, not in a DragManager instance.

[entire review DoDi 2010-02-16]

Handler for keyboard key released.
When the Ctrl key is released, a drop is enabled again.
Handler for keyboard key pressed.

When (and while) the Ctrl key is pressed, dropping is disabled.

The Esc key aborts the current dragging operation immediately.

Aborts the dragging operation, when the capturing control really has changed.
Generates the visual feedback when the mouse moves.
Ends dragging.
Nop.
Initializes the Delphi default dragging parameters.

The Delphi VCL sets DragImmediate=True and DragThreshold=5.

A docking operation never should start immediately.

TComponent.Create
True if dragging is in progress.
True if the specified control is being dragged.
Adds or removes the control to the list or register of docking sites.

This should become a class method, maintaining the list of registered docking sites outside any DragManager instance.

Starts dragging.
A DragObject must be created, depending on the Control.DragKind. The mouse has to be captured, and visual feedback must be initialized.
Updates the visual dragging feedback.
DragStart
Ends dragging.

The visual feedback is reset.

All related controls are notified of the outcome of the operation (drop, dock, abort).

Finally all temporary objects are destroyed.

Start dragging immediately, on MouseDown? (default value)
The threshold amount by which the mouse must move before non-immediate dragging starts. (default 5 pixels)
The current DragManager.
GetSideSpace
- finds th espace requied at the side for the specified anchor kind
Amount of pixel added to the widgetset's preferred size
When calculating the preferred size of control, the LCL asks first the widgetset. For controls like TButton the widgetset can return a preferred size. The InnerBorder is added twice to this size. If the widgetset does not return a preferred size, the InnerBorder is not used.
CellAlignHorizontal
- the sort of horizontal alignment to use if a cell is being aligned
CellAlignVertical
- the sort of vertical alignment to use if a cell is being aligned
Destroy
- destructor for

TAnchorSide
: removes all anchoring links then calls inherited

Destroy
TPersistent.Destroy
Sets AutoSizing=true, used to prevent loops.
End the autosizing process, reset AutoSizing to False.
Procedure invoked when the anchor side of a different control (not the current) is changed
Function to find if details of border spacing are stored
Checks for changes and calls DoOnChangeBounds
Determine if a parent control is involved in the alignment process
Logical client area, can be bigger than the visible client area.
A TScrollingWinControl has a logical client area, of which only a portion can be visible. The origin always is (0,0), regardless of an ScrollOffset.
Is Client Width Stored?
Protected messages to system - when context menu is required
Control Message for a change in the control's text
Get the list of Images to be dragged - returned as a list
Handler called when the control starts floating.

Since TControls cannot float for themselves, a FloatHost site is created and the control is docked into it.

When the control already has a Parent (FloatHost site), the Parent's position and extent is adjusted to fit the DockRect as its ClientRect

Returns the default string for the dock caption, control's Name.
UpdateMouseCursor
- ensure co-ordinates

X, Y
for the cursor are correctly stored
FormEndUpdated
- the update for the Form has ended
ParentFontChanged
- method for dealing with a change in the font of the parent
Procedure to deal with changes in text
GetCachedText
- method for retrieving caption text from cache; returns True if successful
VisibleChanged
- method to use when the

Visible
property has changed
DoCallNotifyHandler
- calls a Notify Handler of the specified type
NeedParentForAutoSize
: True - need to know parent's properties to do autosize. False - can autosize independently
AnchorToCompanion
- anchor to another control, not necessarily an immediate neighbour
Anchor on the same side as a sibling
AnchorAsAlign
- Anchor following same rules as Align
Anchor to the client space
The number of controls anchored to this one
The indexed list of controls anchored to this one
Find default width (by reference to ancestor)
Find the default height (by reference to ancestor)
Find the default size for this class of controls (by reference to parents)
Find which side is being used for anchoring
CNPreferredSizeChanged
- issue control signal to show that preferrd size has changed
Find out the required anchor settings by reference to the parents
Turn off automatic sizing - implies that default is accepted or sizing is done manually
Turns on (enables) automatic sizing
The rectangle defining [what?].
ReadBounds
- find out what bounds have been defined
Used for debugging
Find which control is the top parent (ie ultimate ancestor)
Is the control visible on the current desktop?

Does not check for invisible parents

True if the form is being updated
The active default control has changed to NewControl
ParentDestroyingHandle
- returns True if the parent control is destroying the Handle
Procedure for displaying the Help associated with this control
Indicates that this control has an entry in the Help-file
AddHandlerOnVisibleChanging
- method for adding a handler for the

OnVisibleChanging
event
RemoveHandlerOnVisibleChanging
- method to remove a handler for the

OnVisibleChanging
event
AddHandlerOnVisibleChanged
- method for adding a handler for the

OnVisibleChanged
event
RemoveHandlerOnVisibleChanged
- method to remove handler for the

OnVisibleChanged
event
Which mouse button(s) to be used for capture? Default left button, but may be a set of up to three
Is the BiDi mode stored?
SetBiDiMode
- specifies the BiDi mode
SetParentBiDiMode
- specifies the BiDi mode for the parent control
CMBiDiModeChanged
- issues control message when BiDi mode is changed
CMParentBiDiModeChanged
- issues a control message when the parent control's BiDi mode is changed
UseRightToLeftAlignment
- as opposed to usual left to right
Needs BiDiMode enabled
UseRightToLeftReading
- as opposed to usual left to right
Needs BiDiMode enabled
UseRightToLeftScrollBar
- as opposed to usual left to right
Needs BiDiMode enabled
IsRightToLeft
- as opposed to usual left to right
Needs BiDiMode enabled
SetGridSpacing
- specifies a value for spacing on the grid (for drawing etc)
Layout
- L-R then Top-Bottom, or Top-Bottom then L-R (or none)
ControlsPerLine
- number of controls per line
Flags for finding a control at given (client) position.
capfAllowDisabled: include disabled controls? capfAllowWinControls: do not find WinControls if False. capfOnlyClientAreas: hit client areas only. capfRecursive: search into child controls. capfHasScrollOffset: crap, ScrollOffset is taken into account only for the first (top level) WinControl.
CreateControlAlignList
- creates a list of the controls that are aligned with the present window control
ResizeDelayedAutoSizeChildren
- method for re-sizing children, using autosize delayed
Handles dmDragDock message, when a control has been docked to this site.

Called when a control is dropped for docking.

Asks the dropped control to Dock itself into this control (adjust HostDockSite etc.).
Calls an installed DockManager to adjust the coordinates of the docked control.

The Result is always True (unless overridden).

Notifies the DockManager of the undock of a client control; always returns True.
DoSendShowHideToInterface
- send the Show/Hide status to the interface
RealizeBoundsRecursive
- perform

RealizeBounds
in a recursive manner
CMBiDiModeChanged
- control message for a change in the

BiDiMode
property
Handler called when the control starts floating.
TWinControls can float for themselves, unless they request a special FloatingDockSiteClass.

[Bug: when no FloatingDockSiteClass was assigned, a default floating site is created?]
Calls an OnGetDockCaption handler, to adjust the dock-caption for the docked control.
SendDialogChar
- LCL key message: returns True if a dialog character has been sent
SelectFirst
- select the first control on the list
FinalizeWnd
- getting ready to remove window (gets called before the Handle is destroyed)
FormEndUpdated
- calls inherited

FormEndUpdated
then informs each child control
TControl.FormEndUpdated
SetChildZPosition
- specify the position of the child control in the Z plane (ie front-to-back)
WSSetText
- writes the name of the current widget set to a local variable
OnGetDockCaption
- event handler to find the caption for the docked control
AddControl
- add this control to the list of controls
Returns the caption for the docked control.
PaintTo
- Paint to a specified position on the canvas
SetShape
- make the specified shape appear on the Window
AllocBy
- for allocation
BlendColor
- the colour for blending
FindZone
- returns the Dockzone for the nominated control
AddAsFirstChild
- add a new zone as the first child
AddAsLastChild
- add an new zone as the last child
ReplaceChild
- replace the

OldChild
zone with the

NewChild
GetLastChild
- returns the last child zone
GetIndex
- returns the index of the current zone
Remove
the nominated child zone
The child control to be docked here
The first child control in the list of controls for docking
Whether docking is oriented vertically, horizontally, in pages, or not at all

doNoOrient : zone contains a TControl and no child zones.

doHorizontal : zone's children are stacked top-to-bottom.

doVertical : zone's children are arranged left-to-right.

doPages : zone's children are pages arranged left-to-right.

The parent dock zone to which this control is docked
The next sibling (related control atthe same level) in the list of docked controls
The previous sibling (control at the same level) in the list of docked controls
SetDockZoneClass
- specifies the class of dock zone
RootZone
- the zone that forms the root of the current Dock Tree
WheelScrollLines
- the number of lines the the scroll wheel has traversed
Anchor to the bottom
The height of this control
OnMouseWheel
- event handler for a movement of the mouse wheel
OnMouseWheelDown
- event handler for downward movement of mouse wheel
OnMouseWheelUp
- event handler for upward movement of mouse wheel
InvalidatePreferredChildSizes
- renders the preferred child sizes invalid
Was the drag object created automatically?
This property is of little use, more important is the AutoFree property.
Called when a dragging operation ends.
The default implementation calls source.DoEndDrag, which in turn invokes an OnEndDrag handler.
The hotspot offset of the dragged DockRect.
MouseMessage
- message sent to system for mouse events
Returns True if the DockManager should be destroyed together with the docksite.

This is a Lazarus specific extension of the Delphi TDockManager. It allows multiple docksites to share the same DockManager instance.

Protected message to system - when mouse wheel moves
DoMouseWheel
- performs the action to deal with a movement of the mouse wheel; returns True if handled
DoMouseWheelDown
- performs the action for a downward movement of the mouse wheel; returns True if handled
DoMouseWheelUp
- performs the action for an upward movement of the mouse wheel; returns True if handled
CreateControlBorderSpacing
- calls

TControlBorderSpacing.Create
to create the border spacing for this control
TControlBorderSpacing.Create
Protected message to system for CancelMode
Control Message when a special key is needed
CustomAlignInsertBefore
- returns True if the

OnAlignInsertBefore
event handler has been assigned and executes successfully
CustomAlignPosition
calls the

OnAlignPosition
event handler to make a highly specified alignment
CMBorderChanged
- ControlMessage for a change in the

Border
property
OnAlignInsertBefore
- event handler for an aligned insertion before action
OnAlignPosition
- event handler for supplying align position
AddSibling
- insers a new sibling control into the dock zone
DumpLayout
- stores layout in a file
SetLimitBegin
- specifies the limit for the beginning of the zone
SetLimitSize
- specifies the limit for the size of the zone
SetHeight
- specifies the height of the zone
SetLeft
- specifies the left side of the zone
SetTop
- specifies the top of the zone
SetWidth
- specifies the width of the zone
AutoSize
- boolean property that permits the size of a control to be adjusted automatically

AutoSize is a boolean property found in many classes; it permits the size of a control to be adjusted automatically to accommodate differences in the text or graphic contained therein, and allows most efficient use of available space

Many controls call TControl.DoAutoSize to perform the actual auto-sizing.

IMPORTANT: Many Delphi controls override this method and many call this method directly after setting some properties.

During handle creation not all interfaces can create complete Device Contexts which are needed to calculate things like text size.

That's why you should always call AdjustSize instead of DoAutoSize.

TControl.AdjustSize calls

DoAutoSize in a smart fashion.

During loading and handle creation the calls are delayed.

This method initially does the same as TWinControl.DoAutoSize. But since DoAutoSize is commonly overriden by descendant components, it is not useful to perform all tests, which can result in too much overhead. To reduce this the LCL calls AdjustSize instead.

When setting AutoSize = true the LCL autosizes the control in width and height. This is one of the most complex parts of the LCL, because the result depends on nearly a hundred properties. Let's start simple:

The LCL will only autosize the Width or Height if it is free to resize. In other words - the width is not autosized if:

- the left and right side is anchored. You can anchor the sides with the Anchors property or by setting the Align property to alTop, alBottom or alClient
- the Width and Height are bound by the Constraints properties. The Contraints can also be overriden by the widgetset. For example the winapi does not allow resizing the height of a combobox. And the gtk widgetset does not allow resizing the width of a vertical scrollbar

The new size is calculated by the protected method TControl.CalculatePreferredSize. This method asks the widgetset for an appropriate Width and Height. For example a TButton has preferred Width and Height. A TComboBox has only a preferred Height. The preferred Width is returned as 0 and so the LCL does not autosize the Width - it keeps the width unaltered. Finally a TMemo has no preferred Width or Height. Therefore AutoSize has no effect on a TMemo.

Some controls override this method. For example the TGraphicControl descendants like TLabel have no window handle and so cannot query the widgetset. They must calculate their preferred Width and Height themselves.

The widgetsets must override the GetPreferredSize method for each widget class that has a preferred size (Width or Height or both).

Parent.AutoSize

The above described the simple explanation. The real algorithm provides far more possibilities and is therefore far more complex.

Properties / Methods

- Left
- Top

If Parent is not nil then Left, Top are the pixel distance to the top, left pixel of the parent's client area (not scrolled). Remember the client area is always without the frame and scrollbars of the parent. For Delphi users: Some VCL controls like TGroupbox define the client area as the whole control including the frame and some not - the LCL is more consistent, and therefore Delphi incompatible. Left and Top can be negative or bigger than the client area. Some widgetsets define a minimum/maximum somewhere around 10.000 or more.

When the client area is scrolled the Left and Top are kept unchanged.

During resizing/moving Left and Top are not always in sync with the coordinates of the Handle object.

If Parent=nil then Left, Top depend on the widgetset and the window manager. Till Lazarus 0.9.25 this is typically the screen coordinate of the left,top of the client area of the form. This is Delphi incompatible. It is planned to change this to the Left, Top of the window.

Hint:

Each time you change Left and Top the LCL moves instantly. If you want to change both Left and Top use instead:

with Button1 do SetBounds(NewLeft,NewTop,Width,Height);

- Width
- Height

The Size in pixels must not be negative, and most widgetsets do not allow Width=0 and/or Height=0. Some controls on some platforms define a bigger minimum constraint. Instead of sizing a control to Width=0 and/or Height=0, set Visible=false. During resizing/moving Width and Height are not always in sync with the size of the Handle object.

- BoundsRect

Same as Bounds(Left,Top,Width,Height).

Common newbie mistake:

BoundsRect.Left:=3; // WRONG: common newbie mistake

This has no effect, because reading BoundsRect is a function. It creates a temporary TRect on the stack.

- ClientRect

Left and Top are always 0,0. Width and Height are the visible size in pixels of the client area. Remember the client area is without the frame and without scrollbars. In a scrollable client area the logical client area can be bigger than the visible.

- ClientOrigin

Returns the screen coordinate of the top left coordinate 0,0 of the client area. Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the desired position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.

- LCLIntf.GetClientBounds

Returns the client bounds of a control. Like ClientRect, but Left and Top are the pixel distances to the control's left, top. For example on a TGroupBox the Left, Top are the width and height of the left and top frame border. Scrolling has no effect on GetClientBounds.

- LCLIntf.GetWindowRect

After the call, ARect will be the control area in screen coordinates. That means, Left and Top will be the screen coordinate of the TopLeft pixel of the Handle object and Right and Bottom will be the screen coordinate of the BottomRight pixel.

- FBaseBoundsLock: integer

Increased/Decreased by LockBaseBounds/UnlockBaseBounds. Used to keep FBaseBounds during SetBounds calls.

- FBaseParentClientSize: TPoint

The Parent.ClientRect size valid for the FBaseBounds. FBaseBounds and FBaseParentClientSize are used to calculate the distance for akRight (akBottom). When the parent is resized, the LCL knows what distance to keep.

- FBoundsRectForNewParent: TRect

When changing the Parent of a control the Handle is recreated and many things can happen. Especially for docking forms the process is too unreliable. Therefore the BoundsRect is saved. The VCL uses a similar mechanism.

- fLastAlignedBounds: TRect

See TControl.SetAlignedBounds for an explanation. In short: It stops some circles between interface and LCL autosizing.

- FLastChangebounds: TRect

Used to stop calling ChangeBounds with the same coordinates. This happens very often.

- FLastDoChangeBounds: TRect

Used to avoid calling OnChangeBounds with the same coordinates. This reduces user defined autosizing.

- FLastResizeClientHeight: integer
- FLastResizeClientWidth: integer
- FLastResizeHeight: integer
- FLastResizeWidth: integer

Used to avoid calling OnResize with the same coordinates. This reduces user defined autosizing.

- FLoadedClientSize: TPoint

During loading many things are delayed and many things are set and worse: in the wrong order. That's why SetClientWidth/SetClientHeight calls are stored and set at end of loading again. This way the LCL can restore the distances (e.g. akRight) used during designing.

- FReadBounds: TRect

Same as FLoadedClientSize, but for SetLeft, SetTop, SetWidth, SetHeight.

- procedure SetBoundsRectForNewParent(const AValue: TRect);

Used to set FBoundsRectForNewParent. See above.

- procedure SetAlignedBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;

Sets fLastAlignedBounds, see above.

- procedure SetInitialBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;

A smart version of SetBounds, reducing overhead during creation and loading.

- procedure UpdateBaseBounds(StoreBounds, StoreParentClientSize, UseLoadedValues: boolean); virtual;

Commit current bounds to base bounds.

- procedure SetClientHeight(Value: Integer);
- procedure SetClientSize(Value: TPoint);
- procedure SetClientWidth(Value: Integer);

Exists for Delphi compatibility too. Resizes the control, to get the wanted ClientRect size.

- procedure ChangeBounds(ALeft, ATop, AWidth, AHeight: integer); virtual;

This is the internal SetBounds. Applies constraints, updates base bounds, calls OnChangeBound, OnResize, locks bounds.

- procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); virtual;

This really sets the FLeft, FTop, FWidth, FHeight private variables.

- procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;

This is the standard procedure overriden by many Delphi controls. TWinControl overrides it too.

Ignores calls when bounds are locked; lock the FBoundsRealized to avoid overhead to the interface during auto sizing.

ChangeBounds is not locked this way.

- Function GetClientOrigin: TPoint; virtual;

Screen coordinate of Left, Top of client area.

- Function GetClientRect: TRect; virtual;

Size of client area. (always Left=0, Top=0)

- Function GetScrolledClientRect: TRect; virtual;

Visible client area in ClientRect.

- function GetChildsRect(Scrolled: boolean): TRect; virtual;

Returns the Client rectangle relative to the control's Left, Top. If Scrolled is true, the rectangle is moved by the current scrolling values (for an example see TScrollingWincontrol).

- function GetClientScrollOffset: TPoint; virtual;

Returns the scrolling offset of the client area.

- function GetControlOrigin: TPoint; virtual;

Returns the screen coordinate of the topleft coordinate 0,0 of the control area. (The topleft pixel of the control on the screen) Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.

SendDragMsg
- sends to AControl a drag message at specified position for nominated object; returns an integer Result for success
SendCmDragMsg
- sends to DragTarget a drag message at specified position for nominated object; returns True for success
The Result is used to select the DragCursor (deny/accept drop).
Moves an already visible DockRect.

Checks the DockRect for changes against EraseDockRect, to prevent flicker.

Remembers the drawn frame coordinates in EraseDockRect.

Shows the DockRect, remembers the coordinates in EraseDockRect
Hides the DockRect, invalidates EraseDockRect to prevent further erases.
Initializes the dragging coordinates.

Determines the hotspot offset for adjusting the DockRect.

Since the undocked extent of the control doesn't change while dragging, we fix the hotspot offset here.

Usage: OffsetRect(DockRect, FDockOffset);

Determine the DropAlign.

ADockObject contains valid DragTarget, DragPos and DragTargetPos relative dock site. DockRect is undetermined.

DropOnControl may be Nil if nothing has been docked yet, or no target control exists at the mouse coordinates.

Returns True if ADockObject.DropAlign has been determined. If False, the DropAlign has to be determined by default procedures.

Determine the target control within the target DockSite.

Do nothing (return Nil) unless a DockManager is installed in the target site and something has already been docked.

When the dragged control is the only client of the docksite, Nil is returned.

[ToDo: The check for an drop of a control onto itself should be done in every case, after the target control has been determined.]

The coordinates of a control can be specified or retrieved in various ways.

The following description applies to members of TControl and TWinControl.

Every control has an origin (Top, Left) and extent (Width, Height). The origin is relative to its Parent control (client coordinates) or, for floating controls (forms) with Parent=Nil, relative to the screen.

The BoundsRect describes the TopLeft and BottomRight coordinates of the control, relative to its Parent.

The BoundsRectForNewParent holds the new coordinates, to be used when the Parent of the control is changed later.

The ClientRect describes the internal (client) area of a container control (TWinControl), excluding borders. Its Top and Left are always zero. In a TScrollingWinControl...[?]

BaseBounds is [what?]

GetControlOrigin returns the screen coordinates of the control. These values are not always in sync with the true screen position, managed by the widgetset.

ScreenToClient returns the client coordinates of an given point on the screen coordinates, i.e. the coordinates relative to the control's client origin.

The default class used to create an DockManager in .
Creates an DockManager for ADockSite
Handles the messages sent to a docksite

This handler must handle all mouse messages, related to the client area of the docksite that is not covered by docked controls (dock headers...).

Handling mouse messages while dragging is not required. Painting of the docksite has to be implemented in PaintSite.

Special constructor, enforcing the destruction of the object at the end of the dragging operation.
This constructor sets the AutoCreated and AutoFree flags. AutoFree is tested by the DragManager at the end of the dragging operation.
Indicates whether the object shall be destroyed at the end of the dragging operation.
This is a Lazarus specific property, introduced to get rid of the special Delphi TDrag...Ex classes.
Find a DockSite under the current mouse position.

The list of registered docksites is searched. Sites are excluded when they are invisible or disabled, or when the site is (a child of) the dragged control.

The Z-order of the docksites should be taken into account. Currently the first site found is returned.

Creates an object to be destroyed after use.
A drag object for docking, that is automatically destroyed after use.
Creates an object to be destroyed after use.
Creates an object to be destroyed after use.
The default DragManager class.
The DockManager class type, for use when a DockManager is automatically created.