Contains types, constants, classes, and routines used to implement visual controls.

controls.pp contains classes, types, constants, and routines used to implement visual controls used in the Lazarus Component Library (LCL). Most of the classes are base classes, or used in the implementation of controls defined in others units.

The following components are added to the Common Controls tab in the Lazarus IDE component palette:

- TImageList

The following components are registered but not displayed on the Lazarus IDE component palette:

- TCustomControl
- TGraphicControl

This file is part of the Lazarus Component Library (LCL).

Starting value for control message constants defined in the LCL.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Control message constant.
Starting value for control notification messages in the LCL.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
Control notification message constant.
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.
Modal dialog left with Close button.
Last (highest) value of modal results.
Deprecated; Use the ModalResultStr array from the UITypes unit.
Gets the string representation for a modal result value.

ModalResultStr is an indexed ShortString property used to get the string representation for the specified TModalResult constant. The read access specifier for the property has been deprecated; Use the ModalResultStr array from the UITypes unit directly.

ModalResultStr TModalResult
Alias to the fsSurface constant in the GraphType unit.
Alias to the fsBorder constant in the GraphType unit.
Alias to the bvNone constant in the GraphType unit.
Alias to the bvLowered constant in the GraphType unit.
Alias to the bvRaised constant in the GraphType unit.
Alias to the bvSpace constant in the GraphType unit.
Defines the key used for shortcuts on different platforms.

ssModifier is a constant which defines the modifier for keyboard shortcuts, like Ctrl+C (Copy), Ctrl+Z (UnDo), Ctrl+X (Cut), and Ctrl+V (paste). Mac and iOS use the Meta key (instead of the Ctrl key) for those shortcuts.

GUID for the Object Inspector in the Lazarus IDE.
Value is '{37417989-8C8F-4A2D-9D26-0FA377E8D8CC}'
Defines an interface used in the Lazarus Object Inspector.
TWinControlClass
- class of TWinControl.
TControlClass
- class of TControl.
Defines a structure used for mouse wheel control messages.

Holds mouse wheel details that include:

- the Message associated with the wheel
- the shift state (i.e. whether Shift, Alt, Control keys have been pressed)
- the mouse position
- the message Result

Cardinal value with the CM_MOUSEWHEEL identifier for the mouse wheel message.
State of the modifier for keys and mouse buttons.
Inserted for alignment only.
Number of notches or units the mouse wheel was moved. Negative for mouse wheel up movements.
Mouse position as a TSmallPoint value.
Mouse X position as a SmallInt value.
Mouse Y position as a SmallInt value.
Result for the mouse wheel message. Zero (0) indicates the message was handled.
Alias for the TLMNCHitTest type.
Alias for the TLMMouse type.
Contains values representing a Control Change Message.

TCMControlChange is a record type which contains values representing the arguments and the result for a Control Change Message. TCMControlChange is the type passed to the CMControlChange method in TCustomFlowPanel.

TCustomFlowPanel.CMControlChange
Mouse message constant for the change notification.
Control to receive the change message.
Indicates if the control message is an insert operation.
Result for the control change message.
Not used in the current LCL implementation.
Not used in the current LCL implementation.
Alias for the TLMKey type.

Used in LazReport controls.

Alias for the TLMKey type.

Used in the jvcllaz package.

Alias for the TLMEnter type.
TLMEnter
Alias for the TLMExit type.
Contains information representing a CM_CANCELMODE control message.

Used in the jvcllaz package.

Not used in the current LCL implementation.
VK_XXX constants for TLMKeyDown/Up, ASCII for TLMChar.
Alignment options for a control, within its Parent control.

TAlign is an enumeration type with values that indicate the alignment for a control within its Parent. The enumeration includes the following values and meanings:

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 for a given form or container.

The order of multiple controls with the same (stackable) alignment is determined by their Left and/or Top coordinate. The precedence of conflicting alignment requests (e.g. one at top, one at right) is resolved.

Control has fixed size and position.
Control stacked at top, full width.
Control stacked at bottom, full width.
Control stacked at left, full height.
Control stacked at right, full height.
Control fills remaining client area.
Control has special alignment.
Set of alignment options.
TAlign
The control side to be anchored.
With the TAnchorSideReference value asrCenter, the sides mean horizontal or vertical alignment of the control's center.
Top side (or center vertically).
Left side (or center horizontally).
Right side (or center horizontally).
Bottom side (or center vertically).
Set type used to store values from the TAnchorKind enumeration.

TAnchors is the the type used to implement the Anchors property in TControl and descendent classes.

The side of another control, to which this control's side is anchored.
Anchor to the top side.
Anchor to the bottom side.
Anchor to the center of the other control.
Anchor to the left side (=asrTop).
Anchor to the right side (=asrBottom).
A string type used for the caption on a control.

TCaption is an alias for the TTranslateString type. It allows a string value defined using the type to be recognized in the LCL translation system. TCaption is the type used to implement properties like TControl.Caption, TControl.Text, TControl.AccessibleName, TControl.AccessibleValue, et. al.

Defines the range of values used for cursor shapes.

TCursor is an Integer type which defines the range of values used for cursor shapes. TCursor includes the following values:

Standard Cursors

crDefault
  TCursor(0) - current cursor unchanged
crNone
  TCursor(-1) - hide cursor
crArrow
  TCursor(-2) - normal cursor
crCross
  TCursor(-3) - graphics cursor, for pixel or rectangle selection
crIBeam
  TCursor(-4) - text cursor, for setting insertion point

Sizing Cursors

crSize
  TCursor(-22)
crSizeAll
  TCursor(-22)
crSizeNESW
  TCursor(-6) - diagonal north east - south west
crSizeNS
  TCursor(-7)
crSizeNWSE
  TCursor(-8)
crSizeWE
  TCursor(-9)
crSizeNW
  TCursor(-23)
crSizeN
  TCursor(-24)
crSizeNE
  TCursor(-25)
crSizeW
  TCursor(-26)
crSizeE
  TCursor(-27)
crSizeSW
  TCursor(-28)
crSizeS
  TCursor(-29)
crSizeSE
  TCursor(-30)

Drag and Drop Cursors

crDrag
  TCursor(-12) - dragging, drop allowed
crNoDrop
  TCursor(-13) - dragging, drop disallowed/rejected
crMultiDrag
  TCursor(-16) - dragging multiple items
crNo
  TCursor(-18)
Splitter Cursors
crHSplit
  TCursor(-14)
crVSplit
  TCursor(-15)

Other Cursors

crUpArrow
  TCursor(-10)
crHourGlass
  TCursor(-11) - busy
crSQLWait
  TCursor(-17)
crAppStart
  TCursor(-19)
crHelp
  TCursor(-20)
crHandPoint
  TCursor(-21)

Defines special form behavior.
An ordinary (overlapping) form.
The form is an MDI child.
The form is an MDI parent form, containing MDI child forms.
The form is in the foreground, on top of all other application forms.
The form is used as a Splash form.

Signifies that the form cannot become the main form in an application. Implies that the form responds to fewer messages; generally, paint messages and little else. May affect the border style and even the window class used for the form on some widgetsets.

The form stays system-wide on top.

Used in forms for a modal system dialogs. Prevents another form from having a higher Z-order value than the current one. Generally treated the same as fsStayOnTop except for macOS Cocoa.

Represents border styles available for a Form.
A border is not used or displayed.
Single line border, the form cannot be resized.
The form can be resized (standard).
The form is a dialog, cannot be resized.
Single line border, small caption, not resizable.
Small caption, form can be resized.
Possible types of borders (with or without border).
TFormBorderStyle
Possible types of control borders (with or without border).

A subset of TFormBorderStyle, listing only the styles available to a control that is not a form.

TFormBorderStyle
Possible default actions on special keys.
This control is notified when the user presses Return.
This control is notified when the user presses Escape.
Set type used to store values from the TControlRoleForForm enumeration.

TControlRolesForForm is the type returned from the TCustomForm.GetRolesForControl method.

TCustomForm
Alias for the TGraphicsBevelCut type.

TBevelCut is the type used to represent bevel styles passed as arguments to methods in widgetset classes.

TGraphicsBevelCut
Enumeration of recognized mouse buttons.

These are logical buttons; the left and right physical buttons can be swapped for left-handed users.

Represents the left mouse button. It might be physically the right button if the system is configured to act like that, for example for a left handled person.
Represents the right mouse button. It might be physically the left button if the system is configured to act like that, for example for a left handled person.
Represents the middle mouse button.
Represents the first extra mouse button.
Represents the second extra mouse button.
Set of form styles, which make a form stay on top.
Set of form styles, except those which make a form stay on top of all other forms of the system.
Highest defined cursor constant (0).
Indicates that the default cursor from the system should be utilized.
Indicates that the cursor should be invisible.
The Arrow cursor, which is the most common and the default one in most cases.
A cursor utilized for graphics, for pixel or rectangle selection, often in the shape of a cross.
A text cursor, for setting insertion point. Often used in text editors.
A generic sizing cursor, to indicate that here one may drag to resize something. Is the same as crSizeAll.
A cursor for resizing which runs diagonally from NorthEast to SouthWest (-6).
A cursor for resizing which cursor runs from North to South (-7).
A cursor for resizing which cursor runs from NorthWest to SouthEast.
A cursor for resizing which has an arrow with two points, one to the left and another to the right, to indicate resizing possibility in both directions.
A cursor for resizing which has an arrow pointing to the left-top corner, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing upwards, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing to the right-top corner, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing to the left, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing to the right, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing to the left-bottom corner, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing downwards, to indicate resizing possibility in this direction.
A cursor for resizing which has an arrow pointing to the right-bottom corner, to indicate resizing possibility in this direction.
Up Arrow cursor constant (-10).
Busy cursor constant, utilized to indicate that one should wait while an action is done.
A cursor to indicate that one can drop a dragged item in this area.
A cursor to indicate that one cannot drop a dragged item in this area.
Horizontal Splitter cursor constant (-14).
Vertical Split cursor constant (-15).
Multiple Object dragging cursor constant (-16).
Waiting for SQL cursor constant (-17).
Shows a negative sign. See also .
Application starting cursor.
"What's This" Help cursor constant (-20).
Pointing hand cursor constant (-21).
All Directions sizing cursor constant (-22).
Lowest defined cursor constant (-30).
Set type used to store TMouseButton values.

TCaptureMouseButtons is a set type used to store TMouseButton enumeration values. TCaptureMouseButtons is the type used to implement the CaptureMouseButtons property in TControl.

Method type for WindowProc handlers.
Message with the command constant and key code processed in the handler.
Enumerated type with values for features or behaviors for a control.

TControlStyleType is an enumeration type with values that represent features or behaviors that can be enabled or disabled in a control. Zero or more values from TControlStyleType can be stored in the TControlStyle set type used to implement the ControlStyle property in TControl.

When an enumeration value is present in the set, it indicates that the corresponding feature or behavior is enabled for the control. Conversely, when the value is omitted from the set the feature or behavior is disabled.

Indicates that one can add child controls to this control in the form designer.
Control focus and style changes when under the mouse cursor.
Control handles mouse events at design-time.
Control responds to mouse click events.
Control has a 3D frame; used on scroll bars in the current LCL version.
Indicates that the Caption for a control is updated when a value is assigned to the Name property. 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 differ, this flag has no effect. This flag has no effect when loading the control using the LCL component streaming mechanism.
Control is drawn with a non-transparent background; implementation is widgetset-specific.
Indicates that the control understands mouse double click events.
Indicates that the control understands mouse triple click events.
Indicates that the control understands mouse quadruple click events.
Indicates that the control cannot change its width.
Indicates that the control cannot change its height (e. g. a combo-box).
Indicates that the control is invisible in the form designer.
Control can be drawn using the TWinControl.PaintTo method.
Key messages are handler by widgetset classes instead of control events.
Display images from the drag imagelist during a drag operation over the control.
Control responds to size, focus, and dialog messages and can be used as an ActiveX control (Windows).
Control includes support for TBasicAction.
Control responds to menu and menu item events.
Indicates that the control or form cannot receive focus.
Indicates that the client area for the control needs to be redrawn including its borders. LCL controls do not use this value in their control styles property. Implemented for JVCL controls and its theme engine.
Indicates whether the background for the parent control is used to fill the client area in the control. Used for controls which have a window handle for the parent control and do not use csOpaque in their control style. On some platforms (like WinXP and Windows 7), csParentBackground can be used to reduce flicker when the parent control is resized.
WYSIWYG resizing is not used on the design surface.
Control cannot be moved or resized on the designer surface.
Control executes a default action when the Space or Enter key is pressed.
Control executes an action when the Escape key is pressed or the form/dialog is closed using the window decoration.
Control cannot be selected at design-time.
Child controls owned by this control are not selectable in the designer.
If the preferred size is 0x0 then control is shrunk to 0x0
When AutoSize is True, do not move child controls horizontally.
When AutoSize is True, do not move child controls vertically.
Indicates that a control requires keyboard input to be utilized by the user. Used for the Android (and other) platforms to activate the virtual keyboard when an active control needs to respond to input values. Used primarily for devices that do not have a hardware keyboard.
Set type used to store values from the TControlStyleType enumeration.

TControlStyle is a set type used to store zero or more values from the TControlStyleType enumeration. Values from TControlStyleType are included in the set when the corresponding feature or behavior is enabled for a control.

TControlStyle is the type used to implement the ControlStyle property in TControl and descendent classes.

Set of style values which require/provide multiple clicks on a control.
State flags of a Control.

TControlStateType is an enumeration type which contains values that represent state information for control class instances, including:

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

Values from the TControlStateType enumeration are stored in the TControlState type, and used to implement the ControlState property in TControl.

Indicates the Left mouse button was down for the control.
Indicates the control was clicked; occurs after button down/up processing.
Palettes are not currently implemented in LCL.
Indicates the ReadState method has been called for the control.
Indicates the focus for the control has been changed.
Introduced for Delphi compatibility; not used in LCL.
Indicates a device context was copied in PaintControls.
Indicates a custom paint method is used to draw the control; determines the handler called to paint the control.
Used to suppress message processing when the control is freed.
Indicates the Dock method has been called for a control.
Indicates the control is being loaded using the LCL component streaming mechanism.
Set of control states used in a control.
Base class which provides a canvas property used in graphic controls.

TControlCanvas is a TCanvas descendant that implements the base class which provides a canvas used in graphic controls. TControlCanvas extends the ancestor class by including a property representing the TControl associated with the canvas, a window handle for the associated control, and the device context for the handle.

TControlCanvas is used in the implementation of classes like TGraphicControl and TCustomControl, and other visual controls.

TCanvas
Sets the value for the Control property.
New value for the Control property.
Ensures that a handle exists for the class instance.

Calls the inherited method on entry when a value has not been assigned to the Control property.

Otherwise, Control is used to check for an existing device context (HDC) for the class instance. When assigned, its value is copied into the Handle for the control.When not assigned, the HandleNeeded method in TWinControl is called to create the window handle and get its device context. If Control is not derived from TWinControl, its Parent is used to call the HandleNeeded method.

This is done to prevent resource leaks that might occur when directly accessing he window Handle before it has actually been allocated (recursive calls to the method).

If the device context remains unassigned, the GetDeviceContext method in Control is called to get the device context for the window Handle.

TCanvas.CreateHandle
Gets the color value used for clDefault.

GetDefaultColor is used to resolve the default color (clDefault) to the TColor value used for the brush or font on the canvas. The ADefaultColorType argument indicates which value is needed in the return value. See TDefaultColorType for the values available in the argument.

GetDefaultColor is overridden in TControlCanvas to ensure that the Control is used (when assigned) to retrieve the default color by calling its GetDefaultColor method. If Control is not assigned, the inherited method is called to get the default color value (unresolved in the ancestor class).

TCanvas.GetDefaultColor TControl.GetDefaultColor TDefaultColorType
TColor value for the specified color type. clDefault when the Control has not been assigned for the class instance.
Identifies whether the font or brush color is resolved in the method.
Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited constructor, and sets the default unassigned values for the device context, window handle, and control used in the class instance. The device context and window handle are maintained in methods which use the respective members. Use the Control property to set the owner for the class instance.

Destructor for the class instance.

Destroy is the overridden destructor for the class instance. Destroy ensures that a device context allocated for the window handle in Control is freed prior calling the inherited destructor.

Frees the Handle for the control canvas, and its device context when assigned.

FreeHandle is an overridden method in TControlCanvas. It calls the inherited method on entry to set the value in Handle to 0 (the unassigned value). If a device context (DC) has been allocated for the window handle (HWND), the ReleaseDC routine is called to release the device context.

FreeHandle is called when a new value is assigned to the Control property, or when the class instance is freed.

TCanvas.Handle TCanvas.FreeHandle ReleaseDC
Indicates if the Control has called but not completed its Paint method.

ControlIsPainting is a Boolean function which indicates if the Control has called but not completed its Paint method. ControlIsPainting returns True when the Control has been assigned (contains a non-Nil value) and its IsProcessingPaintMsg method returns True.

ControlIsPainting is used in the implementation of the CreateHandle method.

True when the Control has been assigned is repainting.
The Control object for which the Canvas is used.

Control is a TControl property which represents the control associated with the canvas in the class instance. Setting the value in Control causes an existing Window handle (and its device context) in the class instance to be freed. The handle and its device context are recreated (eventually) when the control is displayed.

Pointer to a THintInfo instance.

PHintInfo is a Pointer to a THintInfo instance. PHintInfo is the type passed as an argument to the TControlShowHintEvent event handler procedure, and the DoOnShowHint method in TControl.

Contains content and state information for Hints displayed for a window or control.
Control for the hint display.
Window class for the hint display.
TPoint with the screen coordinates for the hint display.
Maximum width for the hint.
Color for the hint window.
Rectangle with the coordinates and size for the cursor.
TPoint with the location for the mouse cursor.
If set to a value greater than Zero (0), call after value milliseconds OnShowHint again.
Used to update the hint text display after the specified delay while it is showing.
Duration in milliseconds for the hint display.
String value displayed as a hint for the associated control.
Pointer to the data used to derive the hint text.
Helper class for TCustomImageList useful for images on TControl instances.

TImageListHelper is a helper class for TCustomImageList. TImageListHelper extends TCustomImageList to provide additional properties and methods that are useful when working with TControl class instances.

Use the overloaded DrawForControl method to render an image from the multiple resolution image list to a control canvas.

Use the ResolutionForControl property to access a scaled image resolution with images of a specified width used on a control instance.

TCustomImageList
Gets the value for the ResolutionForControl property.
Value for the property.
ImageWidth desired in the scaled image resolution.
Control which provides the PPI display density for scaled images in the resolution.
Draws an image scaled to the display density (PPI) for the specified control.

DrawForControl is an overloaded procedure used to draw the specified image scaled to the display density (PPI) for the specified control. DrawForControl calls the DrawForPPI method in the image list to render the selected image using the display density and drawing effect required.

ACanvas contains the control canvas where the image is drawn. AX and AY contains the left and top coordinates on the canvas where the image is drawn.

AIndex specifies the ordinal position in the scaled image list for the image drawn in the method.

AImageWidthAt96PPI contains the width for the image at 96 PPI. The actual image width is scaled to the display density using scaling factor required for the control.

AControl contains the TControl instance that provides the display density and canvas scaling factor required for the image.

When AEnabled is True, the image is drawn using its Enabled state. Otherwise, it is rendered using the disabled state.

ADrawEffect contains the TGraphicsDrawEffect used when rendering the image to the control canvas.

TCustomImageList.DrawForPPI
Canvas where the image is drawn.
Horizontal position on the canvas where the image is drawn.
Vertical position on the canvas where the image is drawn.
Ordinal position for the image drawn in the method.
Image width using the standard display density.
Control with the display density (Font PPI) and canvas scaling factor used in the method.
Indicates the image is drawn in the enabled state when True.
Indicates the TGraphicsDrawEffect applied to the image.
Provides access to an image resolution with the specified width scaled to the display density for a control.

ResolutionForControl is a read-only TScaledImageListResolution property which provides access to a scaled image resolution suitable for the control in AControl. AImageWidth contains the image width requested from the multi-resolution image list. AControl contains the TControl instance which provides the display density (PPI) and the scaling factor used to generate the scaled image resolution.

TScaledImageListResolution
Image width requested in the image list
Control which provides the display density and scaling factor for the scaled image resolution.
Implements an image list resolution with features used in Drag and Drop operations.

TDragImageListResolution is a TCustomImageListResolution descendant which implements an image list resolution with features used in Drag and Drop operations. TDragImageListResolution is used in the implementation of TDragImageList.

Gets the value for the ImageList property.
Value for the property.
List with images used in Drag and Drop operations.

ImageList is a read-only TDragImageList property which provides access to the images used for Drag and Drag operations, and methods used to render the images.

"
Constructor for the class instance.

Create is the overridden constructor for TDragImageListResolution. Create calls the inherited constructor using TheOwner as the owner for the class instance. Create sets the initial the values for internal members in the class instance.

TComponent.Create
Owner of the new class instance.
Gets the HotSpot for the image resolution.

GetHotSpot is an overridden TPoint function which gets the HotSpot for the image list resolution. GetHotSpot uses the value from the DragHotspot property. It contains the screen coordinates where the Drag and Drop operation was started. X is is the horizontal position, and Y is the vertical position in the TPoint type.

Value for the HotSpot.
Starts display of images in the resolution for a Drag and Drop operation.

BeginDrag is a Boolean function used to start display of images in the resolution for a Drag and Drop operation. The return value is True if the widgetset successfully received the BeginDrag notification.

No actions are performed in the method if the widgetset class does note successfully start the drag operation.

BeginDrag calls the DragLock method to lock the window handle for the control, and to start displaying the drag image for the operation. The current screen cursor is captured, and the DragCursor in ImageList is displayed for the operation.

True if the Drag operation was successfully started.
Window handle where images are displayed for the operation.
Horizontal screen position where the operation was started.
Vertical screen position where the operation was started.
Shows the Drag image and optionally locks the Window handle during the Drag operation.
True if the drag operation was started or the drag image position was updated.
Window handle used as the lock handle when not already assigned.
Horizontal coordinate for the drag image.
Vertical coordinate for the drag image.
Moves the dragging image to the specified position.
Hides the Drag image and removes the update lock for the Window.
Removes the drag lock and restores the saved cursor when the drag operation has ended.
Notifies the widgetset class to hide the drag image.
Notifies the widgetset class to display the drag image.
Contains the mouse position for the drag image.
DragHotspot is a TPoint property which contains the mouse position for the Drag hostspot. The value in DragHotspot is updated when TDragImageList sets the image used for the resolution, and in the BeginDrag method.
Indicates that BeginDrag has been called for the image resolution.
A list of Images used during Drag operations.

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 general overview of the usage of this class:

- SetDragImage selects an image from the list, and defines the hotspot within this image. (the hotspot typically is the offset of the mouse position to the origin of the dragged control)
- BeginDrag starts dragging, the image is shown at the starting location.
- DragMove moves the image.
- EndDrag stops dragging, the image is removed from the screen.

Remember position where the image was painted.
The window whose updates are locked while dragging.
Sets the value for the DragCursor property.
New value for the DragCursor property.
Gets the value for the DragHostSpot property.
Value for the DragHostSpot property.
Sets the value for the DragHostSpot property.
New value for the DragHostSpot property.
initializes the cursor shape and image index for the list.

Initialize is an overridden method in TDragImageList. It calls the inherited method on entry. It sets the default values in DragCursor (crNone) and the internal selected image index (0).

TCustomImageList.Initialize
Start dragging an image; returns True if successful.
Locks a window for updates, remembers the current cursor shape, and sets the new cursor shape.
True if successful.
The associated window.
The mouse position.
The mouse position.
Show drag image during drag operation.
True if Dragging and image shown.
The locked window.
The mouse position.
The mouse position.
Shows the drag image at a new location.
True if Dragging and image moved.
The new mouse position.
The new mouse position.
Hide the drag image.
Finish dragging of the image, restore the old cursor shape.
True when dragging was started before.
Hides the drag image without unlocking the window.

Calls the HideDragImage method in DraggingResolution. No actions are performed in the method when an image resolution is not available in the DraggingResolution property.

Set index of dragged image and hotspot.
Always True.
List index of the image to use.
Offset from mouse position to image position.
Offset from mouse position to image position.
Displays the drag image.

Calls the ShowDragImage method in DraggingResolution. No actions are performed in the method when an image resolution is not available in the DraggingResolution property.

The cursor shape to use while dragging.
The position of the HotSpot image, i.e. the offset to the mouse position while dragging.
True if dragging in progress.
Gets the scaled image resolution with the drag images for the list.
Gets the image resolution for the specified image width.

Resolution is a read-only indexed TDragImageListResolution property which provides the image resolution for images with the width specified in AImageWidth. Reading the property value causes the image resolution to be cast to the required TDragImageListResolution type.

Image width requested in the image resolution.
Defines an event handler for key events.

TKeyEvent is an object procedure type which specifies a handler for key events.

TKeyEvent is the type used to implement the OnKeyDown and OnKeyUp event handlers in TWinControl. Applications must implement an object procedure using the signature for the event, and assign it to the event handler to respond to the notification.

See for the handler used to implement OnKeyPress events.

TObject for the key event.
ScanCode for the key in the event.
TShiftState modifier for the specified key.
Specifies an event handler for key press events.

TKeyPressEvent is an object procedure type that defines an event handler for key press events.

TKeyPressEvent is the type used to implement the OnKeyPress event handler in TWinControl. Applications must implement an object procedure using the signature for the event handler, and assign it to the property to respond to the event notification.

TObject for the event notification.
Character value for the key press in the event notification.
Specifies an event handler for UTF-8-encoded key press events.

TUTF8KeyPressEvent is an object procedure type which specifies an event handler for UTF-8-encoded key press events.

TUTF8KeyPressEvent is the type used to implement the OnUTF8KeyPress event handler in TWinControl. Applications must implement an object procedure using the signature for the event handler, and assign it to the property to respond to the event notification.

TObject for the event notification.
Value for the UTF-8-encoded character in the key press event.
Specifies an event handler used to respond to mouse button events.

TMouseEvent is an object procedure type which specifies an event handler for mouse button events.

TMouseEvent is the type used to implement the OnMouseDown and OnMouseUp event handlers in TControl. Applications must implement an object procedure using the signature for the event handler, and assign it to the property to respond to the event notification.

TObject for the event notification.
Mouse button for the event notification.
Modifier applied to the mouse button.
Horizontal position for the mouse cursor in the button event.
Vertical position for the mouse cursor in the button event.
Specifies an event handler used to respond to mouse movement events.
TObject for the event notification.
Key modifier in effect for the event.
Horizontal mouse coordinates.
Vertical mouse coordinates.
Specifies an event handler used to respond to mouse wheel events.
The control under the mouse.
State of the modifier keys and mouse buttons.
How many notches the wheel has been turned.
The mouse position, in client coordinates.
Set Handled to True when the event was handled.
Type of OnMouseWheelUp/Down event handlers.
The control under the mouse.
State of the modifier keys and mouse buttons.
The mouse position, in client coordinates.
Set Handled to True when the event was handled.
Specifies an event handler used to get the caption for a docked control.

TGetDockCaptionEvent is an object procedure type which specifies an event handler used to get the caption for a docked control. It allows a value other than the Caption for a control to be displayed when a control is docked.

Use AControl to examine properties for the docked control. Assign a value to the ACaption argument to set the docking caption for the control.

TGetDockCaptionEvent is the type used to implement the OnGetDockCaption event handler in TWinControl. Applications must implement an object procedure using the signature for the type, and assign it to the property to allow responding to the event notification.

TObject for the event notification.
Control with the default caption value.
Caption to use for the docked control.
Indicates whether the control performs drag-drop or drag-dock.
Control is dragged for dropping.
Control is dragged for docking.
Indicates whether dragging can start automatically.
Dragging can start only by explicit code.
Dragging starts when the left mouse button is pressed on the control.
Values representing State changes while dragging.
These values are sent in drag messages, allowing the control to perform special actions when the mouse moves over, enters, or leaves the control.
Mouse has just entered the control.
Mouse has just left the control.
Mouse is moving over the control.
Message types used in DragManager.

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

mouse enters control.
mouse leaves control.
mouse moves over control (after dmDragEnter).
control dropped.
dragging aborted.
find possible target control under the mouse.
The type of an OnDragOver handler.

An OnDragOver event is sent by a control, when an object is dragged over it. The handler can specify whether a drop will be accepted or rejected.

Source
is polymorphic, can be either the DragObject or the dragged control! This depends on DragObject.AutoCreated, for no sane reason.
The possible drop target (control).
The object (TDragObject or TControl) being dragged.
X coordinate of the mouse on screen.
Y coordinate of the mouse on screen.
The current DragState (entering, leaving or moving over the target).
Set Accept to False to reject an drop (default is True).
The type of an OnDragDrop notification handler.
An OnDragDrop event is generated by the target control, on the drop of a dragged object.
The target control of the drop.
The dragged control.
The client coordinates of the drop.
The client coordinates of the drop.
The type of an OnStartDrag handler.

An OnStartDrag event is generated for a control when it is dragged and its DragKind is dkDrag. The handler can provide a specific DragDrop object. Otherwise, a standard TDragDropObjectEx is automatically created by the DragManager.

The control to be dragged.
Supply your own DragObject, or leave it Nil for automatic creation.
The type of an OnEndDrag handler.

An OnEndDrag event is sent for a dragged control, when the drag operation is finished. This happens regardless of whether the operation was drag-drop or drag-dock, and whether the operation ended with a drop or was cancelled.

Check for an unassigned value in Target to distinguish between a drop and a cancelled operation (Nil).

The dragged control.
The drop target (control), or Nil if cancelled.
The mouse coordinate, in client coordinates if dropped, else in screen coordinates.
The mouse coordinate, in client coordinates if dropped, else in screen coordinates.
Base class for managing drag operations and user 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; you do not need to maintain it. But an application can provide a customized DragObject in the or handlers for the source control (the one being dragged).

AutoCreated DragObjects imply different behavior in the DragOver and DragDrop events, where the Source becomes the dragged control, while the DragObject itself is passed as Source.

TDragObject is the ancestor of a whole tree of dragging objects, with the main branches supporting either drag-drop or drag-dock operations. The type of the operation is determined using the property in the source control.

In contrast to the Delphi implementation, Lazarus has moved a couple of methods into the drag performers; these methods are no longer 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). Drag-dock operations instead show a docking rectangle, that snaps to possible target locations when the mouse moves over docksites.

Called when a dragging operation ends.
The default implementation calls Control.DoEndDrag, which in turn invokes an OnEndDrag handler.
The control onto which the dragged object is dropped (can be Nil).
Horizontal mouse coordinate when the method is called.
Vertical mouse coordinate when the method is called.
Returns a list of images for dragging.

The returned provides methods for the selection and display of an image shown while dragging. This implementation returns Nil, and must be overridden (e.g. in TDragControlObject).

The ImageList to use, is Nil by default!
Returns the dragging cursor type (shape).
In drag-drop operations the cursor signals acceptance or rejection of an drop, depending on Accepted.
The cursor to show.
Which cursor to return (rejected:crNoDrop or accepted:crDrag).
Remembers the dragged control.
TObject.Create
The control being dragged.
Special constructor which enforces 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.

The control being dragged.
Asks the image list to hide the drag image.
Asks the image list to show the drag image.
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.
Was the drag object created automatically?
This property is of little use, more important is the AutoFree property.
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.
The control that is dragged (source).
Current mouse position in screen coordinates.
The control over which the object currently is dragged (target).
Mouse position in client coordinates of the DragTarget.
Indicates whether the drag object has been dropped yet.
Contains False while dragging is in progress, or when dragging has been aborted.
A class type.
A drag object that is automatically destroyed after use.
Extends TDragObject to automatically free itself in the DragManager.

TDragObjectEx is a TDragObject descendant. It provides an overridden constructor which sets the AutoFree property to True.

Constructor for the class instance.

Create is the overridden constructor for the class instance. Create sets the value in AutoFree to True. AutoFree is tested by the DragManager at the end of a dragging operation.

Control for the class instance.
A drag object for dragging a control.

While a TDragObject can be used for dragging controls, this class knows that it drags a control, and asks it for a DragCursor and DragImages.

Asks the Control to provide a drag cursor.
Asks the Control to provide an ImageList.
The Image list to be used in dragging this control.
Creates an object to be destroyed after use.
The control to drag.
Orientation of DockZones and docked controls, similar to

This is a Delphi relic, bound to TDockTree and not very useful in application code. All DockZones in a DockTree have an orientation, horizontal or vertical, indicating how controls are arranged in the dock zone. When a control is docked into a zone, it obtains the orientation of that zone.

The orientation for the control can be stored as the opposite for the dock zone, depending on the DockManager used.
no orientation applies (like alNone).
siblings are arranged horizontally, children top-to-bottom.
siblings are arranged vertically, children left-to-right.
children are pages in a tabbed control.
The type of an OnDockDrop handler.

An OnDockDrop event is sent by the drop target (dock site) on the drop of a dragged object.

The drop target (docksite control).
The DragDock object, containing information about the dragged object.
The type of an OnDockOver handler.

An OnDockOver event is sent by a dock site, when an object is dragged over it. The handler can specify whether a drop will be accepted or rejected.

The possible drop target.
The type used for OnUnDock event handler.

An UnDock event is sent by a dock site, before a control is undocked from it. The handler can reject undocking, by setting Allow to False.

The docksite from which the object is undocked.
The control to be undocked.
The new docksite for Client, Nil when undocked into floating state.
Set Allow to False to reject undocking.
The type of an OnStartDock handler.

An OnStartDock event is sent by a control when it shall be dragged and its DragKind is dkDock. The handler can provide a specific DragDock object, else a standard TDragDockObjectEx is automatically created by the DragManager.

The control being dragged.
Supply your own TDragDockObject, or leave it Nil to request automatic creation.
An OnGetSiteInfo handler returns information about a docksite.

An OnGetSiteInfo event is sent by the DragManager to all docksites. The handler can adjust the snapping rectangle (InfluenceRect), and can reject an drop.

The dock site near the mouse pointer.
The dragged control.
The screen rectangle where a drop or mouse move is directed to this docksite.
The current position of the mouse.
Set CanDock to False to reject docking.
Event handler used to draw the docking image in a drag and dock operation.

TDrawDockImageEvent is an object procedure type which specifies an event handler used to draw the docking image for TDragDockObject instances. TDrawDockImageEvent is the type used to implement the OnDrawDockImage variable in the Controls unit.

Routine used to draw dock images in drag/dock operations

OnDrawDockImage is a TDrawDockImageEvent variable which contains the default routine used to draw the docking image in a drag/dock operation. It is used in TDragDockObject methods which draw docking images likes HideDockImage, ShowDockImage, and MoveDockInage.

A drag object for drag-dock.

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

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

Adjust the DockRect relative to the dragging hotspot (DockOffset).
The parameter type is bad, should be var. Ignore it please.

The default implementation adjusts the stored FDockRect, by DockOffset. This adjustment will make the DockRect appear right over the control, when dragging starts, regardless of where the user clicked onto the control.

You'll rarely have to override this method, since the DockRect is adjusted by every target site's DockManager later.

Not used; please ignore it.
Gets the drag cursor shape for the class instance.
Finish docking.
Invokes Control.DoEndDock.
The target docksite, or Nil to make the Control float.
Initializes the dragging coordinates.

Determines the hotspot offset for adjusting the floating DockRect. Since the undocked extent of the control doesn't change while dragging, we fix the hotspot offset here.

Usage:

OffsetRect(DockRect, FDockOffset);
Shows the DockRect, remembers the coordinates in EraseDockRect.
Hides the DockRect, invalidates EraseDockRect to prevent further erases.
Moves an already visible DockRect.

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

Remembers the drawn frame coordinates in EraseDockRect.

Checks for an assigned OnDrawDockImage event handler.

HasOnDrawImage is a Boolean function used to determine if an event handler has been assigned to the OnDrawDockImage property. The return value is True if a routine has been assigned to the property. If an event handler has not been supplied, the HintDockImage routine is assigned to the event handler, and the return value is set to True.

For platforms where the Alpha blending is not enabled for Forms, the return value is always False (determined by calling GetSystemMetrics for the SM_LCLHasFormAlphaBlend metric in the widgetset class).

HasOnDrawImage is used in methods like ShowDockImage, HideDockImage, and MoveDockImage.

True when an event handler has been assigned to OnDrawDockImage.
The hotspot offset of the dragged DockRect.
Screen coordinates for a possible drop location.

DockRect gives feedback to the user where the dragged control may be dropped. When no docksite signals acceptance, the DockRect uses the floating state of the dragged control. When a drop will dock the control, the DockRect signifies the approximate position for the docked control.

How the dragged control will be docked, relative to the target control.

When the target is a DockTree, DropAlign indicates the placement of the control relative to DropOnControl. Other docking methods require a specialized (derived) DragDockObject.

The already docked control, relative to which the dragged control will be docked. Nil for an empty docksite.
The final state of the dragged control (after drop).
True when the dragged control becomes or stays floating.
Determines whether the dock site shall be enlarged.
Not normally used, perhaps a special AnchorDocking property?
Area to be erased when refreshing the display for the docking rectangle.

EraseDockRect is a TRect property that represents the area to be erased when redrawing the docking rectangle. The value in EraseDockRect is assigned in InitDock, and updated to contain the value from DockRect when the docking rectangle has been altered in methods like ShowDockImage, HideDockImage, and MoveDockImage.

EraseDockRect is passed as an argument to OnDrawDockImage, and to the underlying widgetset class.

A drag object for docking that is automatically destroyed after use.
Creates an object to be destroyed after use.
The abstract base class used to manage dragging of controls (for drop or dock operations).

TDragManager specifies an object-oriented version of the Delphi drag manager. It is implemented by the TDragManagerDefault descendant.

The registered dock sites should be stored in a persistent list, not in a DragManager instance.
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 has changed.
Generates visual feedback for mouse movement in a drag operation.
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.
Check if dragging is in progress.
True if dragging.
True if the specified control is being dragged.
Adds the control to the list of registered docking sites.
This should become a class method, maintaining the list of registered docking sites outside any DragManager instance.
The DockSite to register.
True for adding, False for removing the site.
Starts dragging a control.

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

The control that initiates the drag operation.
False when dragging should start only when the mouse is moved (delayed).
How much the mouse must move before delayed dragging starts.
Updates the visual dragging feedback.
Mouse position in screen coordinates.
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.

False when dragging was aborted.
Indicates if the mouse coordinates are within the drag threshold for the specified control.

CanStartDragging is an abstract virtual Boolean function used to determine if the mouse has been moved beyond the threshold that initiates a drag operation. The result is True when the mouse coordinates in X and Y are located within the client rectangle and threshold for the specified control in Site.

CanStartDragging must be implemented in a descendent class, like TDragManagerDefault.

Start dragging immediately, on MouseDown?
This is the default value for e.g. BeginDrag.
The threshold amount for mouse movement before delayed dragging starts (default is 5 pixels).
The current DragManager (always TDragManagerDefault).
A DragManager must be implemented in the Controls unit; it requires access to private members in the classes declared in the unit.
The layout manager for a docksite.

TDockManager is an abstract class for managing the controls on a dock site. Every docksite can have a DockManager, which arranges the docked controls. See TDockTree for more info.

Creates an DockManager for ADockSite.
This is the TWinControl acting as the docksite.
Starts updating the DockSite layout.
Finishes 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.

The docked control.
The enclosing rectangle, in client coordinates of the docksite.
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.

True if the DropAlign was determined.
The DragDockObject holding all information about the drag-dock operation.
Position DropCtl relative Control, using the alignment specified by InsertAt.

InsertControl determines the placement 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 one to implement other than tree-style docksites.

The control relative to which insert.
How to insert relative to Control.
The control to insert.
The DragDockObject holding all information about the drag-dock operation.
Restores the layout of the docksite from the specified stream.

The controls to be docked can be retrieved by using ReloadDockedControl in the docksite. This method returns only existing controls of the given name, owned by the owner of the docksite, by default.

The stream with the layout information.
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, et. al.).

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

The message to be processed.
Handles special painting of the docksite.

While the docked controls paint themselves, the eventual dockheaders and other decorations have to be painted by the DockManager.

The device context, used to paint.
Determines the DockRect while dragging a control over the docksite.

This method updates DockRect to provide visual feedback when a control is dragged over the docksite. The initial DragDockObject.DockRect spans the entire DockSite.

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

The Lazarus 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. When you override the Lazarus version, you may have to determine the dock sibling and DropAlign again, when the default determination (in TControl and TWinControl) is inappropriate.

The dropped control.
The control relative to which Client shall be docked; Nil for docking into the docksite.
How to dock, relative to DropCtl.
The screen rectangle of the docksite, to be adjusted by this method.
The DragDockObject holding all information about the drag-dock operation.
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.

Control to remove.
ResetBounds
refreshes the layout of the docksite.

This method typically notifies the DockManager when the DockSite calls its Resize method. When the extent of the docksite 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.

When True, always update the layout.
Saves the docksite layout to Stream.
Write the layout information into this 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".

The intended purpose of this method is the replacement of a docked control by a Notebook, preserving the DockZone. This operation should be handled by an DockManager internally, and calls to this method should be ignored.

The control to be replaced later.
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.

True if the DockManager should be destroyed together with the docksite.
Determines whether the specified control is a windowed control using the current dock manager.
When the return value is True, the Control can be docked using the dock manager.
True when Control can be docked using the dock manager.
Control examined in the method.
The DockManager class type, for use when a DockManager is automatically created.
Range for control size constraints.
Enumerated type with options used in TSizeConstraints.
Not used in the current LCL Implementation.
Set type used to store values from the TSizeConstraintsOption enumeration.
Holds maximum and minimum values that can be used in sizing objects.
Sets the value for the Options property.
New value for the Options property.
Calls an OnChange handler if assigned.
Copies property values to the specified persistent object.
TPersistent.Assign
Persistent object where property values are stored.
Sets the value for the MaxHeight property.
New value for the MaxHeight property.
Sets the value for the MaxWidth property.
New value for the MaxWidth property.
Sets the value for the MinHeight property.
New value for the MinHeight property.
Sets the value for the MinWidth property.
New value for the MinWidth property.
Constructor for the class instance.
TControl instance where the size constraints are applied.
Asks the interface for size constraints.
Used by the interface to set the interface constraints.
Should only be used by custom components, not by applications.
Determines the minimum applicable width, given the local and interface constraints.
Zero means no constraints.
Determines the minimum applicable height, given the local and interface constraints.
Zero means no constraints.
Determines the maximum applicable width, given the local and interface constraints.
Zero means no constraints.
Determines the maximum applicable height, given the local and interface constraints.
Zero means no constraints.
Determines the constrained Width, and transfers it to the widget.
The constrained width.
The suggested width.
Determines the constrained Height, and transfers it to the widget.
The constrained height.
The suggested height.
Adjusts width and height values in the class using the specified scaling factors.
Scaling factor applied to width values.
Scaling factor applied to height values.
The maximum height allowed by the widget.
The maximum width allowed by the widget.
The minimum height allowed by the widget.
The minimum width allowed by the widget.
The Control to which these constraints apply.
Options used to determine the size constraints.
Event handler for a change in the constraints.
The maximum height.
The maximum width.
The minimum height.
The minimum width.
Specifies an event handler signalled to resize a control to the specified size constraints.

TConstrainedResizeEvent is an object procedure type that specifies an event handler signalled to resize a control to the specified size constraints. Used to implement the OnConstrainedResize event in TControl.

TObject for the event notification.
Alias to the Integer type.

TSpacingSize is an alias to the Integer type. TSpacingSize is used for values that represent spacing around or between controls. TSpacingSize is the type used to implement properties in TControlBorderSpacingDefault and TControlBorderSpacing.

Modes for aligning a control in a table cell.
Cause the cell to fill the available space for the cell.
Cell is aligned to the Left and Top coordinates.
Cell is aligned to the Right and Bottom coordinates.
Cell is aligned to the center of the its width and height.
Set type used to store values from the TControlCellAlign enumeration.
Defines the default values for TControlBorderSpacing.

TControlBorderSpacingDefault is a record type which defines the default values for properties in a TControlBorderSpacing instance. Used to differentiate default values in derived TControl classes.

Pointer to a TControlBorderSpacingDefault type.
Describes the (minimum) spacing around a control.

TControlBorderSpacing defines the spacing around a control. The spacing around its children and between its children is defined in .

Left, Top, Right, Bottom: Integer;
  Defines the space available to the auto-sized 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 but specified 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.

Gets the value for the AroundBottom property.
Value for the property.
Gets the value for the AroundLeft property.
Value for the property.
Gets the value for the AroundRight property.
Value for the property.
Gets the value for the AroundTop property.
Value for the property.
Gets the value for the ControlRight property.
Value for the property.
Gets the value for the ControlTop property.
Value for the property.
Gets the value for the ControlWidth property.
Value for the property.
Implements the storage specifier for the Around property.
Implements the storage specifier for the Bottom property.
Implements the storage specifier for the InnerBorder property.
Implements the storage specifier for the Left property.
Implements the storage specifier for the Right property.
Implements the storage specifier for the Top property.
Sets the value for the Around property.
New value for the Around property.
Sets the value for the Bottom property.
New value for the Bottom property.
Sets the value for the CellAlignHorizontal property.
New value for the CellAlignHorizontal property.
Sets the value for the SetCellAlignVertical property.
New value for the SetCellAlignVertical property.
Sets the value for the InnerBorder property.
New value for the InnerBorder property.
Sets the value for the Left property.
New value for the Left property.
Sets the value for the Right property.
New value for the Right property.
Sets the value for the indexed Space property.
Identifies the ordinal position in the indexed property.
New value for the indexed Space property.
Sets the value for the Top property.
New value for the Top property.
Invalidates the control and signals the OnChange event handler.
Currently ignored (distinction no longer required).
Constructor for the class instance.
The associated control which owns the class instance.
Pointer to an record with default settings; can be Nil for all zero defaults.
Copies property values from the specified persistent object.
TPersistent
Persistent object with the values copied in the method.
Copies property value from the class instance to the specified persistent object.
TPersistent
Persistent object where property values are stored.
True when the specified spacing is the same as the current settings.
Returns the bounds with added Around space.
Out parameter, initial contents are ignored!
The space on a control side, including Around space.
The space value.
The requested edge.
Gets the value for the indexed Space property.
Value for the indexed Space property.
Ordinal position for the value in the indexed property.
Automatically adjusts the size of the control using the specified proportions.

AutoAdjustLayout is a procedure used to automatically adjust the size of the control using the specified proportions.

AXProportion and AYProportion are Double values which contain the scaling factor applied to width and height values in corresponding properties. For example, 1.25 indicates an increase to 125% of the original value, and 0.5 indicates a 50% decrease in the original value.

AutoAdjustLayout scales the value in width and height for properties, including:

- Around
- InnerBorder
- Left
- Top
- Right
- Bottom

When property values are altered in the scaling operation, the InvalidatePreferredSize method is called to recalculate the dimensions for the control. The Change method is called when value(s) in InnerBorder have been altered.

Scaling factor applied to width values.
Scaling factor applied to height values.
The control to which this border spacing applies.
Kind of array access to the space at every side.
The side for which the space is requested.
Spacing used around and on the left-hand side of the control.

AroundLeft is a read-only Integer property which indicates the spacing used around and on the left-hand side of the control.

AroundLeft represents the total space reserved on all sides of the control, plus any additional space reserved on it left-hand edge. The value for the property is calculated as the sum of the values from the Around and Left properties. Updates must be performed to the Around and Left properties.

Space reserved around and on the top edge of the control.
Space reserved around and on the right-hand side of the control.
Space reserved around and on the bottom edge of the control.
Space reserved on the left-hand edge of the control relative to the position for the control.

ControlLeft is a read-only Integer property that indicates the space reserved on the left-hand edge of the control relative to the position for the control class instance. The value in ControlLeft is calculated as the difference between the Left position for the control and the values in the Around and Left properties. For example:

FControl.Left-Around-Left

If a TControl instance is not available in Control, the value for the property is 0 (zero).

Space reserved on the top edge of the control relative to the position for the control.
Total width for the control including spacing values in Around, Left, and Right.

ControlWidth is a read-only Integer property that contains the total width for the control including spacing values in the Around, Left, and Right properties. The property value is calculated using the following formula:

TControl.Width + (2 * Around) + Left + Right

If a TControl instance is not available in Control, the value for the property is 0 (zero).

Total height for the control including spacing values in Around, Top, and Bottom.
Space reserved on the right-hand edge of the control relative to the position for the control.
Space reserved on the bottom edge of the control relative to the position for the control.
Event handler for a change in border spacing.
The space at the left border.
The space at the top border.
The space at the right border.
The space at the bottom border.
The space to add on each side of a control.
Space added to the widget's preferred size

When calculating the preferred size of control, the LCL asks the widget first.

When the widget returns a preferred size, e.g. a TButton widget, then the InnerBorder is added twice to this size - e.g. to the Height for top and bottom space.

If the widget does not return a preferred size, the InnerBorder has no effect.

The horizontal alignment inside a table cell.
The vertical alignment inside a table cell.
Operations in
AnchorSide added.
AnchorSide removed.
AnchorSide changed.
Specifies how the side of a control is anchored to other controls.

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. For example:

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

Another example:

+-------+ | | +---+ | B | | A | | | +---+ +-------+

Centering A relative to B:

A.AnchorSide[akTop].Side:=asrCenter; A.AnchorSide[akTop].Control:=B;

Or use this equivalent:

A.AnchorSide[akBottom].Side:=asrCenter; A.AnchorSide[akBottom].Control:=B;
Determines if the Control uses an anchor on the side specified in Kind.
Sets the value for the Control property.
New value for the Control property.
Sets the value for the Side property.
New value for the Side property.
Gets the owner of the persistent object.
TPersistent
Owner of the persistent object.
Constructor for the class instance.

Create is the constructor for the class instance.

Create calls the inherited constructor, and sets the values in the Owner, Kind, and Side properties. The default value for Side is asrTop.

Owner of the class instance.
TAnchorKind value for the Kind property.
Destructor for the class instance.
Get information about the target control, side and side position.
The control we are anchored to.
The side we are anchored to.
Position of the side to anchor to.
Checks for anchor cycles and invalid targets, and returns information about the target side.
Can raise an exception with the message: 'TAnchorSide.CheckSidePosition invalid Side'.
False when errors have been found.
The control we are anchored to.
The side we are anchored to.
Position of the side to anchor to.
Copies properties from the specified persistent object into the current class instance.

Assign is an overridden method in TAnchorSide used to copy property values from the persistent object in Source into the current class instance. When Source is derived from TAnchorSide, the following properties are copied:

- Side
- Control

If Source is not derived from TAnchorSide, the inherited method is called using Source as an argument.

TPersistent
Persistent object with the properties copied in the method.
True when we are anchored to our parent, at least on the ParentSide.
Remove conflicting anchors.

With asrCenter, both sides are controlled by one anchor. Disable opposite anchor and all aligning.

The control being anchored.

For example:

AButton1.AnchorSide[akBottom].Owner = AButton1
The control side being anchored.

Every control has four AnchorSide elements, one for each side. For example:

AButton1.AnchorSide[akLeft].Kind := akLeft.
The target control of the anchor.

For example: if the right side of a Button1 is anchored to the left side of Edit1, then:

Button1.AnchorSide[akRight].Control // contains Edit1

and

Button1.AnchorSide[akRight].Side // contains asrLeft
The side of the target Control, to which we anchor.

For example, if the right side of a Button1 is anchored to the left side of Edit1, then:

Button1.AnchorSide[akRight].Control=Edit1

and

Button1.AnchorSide[akRight].Side=asrLeft
Links an Action to a control.

An ActionLink is created when an Action is assigned to the control. TControl.Action effectively becomes TControl.ActionLink.Action.

An ActionLink propagates changes in Action properties to the client control. It's assumed that properties of the same value (in the Control and Action) are linked to the Action, and follow changes to the Action properties.

Linked control properties are (by default):

- Caption
- Enabled
- Hint
- HelpContext, HelpKeyword, HelpType: these are linked only if all three property values match.
- Visible
- OnClick is linked to Action.Execute

The control can update itself, when it receives a Change notification from the ActionLink .

The client control that is linked to the action.
It can be assumed that FClient is not Nil.
Called during construction, sets FClient to the given control.
TBasicActionLink
The control linked to the action.
Sets the client's Caption, if the old values match.
TActionLink.SetCaption
Sets the client's Enabled property, if the old values match.
Sets client's Hint, if the old values match.
Sets the HelpContext, if the old Help properties match (IsHelpLinked).
Sets the HelpKeyword, if the old Help properties match (IsHelpLinked).
Sets the HelpType, if the old Help properties match (IsHelpLinked).
Sets the Visible property in the client, if the old values match.
Set OnClick handler for the client, if the old values match.
True if the client's OnClick is the action's OnExecute handler.
Compose the hint string, depending on HintShortCuts.
TApplication.HintShortCuts
Always True.
The hint to show.
Help properties are assumed linked only when all these properties match.
Compares the HelpContext, HelpKeyword and HelpType properties.
TActionLink.IsHelpLinked
True only if all three Control properties match the Action properties.
Class of
Exception raised when a loop is detected when adjusting the size for controls.

ELayoutException is an Exception descendant that implements the exception raised when a loop is detected when adjusting the size for controls, or when an invalid value is assigned to the control width or height.

Represents AutoSizing phases for controls.

TControlAutoSizePhase is an enumerated type with values that represent phases or steps in the auto-sizing process for controls. Values from TControlAutoSizePhase are stored in the TControlAutoSizePhases set type.

Create/Destroy handles.
Makes a handle visible.
Set type used to store values from the TControlAutoSizePhase enumeration.
Type used for
Type used to implement an OnShowHint event handler.
TObject for the event notification.
Hint information used to derive hint value.
Handler type for OnContextPopup.
The clicked control.
Mouse position in client coordinates; (-1,-1) if the event was not generated by a mouse click.
Set Handled to True when everything was handled; False shows the associated PopupMenu, by default.
Flags mostly for pending actions.
Set by TControl.ReadState, and unset by TControl.Loaded when all controls for the form have finished loading.
Set when AutoSize was delayed.
Set when Left was set during loading.
Set when Top was set during loading.
Set when Width was set during loading.
Set when Height was set during loading.
Set when ClientWidth was set during loading.
Set when ClientHeight was set during loading.
Set when BoundsRectForNewParent has been initialized.
Indicates if the rectangle in the base bounds for a control is valid.
Set when PreferredSize has been calculated (CalculatePreferredSize).
Set (in WndProc) while processing an LM_PAINT message.
Set type used to store values from the TControlFlag enumeration.
Notification handler types.

Notification handlers only receive a Sender argument, and must know themselves why they have been invoked.

Notification request for OnResize.
Notification request for OnChangeBounds.
Notification request for OnVisibleChanging.
Notification request for OnVisibleChanged.
Notification request for OnEnabledChanging.
Notification request for OnEnabledChanged.
Notification request for OnKeyDown.
Indicates the policy for the LCL to execute automatic adjustments in the form layout.
Widgetset dependent.
A fixed absolute layout on all platforms.
Smartphone platforms use this one, the x axis is stretched to fill the screen and the y axis is scaled to fit the DPI.
For desktops using High DPI, scale x and y to fit the DPI.
Indicates the role which a accessible object takes in the user interface.
Something to be ignored. For example a blank space between other objects.
An object that displays an animation.
A button.
A cell in a table.
An object that displays a graphical representation of data.
An object that can be checked or unchecked, or sometimes in an intermediary state.
A clock displaying time.
A control which allows selecting a color.
A generic column in a table.
A list of choices that the user can select from.
A controls which displays and possibly allows one to choose a date.
A grid control which displays cells.
A control which groups others, such as a TGroupBox.
A graphic or picture or an icon.
A text label as usually placed near other widgets.
A list of items, from which the user can select one or more items.
An item in a list of items.
A main menu bar.
A item in a menu.
A control which shows a progress indication.
A radio button, see for example TRadioButton.
A grip that the user can drag to change the size of widgets.
A generic row in a table.
A control to scroll another one.
A control which allows one to increment / decrement a value.
A control with tabs, like TPageControl.
Text inside of a control, like text in a row cell.
A multi-line text editor (for example: TMemo, SynEdit).
A single-line text editor (for example: TEdit).
A control that holds ToolButtons.
A button on a ToolBar.
A control which allows one to drag a slider.
A list of items in a tree structure.
An item in a tree structure.
An item that doesn't fit any of the other categories.
A top level window.
Implements an enumerator for a list of TLazAccessibleObject instances.
Gets the value for the Current property.
Value for the property.
Current value for the enumerator.
Represents an accessibility object for user or accessibility tool interactions.

Every TControl has a TLazAccessibleObject instance associated with it, which means that every TControl is potentially accessible. But to actually be usable, the accessible object needs to have its properties set, the most important of which are the role, description and value. Native windowed classes should already receive accessibility properties from the underlying widgetset, while TCustomControl descendants will use the accessibility properties provided by LCL itself.

User applications should add accessibility for their own TCustomControl descendant classes, and possibly customize the descriptions of some elements. It is also possible to make an accessible object invisible to the user, which is done by setting its AccessibleRole property to larIgnored.

Accessibility support in Lazarus is also documented on the Wiki at: .

Gets the value for the Position property.
Value for the property.
Gets the value for the Size property.
Value for the property.
Sets the value for the Handle property.
New value for the Handle property.
Sets the value for the Position property.
New value for the Position property.
Sets the value for the Size property.
New value for the Size property.
Member with the Handle for the accessibility object.
Member with the AVL tree for the sorted child objects.
Member with the value for AccessibleName.
Member with the value for AccessibleDescription.
Member with the value for AccessibleValue.
Member with the value for AccessibleRole.
Gets the value for the AccessibleValue property.
Value for the property.
Gets the value for the Handle property.
Value for the property.
The control that this accessible object is attached to. It might be the main accessible object of this control or it might represent a sub-part of a control.

The control that this accessible object is attached to. It might be the main accessible object of this control, or it might represent a sub-part of a control which does not have a corresponding TControl, like an item of TTreeView. One can verify if this is the main accessible object of the control by checking if (lAccessibleObject.OwnerControl = lAccessibleObject.OwnerControl.GetAccessibleObject())

The parent TLazAccessibleObject of this accessible object.
Available to be used to connect to an object.
Available for Widgetsets to use.
Constructor for the class instance.
Destructor for the class instance.
Returns if the handle of this object was already allocated or not.
Utilized to set all properties of this property via widgetset routines when creating the handle.
Sets the value for AccessibleName.
New value for the AccessibleName property.
Setter for the property AccessibleDescription.
Setter for the property AccessibleValue.
Setter for the property AccessibleRole.
Inspect the tree of accessible objects upwards until it finds a parent which is attached directly to a windowed control, a TWinControl.
Creates and returns a new child accessibility object.
Child accessibility object created in the method.
Inserts an already created child accessible object as a child of this one.
Removes all children of this control; freed if they are not attached to a TControl instance.
Removes a child accessible object.
Obtains a child accessible object by its index.
Obtains a child accessible object by its DataObject property.
Returns the number of direct children that this accessible object has.
Searches in sub-controls for the first child accessibility object.
Searches in sub-controls for the next child accessibility object.
Returns the currently selected child accessible object or Nil if none are selected; Override this method in your sub class.
Returns the child of this control located at a particular position given as a client position for the control.
The name for this accessible object.
The description of this accessible object.
The value of this accessible object.
The role of this accessible object.
The position of this accessible object.
The size of this accessible object.
The widgetset handle of this accessible object.
Default enumerator for the children.
The base class for visible controls.

TControl is a TLCLComponent descendant which implements the base class for visual controls in the LCL (Lazarus Component Library). TControl extends ancestor classes, like TLCLComponent and TComponent, with properties and methods needed to configure the appearance and behavior for the visual control and handle user interactions at run-time.

Some properties and methods are in all of its descendent classes. Others are implemented as needed in descendent classes. The properties and methods fall into categories like:

- Appearance
- Position and Orientation
- Sizing and Aligning
- Assistance and Accessibility
- Drag and Drop
- Docking
- Action Support
- Hi-DPI Awareness and Scaling
- Handler Lists for Event Notifications
- Window and Control Message Handling
- Keyboard and Mouse Message Handling
- Widgetset-specific Members and Methods

Applications do not normally create instances of TControl. It is used as an ancestor for descendent classes which implement additional features or behaviors.

TControl does not provide a window handle needed to draw the control in the underlying widgetset class. It includes a Parent property which is the windowed control where the control is hosted. It also provides the handle needed to draw the control.

Use TWinControl for a control which provides its own window handle.

TLCLComponent TComponent
Array of the installable notification handlers.
Intended ClientSize, initialized during loading.
Implements the storage specifier for the CaptureMouseButtons property.
Implements the OnChange handler routine assigned to the ActionLink.

When an Action is assigned to the control, related properties are updated using ActionChange.

The changed Action.
Gets the value for the AccessibleDescription property.
Value for the property.
Gets the value for the AccessibleValue property.
Value for the property.
Gets the value for the AccessibleRole property.
Value for the property.
Gets the value for the AutoSizingAll property.

Returns the value from the AutoSizingAll property in the Parent when Parent has been assigned. Otherwise, the existing property value is used.

Value for the AutoSizingAll property.
Gets the value for the indexed AnchorSide property.
Value for the indexed AnchorSide property.
TAnchorKind value with the array element accessed for the property value.
Gets the value for the indexed AnchoredControls property.
Value for the indexed AnchoredControls property.
Ordinal position in the list of anchored controls for the property value.
Gets the value for the BoundsRect property.
Value for the BoundsRect property.
Gets the value for the ClientHeight property.
Value for the ClientHeight property.
Gets the value for the ClientWidth property.
Value for the ClientWidth property.
Gets the value for the LRDockWidth property.
Value for the LRDockWidth property.
Gets the value for the TBDockHeight property.
Value for the TBDockHeight property.
Gets the value for the Text property.

Uses RealGetText (which reads the Caption member), instead of GetTextBuf (which calls WM_GETTEXT), when possible.

The value for the Text property.
Gets the value for the UndockHeight property.
Value for the UndockHeight property.
Gets the value for the UndockWidth property.
Value for the UndockWidth property.
Implements the storage specifier for the Anchors property.
Implements the storage specifier for the BiDiMode property.
Implements the storage specifier for the Enabled property.
Implements the storage specifier for the Font property.
Implements the storage specifier for the Hint property.

The return value is True when the property value is not supplied by an Action linked to the control. This occurs when an ActionLink has not been assigned for the control, or when the IsHintLinked property in the ActionLink is set to False.

True when the property value is stored using LCL component streaming.
Generate MouseEnter and MouseLeave events.
Adjust the intended (given) Bounds, according to Constraints.
Performs the message handler for mouse button down messages; calls the MouseDown handler.
Performs the message handler for mouse button up messages; calls the MouseUp handler.
Sets the value for the AccessibleDescription property.
New value for the AccessibleDescription property.
Sets the value for the AccessibleValue property.
New value for the AccessibleValue property.
Sets the value for the AccessibleRole property.
New value for the AccessibleRole property.
Sets the value for the indexed AnchorSide property.
Index for the element updated in the method.
New value for the AnchorSize property.
Sets the value for the BorderSpacing property.
New value for the BorderSpacing property.
Sets the value for the Constraints property.
New value for the Constraints property.
Sets the value for the Text property.
Uses the RealSetText method instead of SetTextBuf, when possible.
The new value for the Text property.
Member with the accessibility object for the control.
Member with the value for the ControlState property.
Member with the value for the Cursor property.
Gets the value for the Cursor property.
Value for the Cursor property.
Sets the value for the Cursor property.

Calls Perform to send a CM_CURSORCHANGED control message to the processing loop when the member for the property is updated.

New value for the Cursor property.
Sets the value for the Visible property.

Changing the value for the property causes additional actions to be performed.

VisibleChanging is called to notify event handler routines for the control. The Perform method is used to send a CM_VISIBLECHANGED control message to the processing loop for the control.

Preferred width and height values in the control, and its children (when derived from TWinControl), are invalidated. To minimize the overhead from the DoAutoSize method, auto-sizing is temporarily disabled when the control is updated. The AdjustSize method is called to perform the equivalent of DoAutoSize without the extra overhead of getting the preferred sizes from the widgetset class. If the control is not Visible but has a Parent control, the AdjustSize method in Parent is called.

VisibleChanged is called to notify event handler routines for the control.

SetVisible ensures that ControlState is updated to include the value csVisibleSetInLoading when csLoading is included in the ComponentState property.

New value for the Visible property.
Performs actions needed when the handle for the parent control is freed.

Has an empty implementation in TControl, and must be implement in descendent classes.

For internal use only; call AdjustSize instead.
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.

Resizes and aligns the control and all of it children.

No actions are performed in the method when AutoSizingAll is True, or when the control is not derived from TWinControl.

Calls DoAutoSize while the control includes cfAutoSizeNeeded in its ControlFlags property. Called from the AdjustSize and EnableAutoSizing methods.

Raises an EInvalidOperation exception if Parent has not been assigned for the control.
Sets AutoSizing to True; used to prevent loops.
End of the auto-sizing process, resets AutoSizing to False.
Request further processing after an anchor side was changed.
Ignored.
Requests further processing after an anchor side has changed, that anchors another control to this one.
Sets the value for the Align property.

Changing the value for the property causes additional actions to be performed.

New value for the Align property.
Sets the value for the Anchors property.
New value for the Anchors property.
Sets the value for the AutoSize property.

Calls AdjustSize when the property is enabled.

New value for the AutoSize property.
Called when the Bounds of the control have been changed; override as required.
Notifications can be performed in this method.
Creates the default BorderSpacing object instance for the class.

Allocates the class instance used for the BorderSpacing property. Can be overridden in descendent controls to use the type or default values needed for the class instance.

The class instance created in the method.
Performs actions needed when value(s) in Constraints have been changed.

DoConstraintsChange calls AdjustSize to ensure that the control and any children are sized and positioned to the new Constraints for the control. The method is overridden in descendent classes, like TWinControl, to perform actions needed for the class instance.

Called from the TSizeConstraints.Change method before it signals the OnChange event handler in the constraints class instance.

Not used in the method.
Reacts on a change in the control's border spacing.
Checks for a defined (non-zero) value in BorderSpacing.InnerBorder.
True when InnerBorder has been assigned and must be applied to the control.
Implements the storage specifier for the Caption property.

Returns True if ActionLink has not been assigned, or its IsCaptionLinked property is set to False.

Returns True if ActionLink has not been assigned, or its IsCaptionLinked property is set to False.
Sends Move and Size messages through the LCL message paths.

Overridden in TWinControl; in TControl it's a NOP. This method simulates the VCL behavior and has no real effect.

Signals the OnConstrainedResize handler.
Override this method to return the preferred height and width for the control.

Calculates the preferred width and height for a control, which is used by the LCL auto-sizing algorithms as the default size. Negative or zero (0) values are treated as undefined and the LCL uses other sizes instead.

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

When WithThemeSpace contains True, space is added for stacking.

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

Set this argument to the preferred width.
Set this argument to the preferred height.
True when space around stacked controls should be added.
Signals OnResize event handlers for the control.
Signals OnChangeBounds event handlers for the control.
Checks for changes and calls DoOnChangeBounds if needed.

Maintains internal members used to track the last bounds rectangle and client size before DoOnChangeBounds is called. Called from the LoadedAll and ChangeBounds methods.

Checks for changes and calls DoOnResize if needed.

No actions are performed in the method at design-time, during LCL component streaming, or when AutoSizeDelayed is set to True.

Resize updates internal members used to track the current values in the Width, Height, ClientWidth, and ClientHeight properties. It calls DoOnResize to signal OnResize event handler(s) (when assigned) for the control.

Smart calling of Parent.AlignControls (very indirectly).
Update the rules for anchoring the control.
Sets the bounds (left, top, height, width) optionally the BaseBounds of the control.

ChangeBounds is called whenever the position or size of the control is set, either via the properties or by the layout engine in the LCL.

SetBounds calls ChangeBounds internally with KeepBase set to False, while the LCL layout engine calls it with KeepBase set to True.

Override this for code that might change the preferred size or resizes other controls.

You can call this function in your custom controls. Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

True when the BaseBounds should not be modified.
Internal function to set the control's bounds (Left, Top, Height, Width).

DoSetBounds is a low level function to set the private variables FLeft, FTop, FWidth, FHeight. Do not call this function, only the LCL calls it.

It also updates FClientWidth and FClientHeight accordingly.

Override this to update the content layout of the control, for example scroll bars. As always: do not paint here, but call Invalidate and paint in OnPaint or override Paint.

Scales the minimum and maximum Width and Height.

ScaleConstraints is called from the ChangeScale method; never call it directly. Multiplier and Divider contain the values passed as arguments to the ChangeScale method.

Multiplier used to derive the scaling factor for the control constraints.
Divisor used to derive the scaling factor for the control constraints.
Applies scaling (multiplier and divider) to the bounds coordinates, constraints, and Font in a control.

ChangeScale is amethod used to apply scaling, expressed by the Multiplier and Divider arguments, to size values in the control. These values include:

- The minimum and maximum heights and widths in Constraints (by calling ScaleContraints).
- The Font height (when ParentFont is not enabled).
- The bounds rectangle for the control (Left, Top, Bottom, and Right). If the control is the top-most form in a component hierarchy, the Top and Left values are not changed.

ChangeScale calls the MulDiv routine in the LCLType unit to calculate the scaled numeric values. The results from the calculations are rounded and returned as an Integer type.

No actions are performed in the method when Multiplier and Divider have the same value.

ChangeScale can be overridden in descendent classes to perform any additional action needed for the class type.

ChangeScale is called from the ScaleControls and ScaleBy methods in the TWinControl descendant.

MulDiv
Multiplicand used to calculate the scaled numeric values.
Divisor used to calculate the scaled numeric values.
Determines if auto-sizing is possible, and if so, gets the new width and height when enabled.

Always returns True in TControl. The values in NewWidth and NewHeight are not updated in TControl. Override the method in descendent classes to return values as needed for the class type.

TControl returns True.
Suggested width, can be adjusted in an overridden version.
Suggested height, can be adjusted in an overridden version.
Sets the value for the BiDiMode property.
New value for the BiDiMode property.
Sets the value for the ParentBiDiMode property.
New value for the ParentBiDiMode property.
Determine if a parent control is involved in the alignment process.
Gets the value for the ClientOrigin property.
Value for the ClientOrigin property.
Gets the value for the ClientRect property.

Returns the size for the visual client area in the control. For example, the inner size of a TGroupBox. For a TScrollBox it is the visual size, and not the logical size.

The return value is a TRect instance with the Top and Left members set to 0, and the Height and Width members set to the corresponding property values for the control.

TControl.ClientRect
Value for the ClientRect property.
Logical client area, can be bigger than the visible client area.
A has a logical client area, of which only a portion can be visible. The origin always is (0,0), regardless of an ScrollOffset.
TControl returns the ClientRect.
Get the visible part of the logical client area.

Includes the ScrollOffset in a TScrollingWinControl Parent.

For TControl: When the Parent is a TScrollingWinControl, the ClientRect is offset by its ScrollOffset. This Rect can be intersected with the visible ClientArea of the Parent, to get the actual visible part of the control.

For TWinControl: The visible ClientRect is offset by ScrollOffset, to reflect the visible part of the logical ClientRect.

The scrolled ClientRect (TopLeft, BottomRight).
Returns the offset of the scrolled client area (in a scrolling TWinControl).
The overridden method may fail when the TScrollingWinControl has only one scrollbar.
TScrollingWinControl.GetClientScrollOffset
The X and Y offsets of the visible client area, equal to the scrollbar positions.
Gets the value for the ControlOrigin property.
Returns the origin (top left pixel) of the control, in screen coordinates.
Value for the ControlOrigin property.
Implements the storage specifier for the ClientHeight property.
True if the value for ClientHeight is stored using LCL component streaming.
Implements the storage specifier for the ClientWidth property.
True if the property is stored using LCL component streaming.
True when both the control's left and right side are anchored.
True if the Width varies with the Parent.Width.
True when both the control's top and bottom side are anchored.
True if the Height varies with the Parent.Height.
True while auto-sizing is in progress.
Flag to prevent recursive AutoSizing (in DoAllAutoSize).
By default Parent.AutoSizingAll is read, because a mere TControl cannot have child controls.
Internal counter, increased/decreased by DisableAutoSizing/EnableAutoSizing.
Handles a LM_CANCELMODE message for the control.

Calls the SetCaptureControl routine to clear the value in the CaptureControl variable.

Message handled in the method.
Handles a LM_CONTEXTMENU message for the control.

No actions are performed in the method at design-time, or when the result code in Message has non-zero value.

Calls DoContextPopup to signal the OnContextPopup event handler (when assigned). No additional actions are performed in the method if the context menu was displayed and executed in the OnContextPopup event handler.

Otherwise, the TPopupMenu instance in the PopupMenu property is displayed and executed by calling its Popup method.

The result code in Message is set to 1 if the context menu was displayed and executed in the method.

TPopupMenu
Message examined and optionally handled in the method.
Handles a LM_LBUTTONDOWN (left mouse button down) message for the control.

Sets MouseCapture to True when enabled in the ControlStyle property and the left mouse button is included in CaptureMouseButtons. Includes csClicked in ControlState when click events have been enabled in the ControlStyle property.

Calls the private DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message handled in the method.
Handles a LM_RBUTTONDOWN (right mouse button down) message for the control.

Sets MouseCapture to True when enabled in the ControlStyle property and the right mouse button is included in CaptureMouseButtons.

Calls the private DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message handled in the method.
Handles a LM_MBUTTONDOWN (middle mouse button down) message for the control.

Sets MouseCapture to True when enabled in the ControlStyle property and the middle mouse button is included in CaptureMouseButtons.

Calls the private DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message handled in the method.
Handles a LM_XBUTTONDOWN (extra mouse button down) message for the control.

Checks the Keys member in Message to determine whether the first or second extra mouse button is represented in the structure. No actions are performed in the method if Keys does not represent the mbExtra1 or mbExtra2 mouse button.

Sets MouseCapture to True when enabled in the ControlStyle property and the mouse button is included in CaptureMouseButtons.

Calls the private DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message examined and optionally handled in the method.
Handles a left mouse button double click message for the control.

WMLButtonDblClk is a method used to handle a LM_LBUTTONDBLCLK window message for the control. Values in ControlStyle and CaptureMouseButtons are used to determine if MouseCapture is enabled in the method. The MouseDown method is called to update the mouse pointer position and to signal the OnMouseDown event handler (when assigned). The DblClick method is called to signal the OnDblClick event handler (when assigned).

Window message handled in the method.
Message handler for right mouse button double click.
Message handler for middle mouse button double click.
Message handler for extra mouse button double click.
Message handler for left mouse button triple click.
Message handler for right mouse button triple click.
Message handler for middle mouse button triple click.
Message handler for extra mouse button triple click.
Message handler for left mouse button quadruple click.
Message handler for right mouse button quadruple click.
Message handler for middle mouse button quadruple click.
Message handler for extra mouse button quadruple click.
Message handler for extra mouse button going up.
Message handler for mouse moved.
Message handler for left mouse button going up.
Message handler for right mouse button going up.
Message handler for middle mouse button going up.
Handles mouse wheel messages for the control.
Mouse wheel message handled in the method.
Handles horizontal mouse wheel messages for the control.
Mouse wheel message handled in the method.
Message handler for control moved.
Message handler for changed control size.
Message handler for changed control position.
Handles CM_CHANGED control messages for the control.

Calls the WindowProc method in the Parent control (when assigned) to handle the control message in Message.

Control message handled in the method.
Message handler signalled when the mouse capture has been changed.
Message handler for BiDi mode changed.
Message handler for changed system Font.
Message handler for changed Enabled state.
Message handler for hit test.
The hit test handler determines the specific part of a control (caption, border...) at the given mouse position.
Message handler for mouse entering the control.
Message handler for mouse leaving the control.
Message handler for hint display.
Message handler for parent control's BiDi mode changed.
Message handler for changed parent Font.
Message handler for changed parent Color.
Message handler for changed parent ShowHint.
Message handler for changed visibility.
Message handler for control's Text changed.
Message handler for special character (TAB...).
Handles the CM_CURSORCHANGED message for the control.

At run-time, the SetTempCursor method is called to apply the temporary cursor shape in the Cursor property. No actions are performed in the method at design-time.

Control message handled in the method.
Saves the docked and undocked extent of the control.

In the floating state, it sets UndockWidth/Height to the current Width/Height. In docked state, it sets LRDockWidth/TBDockHeight to the current Width/Height.

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 with a client area equal to the given screen coordinates.
The new dock site is owned by the control.
The dock site, can be Nil for a TWinControl that can float by itself.
The bounds of the client area of the floating window.
Determine the side to which the dragged control shall be docked.
Mouse position in client coordinates.
Get the list of images usable during dragging.
Determines 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 for a floating host dock site.

An instance of this class is created whenever a control shall float, but cannot (or shall not) float by itself.

Only TWinControls can float on the screen (with Parent=Nil), but not ordinary TControls.

Since dockable forms are not supported by every platform, a dockable TWinControl may need a floating host which presents a docking handle to the user (e.g. a dock caption).

The class of a floating host dock site for this control.
Not implemented in TControl.
For internal use: user has started dragging the control.
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.

The DockObject of the current drag-dock operation.
Adjust the DockRect for floating state (no drop target under the mouse).
The dragged DockObject, containing the DockRect to adjust.
The mouse position, in screen coordinates.
Adjusts the control's position and extent for the new docksite.

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

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

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

A correct implementation should allow for computations in a derived class, and accept and handle the changed bounds without any further adjustments.
The site where the control will be docked, or Nil when it becomes floating.
The control's new Bounds, in screen coordinates when NewDockSite is Nil, else in client coordinates of NewDockSite.
Handler for a drag message, sent by the DragManager to the current target control.

These messages can be sent while dragging:

dmFindTarget
  Request to determine the possible target control for an drop. A TControl returns itself, a TWinControl finds the child control closest to the mouse position.
dmDragEnter, dmDragLeave, dmDragMove
  Notification of mouse moves. Invokes DragOver, or DockOver if docking. Result indicates acceptance of a drop.
dmDragDrop
  The dragged object has been dropped onto this control. Invokes DragDrop, or DockDrop if docking.

The Source argument of the invoked methods is the DragDockObject when docking. If the DragObject has been AutoCreated, the dragged control is passed as the Source. Otherwise, the DragObject itself is passed as Source.

Contains the result for the Drag message.

The Result member is polymorphic:

For dmFindTarget, the result is a reference to the the target control. For dmDragDropm the result is zero (0). For other drag messages, the result indicates acceptance of the drop message.

The task to perform.
The mouse position in screen coordinates.
The drag object.
The drop target, Nil if none.
Distinguishes between a drag-drop and drag-dock operation.
Invokes the OnEndDock handler.
Invokes the OnEndDrag handler.
Invokes the OnStartDock handler.
Invokes the OnStartDrag handler.
Notifies the control of a cancelled drag.
Called when an object is dragged over this control; 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.

Source can be either a TDragObject, or the dragged control.
The dragged object, a control or a DragObject.
The mouse position in client coordinates.
State change flag (dsDragEnter, dsDragMove, dsDragLeave).
Set to True when a drop is allowed.
Get the DockRect for an possible drop.

Calls the DockManager.PositionDockRect in the target site, or DragDockObject.AdjustDockRect after moving the undocked control rectangle to the DragPos. AdjustDockRect takes the hotspot of the DockRect into account.

Sets the value for the DragMode property.
New value for the DragMode property.
Returns the string for the dock caption, by default the control's Name.
Signals OnClick and/or executes the ActionLink when the control has been clicked.

Performs actions needed when the control has been clicked using the mouse or its keyboard equivalent.

Click uses the value in ActionLink (when assigned) to determine whether OnClick and / or Action are executed for the control.

When ActionLink has been assigned, it is compared to the routine in the OnClick event handler (when assigned). When the routines differ, the OnCLick event handler is signalled. If an ActionLink exists, the Execute method in ActionLink is called as well.

Neither OnClick nor the ActionLink are executed at design-time.

TBasicActionLink.Execute
Signals the OnDblClick event handler (when assigned).
Signals the OnTripleClick event handler (when assigned).
Signals the OnQuadClick event handler (when assigned).
Converts the coordinates in the mouse message from SmallInt to LongInt values.

MessageMousePos is a TSmallPoint type with the mouse coordinates as SmallInt values. The return value is a TPoint instance with the LongInt values for the converted mouse coordinates.

If the control has a Width or Height that exceeds the maximum value for the SmallInt type, GetCursorPos is called to get the current mouse pointer position and the values are converted from screen to client coordinates. Otherwise, SmallPointToPoint is called to convert the values in MessageMousePos.

GetMousePosFromMessage provides coordinates using the type needed in MouseDown, MouseUp, MouseMove, and other mouse message handling methods in the control.

TSmallPoint TPoint
TPoint instance with the LongInt values for the mouse cursor position.
TSmallPoint instance with the values converted in the method.
Handler for MouseDown events.

Called by the MouseDown message handler. Handles Focus changes, and notifies the DragManager while dragging. Finally, it calls the handler.

Which buttons are down.
Which of Ctrl, Shift or Alt keys are also pressed.
Horizontal Mouse position in client coordinates.
Vertical Mouse position in client coordinates.
Handler for MouseMove events.

Called by the MouseMove message handler. The DragManager is notified while the control is being dragged. Finally the OnMouseMove handler is invoked.

The currently pressed mouse buttons and modifier keys.
Horizontal Mouse position in client coordinates.
Vertical Mouse position in client coordinates.
Invokes the OnMouseUp handler.
The currently pressed modifier keys.
The currently pressed mouse buttons.
Horizontal Mouse position in client coordinates.
Vertical Mouse position in client coordinates.
Invokes the OnMouseEnter handler.
Invokes the OnMouseLeave handler.
Performs actions needed to handle an accelerator key for the control.

Always return False in TControl. The method is overridden in descendent classes to perform actions needed to handle an accelerator character in the Message argument.

This method is called even if the control is disabled or hidden. Provided for Delphi VCL compatibility.

True if the accelerator key in Message is handled by the control.
TLMKey instance with the character code examined in the method.
Changes the cursor shape to the value in the Cursor property.

UpdateMouseCursor is a method used to change the cursor shape displayed when the mouse is hovered over the control. No actions are performed in the method at design-time, or when the screen cursor already has a shape other than crDefault.

UpdateMouseCursor calls SetTempCursor to apply the value in the Cursor property to the Parent control.

UpdateMouseCursor is called from WMMouseMove after the mouse position has been captured, and before the OnMouseMove event handler is signalled.

Not used in the method.
Not used in the method.
Performs actions needed when the value for the control has been changed.

In TControl, Changed posts a CM_CHANGED control message to the message processing loop.

Override GetPalette to return the handle of a color palette.

Always returns 0 (zero) in TControl.

The Palette handle, zero (no Palette) by default.
Returns True if the specified class is allowed for children of this control.

Always returns False in TControl. It is overridden in descendent classes to check whether the class reference in ChildClass is allowed for the control.

True when the class is allowed as a child control.
The class type for the child control.
Updates control flags and reads the data for the component.
TComponent
TReader instance used to read the component data.
Performs actions needed when LCL component streaming has been completed.

Calls the inherited method on entry.

Ensures that values for Width and Height are available in the Bounds rectangle for the control. Explicit values for Width and Height are not always available in the values loaded using LCL component streaming. When this condition is indicated in the control flags, the ClientWidth and ClientHeight loaded from the resource stream are used in the Bounds for the control.

Ensures that values for Color, Font, BiDiMode, and ShowHint are set to values in the Parent control when enabled in the ParentColor, ParentFont, ParentBiDiMode, and ParentShowHint properties. The values from Parent are omitted when Parent has not been assigned.

Calls UpdateBaseBounds to store the bounds rectangle and client size using the loaded values.

If an Action has been assigned in the control, the ActionChange method is called to ensure that default values from the Action are applied to the control.

If an ancestor control is still loading its child controls, resize and align operations are deferred for the control. Otherwise, the LoadedAll method is called to adjust the sizes and layouts for the control.

TComponent
Called when the control and its child controls have been loaded, and their control state is changed.

LoadedAll is a procedure called when the control (and its child controls) have been loaded using the LCL component streaming mechanism, and csLoading is removed from their control state. LoadedAll is called from the Loaded method.

Defines which non-published properties should be streamed (none here).
Implements assignment of the control to an Action object, or calls the inherited method.

Properties copied in the method include:

- Enabled
- Hint
- Caption
- Visible
- OnExecute (copied to OnClick in the destination object)
- HelpContext
- HelpKeyword
- HelpType

TPersistent.Assign
Destination object which receives values copied in the method.
Called for each control on a form where the update count has reached 0 (zero).

FormEndUpdated is overridden in descendent classes, like TWinControl, which provides a container for its child controls.

Requests a repaint of the control.

InvalidateControl is an overloaded method used to redraw the bounds rectangle for control. No actions are performed in the method if the Parent control or its Handle are not assigned, during LCL component streaming, or when the control is being freed.

When CtrlIsVisible is set to True or the control has a visible design surface, the InvalidateRect routine is called. The BoundsRect for the control is erased and redrawn when the control uses an opaque drawing style, or when it occludes a sibling control in its Parent.

InvalidateControl is called from methods like Invalidate and ChangeBounds, and when a new value is assigned to the Visible property.

True if the control is visible.
True if the control use an opaque drawing style.
True if TWinControl descendants are ignored in the method.
Handles changes to the Font property.

FontChanged is a procedure used to perform actions needed when the value in the Font property has been changed for the control. FontChanged ensures that values in ParentFont and DesktopFont are set to False to reflect the font assignment.

FontChanged calls the Invalidate method to force the control to be redrawn when it is Visible. The CM_FONTCHANGED control change message is performed to reflect the change in the control state. When AutoSize contains True, the InvalidatePreferredSize and AdjustSize methods are called to update the control dimensions using the new font.

FontChanged is assigned to the OnChange event handler for the Font property in the constructor for the class instance.

Class instance generating the change notification.
[Delphi compatible] Does nothing here, all work is done in CMParentFontChanged.
Gets the value for the Action property.

The property value is retrieved from ActionLink (when assigned). Otherwise, the property value is Nil.

Value for the Action property.
Returns the Caption property.

This method is called by GetText, when GetTextBuf has not been overridden.

Value for the Caption property.
Sets the value for the Caption property.

RealSetText is a method used to apply the TCaption value in AValue to the text or caption for the control. RealSetText is called by the private SetText method, when SetTextBuf has not been overridden.

Notes on TControl.Caption, TControl.Text, et. al.

The Delphi VCL implementation relies on the virtual GetTextBuf and SetTextBuf methods to exchange text for controls.. This requires a lot of (unnecessary) copies to move values between Text and Caption.

The LCL uses strings to exchange text values because it is more efficient. To maintain VCL compatibility, the virtual RealGetText and RealSetText methods were introduced. These functions use the LCLInterface. The default GetTextBuf and SetTextBuf implementations calls the RealGetText and RealSetText methods as needed. As long as the GetTextBuf and/or SetTextBuf aren't overridden, GetText and SetText call RealGetText and RealSetText to avoid copying PChar values.

To keep things optimal, LCL implementations should always override RealGetText and RealSetText. GetTextBuf and SetTextBuf are only kept for compatibility with Delphi code.

The string value to store in the Text / Caption properties.
Performs actions needed when the value for the Text property has been changed.

TextChanged has an empty implementation in TControl, and is overridden in descendent classes to perform any actions needed for the control type. Called from the CMTextChanged message handler.

Returns the cached Text property (FCaption).
True if successful.
Here: FCaption (can be overridden).
Sets the value for the Action property.

Ensures that ActionLink is updated when the value for the property is updated. When Value is unassigned (Nil), ActionLink is freed and set to Nil. The control style flags are also updated to remove the value csActionClient. Otherwise, a new ActionLink class instance is created for ActionLink and Value is assigned to its Action property. Its OnChange handler is assigned, and the ActionChange method is called to apply values from the action to the control.

New value for the Action property.
Sets the value for the Color property.

SetColor is a method used to set the value for the Color property to the specified TColor value. Assigning a value to Color causes the ParentColor property to be set to False.

SetColor calls Perform to send a CM_COLORCHANGED control message to the widgetset class. Invalidate is called to force the control to be redrawn.

New value for the Color property.
Sets the value for the Enabled property.

Calls EnabledChanging to notify handlers for the chtOnEnabledChanged type. Stores the new value for the property, and performs a CM_ENABLEDCHANGED control message. Calls EnabledChanged to notify handlers for the chtOnEnabledChanged type.

New value for the Enabled property.
Sets the value for the Hint property.

Value is a TTranslateString type which allows it be recognized and processed in the LCL translation facilities.

New value for the Hint property.
Sets the value for the Name property.
TComponent.Name
New value for the Name property.
Sets the value for the Parent property.
New value for the the Parent property.
Sets the value in the Parent property when the new parent component is a TWinControl instance.

Implements the dynamic method inherited from TComponent. When NewParentComponent is derived from TWinControl, the SetParent method is called to re-parent, position, and resize the control.

TComponent.GetParentComponent
New TWinControl instance used as the Parent for the control.
Internal handler for activities after a form widget has been created.

Called by ChildHandlesCreated of parent form.

Functions like GetTextWidth require a valid widget and a device context. That is why AutoSizing is delayed until the handle in a parent Form is allocated.

Gets the value for the MouseCapture property.

Indicates if the class instance is the current CaptureControl for the LCL framework. The property value is True when the following condition are satisfied:

- Parent is assigned (not Nil).
- Parent has an allocated window handle.
- The value in the LCL CaptureContol variable is the current class instance.

True when the current class instance is the LCL CaptureControl.
Handler for mouse capture moved to a different control.

Notifies the DragManager of a change to the capture control, and to stop dragging this control. A very dangerous implementation; it can cause an immediate abort of dragging before dragging really starts.

Notification handler for insertion or deletion of components.

First, the inherited TComponent.Notification is called to notify all attached notification handlers.

If Operation is opRemove, additional actions are performed, depending on AComponent: the PopupMenu, Action, or anchors for the removed control are detached.

TComponent.Notification
The component being inserted or removed.
The action (opInsert or opRemove).
Determined whether the Tab key can be used for navigation in the control.

Always returns False in TControl. Overridden in TWinControl.

Returns a device context handle for the control, from Parent.

Initializes the device context position to the control origin, and shrinks its clipping rectangle to the bounds for the control.

The device context.
Returns the window handle of the device context.
Gets the value for the Enabled property.
Value for the Enabled property.
Gets the value for the PopupMenu property.
Value for the PopupMenu property.
Invokes the OnShowHint event handler.
Invokes the OnMouseWheel handlers, when the wheel has been turned.

Multiple wheel handlers can be implemented. First the general OnMouseWheel handler is tried, and if it doesn't report the event handled, then OnMouseWheelUp or OnMouseWheelDown are tried.

The actual WheelDelta is available only to the OnMouseWheel handler, not to the up and down handlers [Delphi compatible].

Set Result to True if handled.
State of the modifier keys and mouse buttons.
How many notches the wheel has been turned.
The mouse coordinates.
Invokes the OnMouseWheelDown handler.
True if handled.
Invokes the OnMouseWheelUp handler.
True if handled.
Performs actions needed to handle horizontal mouse wheel events.
True when the mouse wheel event has been handled for the control.
Shift state for the mouse wheel event.
Number of units (or clicks) the mouse wheel was moved.
TPoint with the mouse coordinates for the event.
Performs the OnMouseWheelLeft event handler.
Performs the OnMouseWheelRight event handler.
Notifies all OnVisibleChanging handlers.
Notifies all OnVisibleChanged handlers.
Notifies all OnEnabledChanging handlers.
Notifies all OnEnabledChanged handlers.
Adds an notification handler.
Notification handlers allow to notify other components of certain events. When the registered event occurs, all installed (added) handlers are invoked.
Type of the event.
The handler to be added.
Unused.
Removes the given notification handler.
Type of the notification.
The handler to be removed.
Invokes all notification handlers of the specified type.
The event that has occurred.
Passes key events for the specified type to the handlers added to the control.
Passes mouse wheel events to the handlers added to the control.
Invokes the OnContextPopup handler.
Mouse position, used to place the menu.
To be set by the handler, when it has handled the menu display and selection.
Moves the control in front or back of all sibling controls.
Returns the default size for this class of controls (when added to a form).
Implements the storage specifier for the Color property.
Applies layout changes using the specified policy and scaling proportions to the control.

DoAutoAdjustLayout is a method which implements changes to control sizes for the AutoAdjustLayout method. These methods are called when High-DPI and scaling have been enabled in the project options for an application.

AMode indicates the automatic layout policy applied in the method. It is a value from the TLayoutAdjustmentPolicy enumeration, and determines whether horizontal / vertical / or both sizes are adjusted in the method. It generally reflects the constraints for the device type where the application is running.

AXProportion and AYProportion contain the scaling factors applied to the horizontal and/or vertical sizes.

DoAutoAdjustLayout ensures that new values for Height and Width in the control are calculated (when allowed and needed) using the scaling factors, Constraints, BorderSpacing and Anchors for the control. The SetBoundsKeepBase method is called to apply the newly calculated values to the control.

Font scaling is performed in AutoAdjustLayout (when needed) and occurs prior to calling DoAutoAdjustLayout.

DoAutoAdjustLayout, ScaleFontsPPI, and FixDesignFontsPPI are often overridden in descendent classes to perform additional actions needed for a control or its children.

Identifies the auto-layout policy applied in the method.
Scaling factor for horizontal dimensions.
Scaling factor for vertical dimensions.
Applies the design-time PPI and resizes the specified control font.

Implements the FixDesignFontsPPI method for the control.

Performs actions needed to restore the design-time PPI (Pixels Per Inch) for controls when they are loaded using the LCL component streaming mechanism. The design-time PPI for fonts is not stored in .LFM files, and could result in invalid scaling operations when loaded on a machine with a different display density. DoFixDesignFontPPI ensures that the font is resized to the specified design-time PPI.

Adjusts the height for a given Font to the specified pixels per inch (PPI).

Implements the ScaleFontsPPI method for the control.

Font examined and updated in the method.
Pixels per inch setting adjusted in the method.
Scaling factor a applied to the font.
The default ActionLink class (TControlActionLink).
Used when the control is linked to an Action.
Handler for a changed Action.
Several properties are copied from the new Action.
The changed Action.
When True, forces update of all properties. Otherwise only properties in default state are overwritten.
Link to the default Action associated with this control.
Indicates if the desktop (system) font is used for the text displayed on this control.

DesktopFont is a Boolean property which indicates whether the default desktop (or system) font is used to display the text on the control. The default value for the property is set to True in the Create constructor, and indicates that an explicit assignment has not been made to the Font property. When set to True, the System font in Screen is loaded into the Font property.

Changing the property value causes a CM_SYSFONTCHANGED message to be performed for the control. DesktopFont is set to False when an explicit TFont value is assigned to the Font property.

TScreen.SystemFont Screen
The cursor shape shown while the control is dragged.
Default is crDrag. When no drop is allowed, the cursor changes temporarily to crNoDrop.
The operation when the control is dragged - Drag or Dock.
Set to dkDrag for drag-drop, or to dkDock for drag-dock operation.
Allows the user to drag the control.

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

True when mouse messages are currently captured by this control.

In normal operation, all mouse messages are sent to the control under the mouse pointer. Mouse messages also can be sent to a capturing control, e.g. when a control is dragged.

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, not all application controls will work properly so long.

Use the Color from the Parent control, when enabled.

ParentColor determines if the control should use the Color from the Parent control, when enabled. The default value is True.

When this property is True, all changes to the Color of the parent will also be applied to the Color of the control, ensuring that they both contain same value. If the Color of the control is changed by the application, then ParentColor will be automatically set to False.

Using ParentColor when the Color value is clDefault can cause problems in resolving the actual color value. To obtain the Color property of a control while taking into account clDefault and ParentColor, use the GetColorResolvingParent method. This method might return a non-RGB color, but will never return clDefault. To obtain a purely RGB result use the GetRGBColorResolvingParent method.

If True, the Font of the control will be the same as the one from the Parent. Default is True.

While ParentFont is True, changes to the font in the Parent are also applied to the Font for the control. This synchronizes them, keeping them set to the same value. If the value in Font is changed by the application, then ParentFont will automatically be set to False.

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

While ParentShowHint is True, all changes to the ShowHint property of the parent will also be applied to the ShowHint property for the control. This synchronizes them, keeping them with the same value. If the ShowHint property for the control is changed by the application, then ParentShowHint will automatically be set to False.

The stored (saved) properties of the current session, expressed as a string.
The character string associated with the control.

This is the character string, shown in controls with visible text content (TEdit...).

BEWARE: In other controls it can be the Name or Caption of the control, quite tricky to use.

The Delphi VCL implementation stores Text mostly in the widgets, using the virtual Get/SetTextBuf methods to exchange text between widgets and VCL. This means a lot of text copies and message handling in WM_GETTEXT and WM_SETTEXT.

The LCL instead (typically) stores Text in a field of the control, and transfers it from/to the widgets only when required.

To maintain VCL compatibility, the virtual RealGet/SetText methods have been introduced, which read or write the Caption string directly.

The default Get/SetTextBuf implementation calls the RealGet/SetText methods, resulting in a string-to-PCHAR and another PCHAR-to-string conversion. But as long as Get/SetTextBuf is not overridden, Get/SetText can (and does) safely call RealGet/SetText immediately, to avoid the mentioned conversions.

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

This handler can supply specific Constraints (size limits), when the control is resized.
Invoked when a context-sensitive pop-up menu is requested.

The handler can show and handle the menu selection itself. If so, it should set Handled to True. Otherwise the installed PopupMenu is shown.

Event Handler for double mouse clicks.

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 triple mouse clicks.
Event handler for quadruple mouse clicks.
This handler determines the action on an drop onto this control, in a drag-drop operation.

Unlike for a drag-dock operation, no default action is associated with an drag-drop; the OnDragDrop handler is the only way to do something meaningful on an drag-drop.

Event handler for a control being dragged over this control.
The handler can reject an drop, by setting Accept to False.
Notification handler for the end of a docking operation.
Notification handler for the end of a drag operation.
Event handler signalled when a mouse down event is handled for the control.

OnMouseDown is signalled (when assigned) from the MouseDown method. It occurs after the parent form has been focused, and an active edit control has been cancelled. If the DragManager is active, it has already been updated with the mouse position prior to the event.

An application must implement and assign a TMouseEvent handler routine to the property which responds to the event notification.

Use OnMouseUp to perform actions needed when a mouse up event is handled for the control.

Use OnMouseMove to perform actions needed when the mouse pointer position has changed for the control.

Use OnMouseWheel, OnMouseWheelDown, and OnMouseWheelUp to preforms actions needed when mouse scroll wheel messages are handled for the control.

Event handler for mouse movement within the control.
Event handler signalled when a mouse up event is handled for the control.

OnMouseUp is signalled (when assigned) from the MouseUp method. It is signalled when standard mouse events are enabled using the ControlStyle property. The event is signalled after the mouse position has been updated and the event is applied to an active DragManager.

An application must implement and assign a TMouseEvent handler routine to the property which responds to the event notification.

Use OnMouseDown to perform actions needed when a mouse down event is handled for the control.

Use OnMouseMove to perform actions needed when the mouse pointer position has changed for the control.

Use OnMouseWheel, OnMouseWheelDown, and OnMouseWheelUp to preforms actions needed when mouse scroll wheel messages are handled for the control.

Event handler signalled when the mouse pointer has entered the control.

OnMouseEnter is a TNotifyEvent property with the event handler signalled when the mouse pointer has entered the bounds for the control. OnMouseEnter is signalled from the MouseEnter method (when assigned), and occurs after the Parent control has been notified of the event. The Sender argument contains the control for the notification, and must be cast to a TControl type to access the properties or values specific to the class type.

Use OnMouseLeave to perform actions needed when the mouse pointer has left the bounds for the control.

TNotifyEvent
Event handler signalled when the mouse pointer has left the control.

OnMouseLeave is a TNotifyEvent property with the event handler signalled when the mouse pointer has left the bounds for the control. OnMouseLeave is signalled from the MouseLeave method (when assigned), and occurs after the Parent control has been notified of the event. The Sender argument contains the control for the notification, and must be cast to a TControl type to access the properties or values specific to the class type.

Use OnMouseEnter to perform actions needed when the mouse pointer has entered the bounds for the control.

TNotifyEvent
Event handler for mouse wheel turned.

By default all mouse wheel actions are translated into scroll events. Write an OnMouseWheel handler to react on turns of the mouse wheel.

The OnMouseWheelUp and OnMouseWheelDown handlers are notified only, they are not suited for customization of mouse wheel events.

Event handler for downward movement of mouse wheel.
Event handler for upward movement of the mouse wheel.
Event handler for horizontal movements of the mouse wheel.
Event handler for left movements of the mouse wheel.
Event handler for right movements of the mouse wheel.
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 the start of a dragging operation.

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

Event handler signalled when editing is done.

The user has finished editing the value for the control, and the resulting text can be validated. It is called (when assigned) from the EditingDone method, which occurs when focus changes to another control.

Deprecated.
DEPRECATED. Enables valid use of the '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 a dragged object is dropped onto this control.
The dropped object (control or DragDrop object).
The drop position in client coordinates.
The drop position in client coordinates.
Moves the control into a new docksite.

Calls DoDock to prepare for the new position of the control, when docked into an unmanaged or floating docksite.

When the old and new docksites are different, the control is removed from the DockClients of the old docksite, and added to the DockClients of the new docksite; afterwards the docksites are notified by calling their DoAddDockClient and DoRemoveDockClient methods, to adjust the control's Parent.

An exception is raised if there is already a docking process in progress for this control.
The host site into which which the control is to be docked, Nil for floating.
The new Bounds for the control. Expressed in screen coordinates when NewDockSite is Nil. Otherwise, client coordinates for NewDockSite.
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.

True if successfully docked.
The site into which the control is docked; Nil to make it float.
The sibling control where the control is inserted; can be Nil.
The side or edge of the DropControl to which the control is docked.
Undocks the control into the floating state.
TWinControls float for themselves, for TControls a floating host dock site is created, and the control is docked into it.
True if successfully floated.
The screen area where the floating control is moved; or the client area for a floating host site.
Replaces a previously docked control.

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

Delphi introduced a different method, DockReplaceDockClient, which is used when the replaced Control is in an unmanaged docksite.

True if the docked control has been successfully replaced.
The control to be replaced, will be docked into NewDockSite.
The new dock site for Control, typically a docking Notebook.
The control to which Control is docked.
The side of DropControl, to which Control is docked.
Indicates if the control has a host dock site.

Docked is a Boolean function which indicates if the control instance is docked to a host docking site. The return value is True when all of the following conditions are met:

- Parent is assigned (not Nil).
- Parent has the same value as the HostDockSite property.
- Parent has a parent form with a different value than Parent itsself.

GetParentForm
Returns True if the control is being dragged.
Returns True if the control is being dragged.
Returns True if the control is being dragged.
Creates a TLazAccessibleObject instance for this control.

CreateAccessibleObject should just create and return the object instance. It is useful for classes derived from a descendant of TLazAccessibleObject (instead of the base class).

Returns the currently selected child accessibility object.

GetSelectedChildAccessibleObject is provided for controls which wish to override this behavior without sub-classing TLazAccessibleObject.

Returns the child accessibility object at the given position for the control.

GetChildAccessibleObjectAtPos returns the accesibility object at the position expressed in client coordinates. This method is provided for controls which wish to override this behavior without sub-classing TLazAccessibleObject.

Scales a size value from the design-time PPI to the run-time PPI for the parent form.
Scaled sized value.
Original size value scaled in the method.
Scales a size value from the run-time PPI for the parent form to the design-time PPI.
Scaled sized value.
Original size value scaled in the method.
Scales a size value from 96 PPI to the run-time PPI for the Screen.
Scaled size value.
Original size value scaled in the method.
Scales a size value from the PPI for the Parent form (or designer control) to 96 PPI.
Scaled size value.
Original size value scaled in the method.
Scales a size value from 96 PPI to the PPI setting for the Font in the control.
Scaled sized value.
Original size value scaled in the method.
Scales a size value from the PPI setting in the Font for the control to 96 PPI.
Scaled size value.
Original size value scaled in the method.
Scales a size value from the PPI setting for the Screen to the PPI setting for the Font in the control.
Scaled size value.
Original size value scaled in the method.
Scales a size value from the PPI setting for the Font to the PPI setting for the Screen.
Scaled size value.
Size value scaled in the method.
Scales a size value from 96 PPI to the PPI setting for the Screen.
Scaled size value.
Size value scaled in the method.
Scales a size value from the PPI setting for the Screen to 96 PPI.
Scaled size value.
Size value scaled in the method.
Smart way to DoAutoSize.

AdjustSize is the same as Delphi the TWinControl.DoAutoSize method. But since DoAutoSize is commonly overridden in descendent components, it is not useful to perform all tests, which can result in too much overhead. To reduce this the LCL calls AdjustSize instead.

During loading and handle creation the calls are delayed.

Auto-sizing phases enabled for the control.

AutoSizePhases is a TControlAutoSizePhases function used to get the Autosizing phases enabled for the control. In general, the values in AutoSizePhases depend on the TWinControlFlag values enabled for the control.

For TControl, the values from the Parent control are used. If the Parent control is unassigned, the value is an empty set ([]).

For TWinControl, the value from the Parent control are used (when a Parent has been assigned). Otherwise, the windows control flags are used to get the return value. For example:

wcfCreatingHandle,wcfCreatingChildHandles
  Includes caspCreatingHandles in the set
wcfRealizingBounds
  Includes caspRealizingBounds in the set
wcfUpdateShowing
  Includes caspShowing in the set

In addition, AutoSizingAll forces caspComputingBounds to be included in the set. caspChangingProperties is included when the internal auto-sizing lock count has a value greater than zero (0).

Set with the TControlAutoSizePhase values.
Returns True if auto-sizing has been delayed until some other process is complete.
True if auto-sizing has been delayed.
Returns a string with a debugging message for delayed auto-size requests.
Returns True if AutoSize should be skipped or delayed because of its handle.

A TControl instance does not have a handle, so it needs a parent control.

Anchor to Sibling at Side.

Setup AnchorSide to anchor a side to a neighboring sibling control. For example: Right side to Left side, or Top side to Bottom.

The side to be anchored to Sibling.
The minimum space to Sibling.
The sibling control to which we should anchor.
Anchor parallel to Sibling, at Side.
The side to anchor to the sibling.
The minimum space to Sibling.
The sibling control to which we should anchor.
Setup AnchorSide to center the control horizontally relative to a sibling.
The sibling control to which we should anchor.
Setup AnchorSide to center the control vertically relative to Sibling.
The sibling control to which we should anchor.
Anchor to Sibling at Side, with the same extent.

Table or tree style anchoring, into a neighbor cell of Sibling. Obtain the row height (or column width) from Sibling.

The side to anchor to the sibling.
The minimum space to Sibling.
The sibling control to which we should anchor.
Copy Sibling's anchoring for Side.
The side to anchor like the sibling does.
The sibling control from which to inherit anchoring.
Anchor to Parent, following same rules as for Align.
Anchor to Parent's full client area.
The around space.
The number of controls anchored to the current control.
The list of controls which anchored to the current control.
Sets the bounds (Left, Top, Width, Height) of the control.

SetBounds can be used to change the Left, Top, Width, and Height properties as a single action. This reduces the overhead required for the common operation. Use DisableAutoSize and EnableAutoSize to reduce the overhead for recomputing/moving/resizing even further.

SetBounds is also called when any one of these properties, or the BoundsRect property is set. SetBounds updates BaseBounds and BaseParentClientSize, which are used by the anchoring mechanism to keep the spacing between controls. For example loading a Form with TMemo and the .lfm contains TMemo's Left and Width, then SetBounds is called two times for the memo.

When the user maximizes a window, SetBounds is called for the form, but not for the Memo, keeping the BaseBounds of the Memo. If the Memo is anchored to the right, the Width of the Memo is changed based on the BaseBounds and BaseParentClientSize.

Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

Delphi calls SetBounds more often. SetBounds calls ChangeBounds with the KeepBase argument set to False.

The X coordinate of the left side of the control.
The Y coordinate of the top of the control.
The width of the control.
The height of the control.
Sets the bounds of the control initially, when it is created.
Does nothing while the control is loaded.
X coordinate for the top, left pixel.
Y coordinate for the top, left pixel.
Width of control.
Height of control.
Set the bounds, keeping the base values.

SetBoundsKeepBase is a procedure used to set the bounds for a Control to the specified values without affecting the bounds in a Parent control.

SetBoundsKeepBase calls the ChangeBounds method to update the sized and position for the control to the specified values. If you use this in a custom control, disable LCL auto-sizing for this control prior to calling the method.

SetBoundsKeepBase is used in the implementation for several methods, including:

- WMSize
- WMMove
- WMWindowPosChanged
- DoAutoSize
- DoAutoAdjustLayout
- DoUndock
- Loaded

New Left coordinate for the control.
New Right coordinate for the control.
New Width for the control.
New Height for the control.
Returns default/preferred height and width, for use in auto-sizing.

Called during AutoSize calculations. 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 passed to the widgetset

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

When False, the values will be adjusted by the constraints, and undefined values will be replaced by GetDefaultWidth/GetDefaultHeight.
If True, adds space for stacking.
Gets the scaling factor for the canvas used to render the control.
The default width for this control, independent of any calculated values like Width and GetPreferredSize.
The default height for this control, independent of any calculated values like Height and GetPreferredSize.
Gets the default color for the control.

GetDefaultColor is a TColor function used to resolve the default color (clDefault) to a TColor value for the control. GetDefaultColor can return a color value for either the control background or its text. The DefaultColorType argument identifies which value is needed in the return value. In TControl, the following color types and values are used:

dctBrush
  Background or fill color for the control (Color). Returns the clWindow system color.
dctFont
  Text color for the control (Font.Color). Returns the clWindowText system color.

GetDefaultColor uses the value provided by the corresponding method in the widgetset class instance when a value other than clDefault is returned. When not resolved in the widgetset class, the return value is retrieved using the Parent color or the local values in the class instance. If ParentColor is True (and Parent is assigned), the GetDefaultColor method in the Parent control is called to get the specified color type. Otherwise, one of the values from the preceding list is used for the color type.

GetDefaultColor is a virtual method and can be overridden in descedent classes to use the colors needed for a specific control.

GetDefaultColor is used in the implementation of the GetColorResolvingParent and GetRGBColorResolvingParent methods. It is also called from the SetColor and CreateBrush methods in the TWinControl descendant.

TColor TDefaultColorType
TColor value for the specified color type.
Identifies the color type needed in the return value (brush or font).
Returns the color of the control while resolving clDefault and ParentColor.

GetColorResolvingParent is a convenience routine used to obtain the Color for the control while resolving clDefault. It will never return clDefault, but it might return a non-RGB color. To obtain a purely RGB result use GetRGBColorResolvingParent.

Returns a RGB value for the color of the control.

This convenience routine will allow to obtain the Color of the control while resolving clDefault, ParentColor and system color indexes and returns a TColor value.

The client coordinate of the given side.
Message handler for preferred size changed.
Marks the preferred size as invalid for this control and all parents (implies that we will look for another).
Returns the sides which are anchored to the Parent.
Disables automatic sizing; implies that the default size is accepted, or sizing is done manually.
Turns on (enables) automatic sizing.
Update the basic boundaries of the control - essential if there has been a lot of re-sizing.
The rectangle with the designed bounds for the control.

The current Bounds can change, due to scaling, anchoring or auto-sizing.

Reflects the Bounds for the Control read during LCL component streaming.

ReadBounds is a read-only TRect property used when the values for the Top, Left, Height and Width properties are set during LCL component streaming. When ComponentState contains csLoading, changes to these properties cause the new values to be applied to ReadBounds prior to calling the SetBounds method. The internal ControlFlags are also updated to indicate that the property value has been loaded using LCL component streaming.

The Parent's client size, for which the BaseBounds are valid.

BaseBounds and BaseParentClientSize determine the distance to keep from Parent's sides, when a side is anchored to the Parent (akLeft...), and the Parent is resized.

Used for debugging.
Applies an automatic adjustment layout policy to the control.

AutoAdjustLayout can be used to alter PPI settings, scale the control, or apply changes to height or width without scaling.

AMode indicates the layout policy applied in the method, and the actions performed to achieve the task.

Scaling factors are calculated (when needed) for both horizontal (X-axis) and vertical (Y-axis ) adjustments. The factors may represent changes to the PPI settings, or changes in the width for the control.

AutoAdjustLayout temporarily disables auto-sizing, and calls DoAutoAdjustLayout to apply the scaling factors or size changes.

Indicates whether the height and/or width for a control can be automatically adjusted.

In TControl, both AWidth and AHeight are set to True when the AutoSize property has not been enabled.

True if the width can be auto-adjusted.
True if the height can be auto-adjusted.
Corrects the font size for High-DPI-aware applications.

FixDesignFontsPPI is a method used to adjust the font size when the design-time PPI (Pixels per Inch) setting differs from the run-time PPI setting for the font in the control. It calls DoFixDesignFontPPI to restore the value in ADesignTimePPI to the Font reference passed as an argument to to the method. The font height is scaled using the factor represented by TFont.PixelsPerInch/ADesignTimePPI.

This method does not trigger a CM_PARENTFONTCHANGED message in the Parent control.

In TControl, this action is performed for the Font property. In descendent class, additional properties with a font reference may also be adjusted using the method.

FixDesignFontsPPI is called when scaling is enabled, and the Form which hosts the control calls its Loaded method when LCL streaming is completed.

Design-time PPI setting applied for the font size adjustment.
Resizes a font to the specified Pixels per Inch setting.

ScaleFontsPPI is a method used to resize a font in the control to the specified display density (Pixels per Inch) using the scaling factor in AProportion (when needed).

A font may need to be scaled when the run-time PPI setting for the screen differs from the design-time value applied to the font. If the font height is not assigned at run-time, its height is set to the value in TFont.PixelsPerInch / Screen.PixelsPerInch.

When AToPPI has a positive non-zero value, it is stored in the TFont.PixelsPerInch property for the font. Otherwise, the existing TFont.PixelsPerInch value is adjusted using the scaling factor in AProportion.

ScaleFontsPPI may be overridden in descendent controls to call the method for its child controls.

ScaleFontsPPI is called form the AutoAdjustLayout method.

PPI setting to apply to the font.
Scaling factor applied to the font height.
Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited constructor using TheOwner as the owner for the class instance. Resources are allocated in the method for members in the class instance, and the default values are set for the following properties:

- Align
- Anchors
- BaseBounds
- CaptureMouseButtons
- Color
- ControlStyle
- Cursor
- DesktopFont
- DragCursor
- Enabled
- FloatingDockSiteClass
- Font
- HelpType
- IsControl
- ParentBidiMode
- ParentColor
- ParentFont
- ParentShowHint
- Visible
- WindowProc

Create ensures that auto-sizing is disabled until the class instance is fully realized. Auto-sizing is re-enabled on exit from the method.
The owning component.
Removes the control from its Parent.

Detaches the control from Parent, removes graphics, frees memory and Operating System handles, pointers etc.

TLCLComponent.Destroy TComponent.Destroy
Performs notifications before the control is destroyed.

BeforeDestruction is a method which performs notifications when an object instance is about to be freed. It allows tasks to be performed which maintain a persistent object instance and its obervers before it is destroyed.

BeforeDestruction is an overridden method in TControl, and calls the inherited method on entry to ensure that csDestroying is included in the ComponentState property for the control and any of its child components. It extends the inherited method by calling DoCallNotifyHandler for any handler routines using the chtOnBeforeDestruction type.

Signals the OnEditingDone event handler.

Called when user has finished editing using the control. 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.

Each control class can determine which events cause the value(s) to be committed.

Called when the Return key is pressed, signifying the default action.

ExecuteDefaultAction has an empty implementation in TControl. It can be overridden in descendent classes to perform any actions needed for the class type.

Called when the Escape key is pressed or the Cancel button is clicked.

ExecuteCancelAction has an empty implementation in TControl. It can be overridden in descendent classes to perform any actions needed for the class type.

Starts a drag operation for the control (programmatically).
If False, start dragging only after the mouse has moved.
Minimum mouse movement before delayed dragging starts (in pixels); -1 uses the DragManager default. Ignored when Immediate=True.
Ends a drag operation by notifying the drag manager.
Brings the control in front of other sibling controls.

BringToFront is a method used to move the control to the top of the Z-Order for its sibling controls. BringToFront calls SetZOrder to change the display order for controls which share a common Parent. BringToFront has no effect when Parent has not been assigned.

Returns True if there is a Parent component responsible for streaming.

HasParent is called during streaming to decide if a component has to be streamed by its owner or Parent.

TComponent.HasParent
True if there is a Parent.
Returns the value in the Parent property.

GetParentComponent gets the component / control which has the current class instance in its Components property. GetParentComponent is an overridden method in TControl, and re-implements the inherited method. It uses the value in the Parent property as the return value for the method. The inherited method always returns Nil.

TComponent.Components
Value in the Parent property.
Determines whether this control is a parent of AControl.

IsParentOf is a Boolean function used to determine if the current control instance is ultimately a parent of the control specified in AControl. No actions are performed in the method when AControl has not been assigned (Nil), and the return value is set to False.

IsParentOf visits each control in the Parent control hierarchy, and returns True if the current class instance (Self) is found in the tree. The return value is False if the current control instance is not found in the Parent control tree.

True if this control is a parent of AControl.
The initial control examined in the parent control hierarchy.
Finds the control that is the top-most Parent in the control hierarchy.

GetTopParent is a TControl function used to get the control which is the top-most or intial Parent in the control hierarchy.

GetTopParent visits each of the control instances in the Parent property. The return value is set to control where Parent is unassigned (Nil). The return value is the current control instance (Self) if Parent has not been assigned.

GetTopParent is used in methods like ChangeBounds where the parent handles layout or sizing for its child controls. The method is also used in descendent classes, like TWinControl, when messages are handled which resized, move, or otherwise reposition the windowed control.

TControl instance which is the top-most Parent in the control hierarchy, or Self.
Finds the sub-component with the specified name in the Components property.

FindSubComponent is a TComponent function used to get the sub-component with the name specified in AName. FindSubComponent is similar to TComponent.FindComponent, but accepts a prefixed component name in AName. For example: 'LabeledEdit1.EditLabel'.

FindSubComponent separates the value in AName into the owner and sub-component names. When a prefix is used, the FindComponent method is called to locate the TComponent instance with the owner name. Its FindComponent method is called to get the component with the sub-component name that is used in the return value. If a prefix is not used, the initial component is used as the return value.

The return value is Nil if a component is not found with the specified name.

TComponent.FindComponent TComponent.Components
The component with the specified name, or Nil when not found.
Parentage/path for the sub-component to retrieve in the method.
Gets the effective visibility for the control and all of its Parent controls.

IsVisible calls IsControlVisible to determine if the control has its Visible property set to True. At design-time, ControlStyle is also checked to ensure that csNoDesignVisible is not used in the style flags. Each of the Parent controls in the hierarchy call their IsVisible method to determine the return value for the method.

Use IsEnabled to get the effective enabled state for the control and all of its Parent controls.

True when the control and and all Parent controls are Visible.
True if the control is Visible, or is in design mode.

The return value is True when the Visible property is set to True. The value is False at design-time if the ControlStyle property includes the value csNoDesignVisible. IsControlVisible does not check the visibility for parent controls in the control hierarchy.

Use IsVisible to consider the visiblity for any Parent controls.

True if the Visible property is set and the control is not disabled on the design surface at design-time.
Returns True if both the control and all of its Parent controls are Enabled.

Returns True when both the control instance and its parent control hierarchy are enabled. Used internally by TGraphicControls for painting and various states during run-time.

True when the control and all Parent controls are enabled.
Provides access to the value in the protected ParentColor property.

Returns the value for the protected ParentColor property. Used in places where we need to check ParentColor property from within the TControl. Needed for widgetset classes.

True when ParentColor is set to True.
Provides access to the value in the protected ParentFont property.

Checks the value for the protected ParentFont property. Used in places where we need to check ParentFont from within TControl. Needed for widgetset classes.

True when ParentFont is set to True.
True if the form is being updated.

The return value is True when a value has been assigned to Parent, and its FormIsUpdating method returns True. This causes all assigned Parent controls in the hierachy to be examined to determine the return value.

Eventually, one of the Parent controls will be the TCustomForm instance which hosts all of the controls. It sets the return value to True when its internal update counter has a non-zero value. This occurs when the form has called BeginFormUpdate, but has not called EndFormUpdate to complete an update.

True if the form is being updated.
True while painting the control.

As the name implies, the cfProcessingWMPaint flag in FControlFlags is set while a LM_PAINT message is processed, and IsProcessingPaintMsg checks this flag.

True when the control flags contain a value for paint methods.
Hides the control by setting the Visible property to False.
Causes the control to be redrawn.

Calls the Repaint method to either draw the clipping rectangle for the control to the handle in the Parent, or invalidate the control area for the next paint operation that occurs when the Parent controls are Visible.

Immediately redraws the control when visible, bypassing the message queue.

Repaint is a method called redraw the control when it is visible. No actions are performed in the method when:

- Parent has not been assigned.
- Parent does not have a valid handle.
- ComponentState contains the value csDestroying.
- The effective visibility from IsVisible is False.

When the control is Parented, it is redrawn using the style indicated in ControlStyle. When csOpaque is included, a device context is retrieved and the PaintControl method is called for the clipping rectangle in the Parent control. When csOpaque is omitted, the Invalidate and Update methods are called to request the control to redrawn.

TComponent.ComponentState
Force a delayed Repaint of the control, by marking its visible area of the control as invalid.

Calls the InvalidateControl method to invalidate the bounds rectangle for the control using the clipping rectangle for the Parent.

Returns True if the class is allowed for child controls.

Only few controls restrict the class of acceptable child controls. E.g. a PageControl only accepts TTabSheet descendants as children.

An EInvalidOperation can be generated (see ExceptionOnInvalid).
True if the class is allowed for child controls.
The class of the intended child control.
When True, raise an exception when the class is not allowed.
Checks if this control can become a child of AParent.

This check is performed during SetParent. It calls CheckChildClassAllowed and whether AParent is the current class instance (Self).

An EInvalidOperation occurs when any test fails.
The new Parent for this control.
Moves all sibling controls in front of this control.

Use SendToBack to move the control beneath all other sibling controls on the Parent. Only those portions of the control not covered by other controls will be visible.

Calls SetZOrder to move the position for the control on the z-axis (depth) to the maximum Integer value for the platform.

Use BringToFront to move a control to the top of the Z-axis on the Parent control.

Use SetChildZPosition in TWinControl to move a child control to a specific position on the Z-axis where 0 is the top and MaxInt is the bottom of the Z-order.

Changes the cursor shape temporarily, preserving the original

SetTempCursor is a method used to temporarily change the cursor shape to the TCursor value specified in Value. SetTempCursor calls the overridden method in the Parent control to apply the cursor shape in Value.

No actions are performed in the method when Parent has not been assigned.

The temporary cursor shape for the control.
Internal method called by a Form when its DefaultControl or CancelControl has changed.

This method is overridden in TCustomButton, where it updates the Cancel and Default properties for the control.

Notification of a changed active DefaultControl of a form.

When the user pressed ENTER in a form, its DefaultControl will receive a Click event.

Currently NewControl can be Nil, even if it should not be.
The new DefaultControl.
Copy the Text property into Buffer.

This method only exists for Delphi compatibility.

Don't use or override it, unless really necessary.

Length of the copied text.
Pointer to the buffer receiving the string.
Length of the buffer.
The length of Text, here: of Caption.
Updates the Text property from a PChar buffer.

This method only exists for Delphi compatibility.

Don't use or override it, unless really necessary.

Pointer to the buffer containing the zero-terminated text.
Calls a message handler directly, bypassing the message queue.

Perform is a method used to pass a message to the processing loop for the control.

Values in the Msg, WParam, and LParam arguments are stored in a TLMessage instance and passed as an argument to the routine in the WindowProc property. The return value is the LRESULT returned from the WindowProc routine.

TLMessage LRESULT
Result value from the WindowProc routine.
Control message constant for the message executed in the method.
Parameter with a handle or Integer value (not necessarily 16-bits any more).
Parameter with a Pointer to its value (not necessarily 32-bits any more).
Converts absolute screen coordinates into client-relative coordinates.

The APoint argument contains the screen coordinates which are converted to client-relative coordinates in the method. The X member has the horizontal coordinate, and the Y member has the vertical coordinate.

The return value is a TPoint type which contains the coordinates from APoint with the X and Y members decremented by the corresponding values found in the ClientOrigin for the control.

Accessing the ClientOrigin property raises an EInvalidOperation exception if Parent has not been assigned for the control.

ScreenToClient is used in the implementation of methods like ClientToParent, ParentToClient, and GetMousePosFromMessage. It is also used to convert mouse coordinates during drag and drop, docking, and context menu operations.

Use ScreenToControl to convert absolute screen coordinate to control-relative values.

Use ClientToScreen to convert client-relative coordinates to absolute screen coordinates. Use ControlToScreen to convert the coordinates in the control to absolute screen coordinates.

TPoint
TPoint instance with the client-relative coordinates for the specified screen coordinates.
TPoint instance with the screen coordinates converted in the method.
Converts client-relative coordinates to absolute screen coordinates.
TPoint instance with the screen coordinates for the specified client coordinates.
TPoint instance with the client-relative coordinates converted in the method.
Converts absolute screen coordinates to control-relative coordinates.
Converts control-relative coordinates to absolute screen coordinates.
Converts the specified client coordinates to the screen coordinates for the specified parent control.

ClientToParent is a TPoint function used to convert the client-relative coordinates specified in Point to the screen coordinates for the parent control in AParent. If AParent is unassigned (Nil), the Parent property for the control is used in the method.

ClientToParent calls the IsParentOf method in AParent to determine if the control is a child control for AParent. An EInvalidOperation exception is raised if the return value from IsParentOf is False.

ClientToParent calls ClientToScreen to get the absolute screen coordinates for the values in Point. The return value is the TPoint instance returned by converting the client coordinates to screen coordinates, and asking the parent control to convert the values back to client-relative coordinates for the parent control.

ClientToParent is used, for instance, in the TScrollingWinControl.ScrollInView method.

TPoint instance with the client coordinates adjusted to the parent control.
TPoint instance with the client coordinates for the control.
Parent control with the bounds for the adjusted coordinates.
Converts the specified client coordinates on a parent control to the client coordinates for the control instance.

Point contains the client coordinates relative the parent control AParent. If AParent is not assigned (Nil), the value in the Parent property is used as the value for the argument.

ParentToClient calls the IsParentOf method in AParent to determine if the current control is hosted on AParent. An EInvalidOperation exception is raised if the IsParentOf method returns False.

The return value is a TPoint instance with client coordinates for the control relative to the client coordinates on AParent.

TPoint instance with the client coordinates relative the client origin in a parent control.
TPoint instance with the coordinates examined and adjusted in the method.
Parent control with the origin used to adjust the client coordinates.
Get the visible part of a possibly scrolled client area.

If Scrolled is False, the ScrollOffset is ignored, so that the ClientRect is returned. Returns the Client rectangle relative to the left and top for the control. If Scrolled is True, the rectangle is moved by the current scrolling values (for an example see TScrollingWincontrol).

The visible part of the client area.
True forces scrolling taken into account.
Makes the control visible by setting Visible to True.

Show calls the ShowControl method in the Parent control (when assigned) to ensure that the control instance is visible on the Parent control. Show sets the value in the Visible property to True. The value in the Visible property is not changed at design-time or when csNoDesignVisible has not been included in the ControlStyle property.

Use the Hide method to hide the control on its Parent.

Use ShowControl to display a specific sibling control on the Parent.

Redraws invalidated parts of the control immediately.

Update calls the Update method in the Parent control to refresh the window where the control is hosted. No actions are performed in the method when Parent has not been assigned.

True if the control should be visible, unless it's being destroyed.

HandleObjectShouldBeVisible is a Boolean function which indicates if the control requires a valid handle in its widgetset class instance and should be visible. The return value is set to True when the following conditions are satisfied:

- Neither the control nor its Handle is being destroyed.
- IsControlVisible returns True indicating the control is both Visible and not disabled on the form designer at design-time.
- Parent has been assigned and its HandleObjectShouldBeVisible method returns True.

HandleObjectShouldBeVisible is used frequently in widgetset class methods, and indicates that actions like allocating or freeing a handle should be performed. It determined the value for the Visible property in the widget. It also indicates whether the actions in the class method can be performed, or should be ignored.

Returns True if any parent is destroying its Handle (or handles for its children).
Returns True if all Parents have allocated handles, and are not being destroyed.
Update the action associated with the control through its action link.

Calls the Update method in ActionLink to signal the OnUpdate event handler for the linked TBasicAction instance. No actions are performed in the method when ActionLink has not been assigned.

TBasicActionLink.Update TBasicActionLink.OnUpdate
Displays the help associated with the control.

ShowHelp is a method used to display help for the control. Values in HelpType, HelpContext, and HelpKeyword are used to determine which method is called in the Application singleton to display the help content.

HelpType
  When set to htContext, the HelpContext method is called for the value in the HelpContext property.
HelpKeyword
  A non-empty value causes the HelpKeyword method to be called using the value in the HelpKeyword property.
Default Action
  Calls the ShowHelp method in the Parent control when none of the other conditions are satisfied.

ShowHelp is called from methods in the the TApplication instance. It occurs when the F1 key is pressed when the control has focus, or when its ShowHelpForObject method is called for a specific control instance.

Use the HelpFile property, found on the parent form or in a TApplicationProperties instance, to set the help file with the content displayed in the method.

Indicates whether a HelpKeyword or HelpContext identifier is assigned for the control.
True when a HelpKeyword or HelpContext has been assigned.
Adds or inserts the specified OnResize event handler.
Removes the specified OnResize event handler.
Adds or inserts the specified OnChangeBounds event handler.
Removes the specified OnChangeBounds event handler.
Adds or inserts the specified OnVisibleChanging event handler.
Removes the specified OnVisibleChanging event handler.
Adds or inserts the specified OnVisibleChanged event handler.
Removes the specified OnVisibleChanged event handler.
Adds an OnEnabledChanged handler.
Removes the specified OnEnabledChanged event handler.
Adds the specified OnKeyDown event handler.
Removes the specified OnKeyDown event handler.
Adds or inserts the specified OnBeforeDestruction event handler.
Removes the specified OnBeforeDestruction event handler.
Adds or inserts the specified OnMouseWheel event handler.
Removes the specified OnMouseWheel event handler.
Contains the accessible name for the control.
Describes the accessibility description for the control, like "a text caption", etc.
The accessible description of the control. This should describe the role of the control, for example for TLabel it could be "a text caption".
The accessibility value for the control.

The accessible value of the control. For example, for TLabel it would be the same as the Caption property.

The accessibility role for the control which classifies what kind of object in the class instance.

See TLazAccessibilityRole for a list of possible values.

The Action associated with the control.

Action is a TBasicAction property with the action assigned to the control. The value for the property is read from the Action property in ActionLink (when assigned). If ActionLink has not been assigned, the property value is Nil.

Assigning an action to the property causes ActionLink to be updated. If the new property value is Nil, the TControlActionLink instance in ActionLink is freed and control style flags are updated to remove the value csActionClient.

Conversely, a TControlActionLink instance is created for a non-empty action assignment. Its OnChange event handler is set to the private DoActionChange method in the class instance. Control style flags are updated to include the value csActionClient.

Action is used in the Click method to signal its OnExecute event handler when assigned and enabled. Preference is given to the OnClick in the control (when assigned).

Values in the Caption, Enabled, HelpType, and Hint properties can be linked to the Action through the property values in the ActionLink.

Use AssignTo to copy property values in the control to a TCustomAction instance.

TBasicAction
Specifies the placement of the control on its Parent control.

Align is a TAlign property which specifies how the control is aligned to its parent control. The default value for the property is alNone.

alNone
  The control is not aligned. It uses it Top, Left, Height, and Width to place the control in the Parent.
alTop
  Aligns the control to the top of the parent control, and adjusts it Width to fill the Parent control.
alBottom
  Aligns the control to the bottom of the Parent control, and adjusts its Width to fill the Parent control.
alLeft
  Aligns the control to the left edge of the Parent control, and adjusts its Height to fill the Parent control.
alRight
  Aligns the control to the right edge of the Parent control, and adjusts its Height to fill the Parent control.
alClient
  Aligns the control to fill the unused Height and Width for the Parent control.
alCustom
  Aligns the control by calling the OnAlignInsertBefore or OnAlignPosition event handlers in the Parent control.

The set of anchor definitions for this control.

Anchors is a TAnchors property which contains the edges used to align the position of the control relative to its Parent. Anchors allow the control to be repositioned and/or resized when the parent control is resized. Coordinate values in the control - like Left, Top, Bottom, and Right properties - are updated when the corresponding edge is anchored to its Parent.

The default value for the property is [akLeft, akTop], and indicates that only the Top and Left coordinates are anchored in the parent control.

For example:

[akLeft, akRight]
  Causes the relative width for the control to be adjusted when the width of the parent control is changed.
[akTop, akBottom]
  Causes the relative height for the control to be adjusted when the height of the parent control is changed.
[akTop, akLeft, akRight]
  Causes the relative width (but not the height) for the control to be adjusted when the parent is resized. Like using the Align property.
[akTop, akLeft, akBottom, akRight]
  Causes both the height and width to be adjusted when the parent control is resized. Like using alCustom in Align.

Setting a new value for the property causes the UpdateAnchorRules and AdjustSize methods to be called.

Values in Anchors are used (along with Align) in the DoAutoAdjustLayout method. They control whether values in Left, Top, Bottom, and Right are calculated using the ClientWidth and ClientHeight for the Parent control. The values in Anchors also used in the HeightIsAnchored and WidthIsAnchored methods.

Values in Anchors may be updated when a new value is assigned to the Align property which conflicts with the existing values in the property. They may also be updated when values are assigned to AnchorSide which cause vertical or horizontal centering to a sibling control (AnchorVerticalCenterTo, AnchorHorizontalCenterTo) or alignment to a companion control (AnchorToCompanion).

Array of anchor definitions, indexed by the control sides.

Valid anchor definitions are flagged in Anchors.

AnchorSide specifies how a side is anchored to other controls (siblings or Parent).

Various AnchorAs and AnchorTo methods simplify the establishment of anchors.

The anchored side of the control.
Allows automatic adjustment of the size for the control, according to its content.

The action performed depends on the concrete control type. For example, a label or button can become bigger or smaller to accommodate a longer or shorter caption.

Default value for the property is False, and disables auto-sizing for the control instance.

Using AutoSize
Determines the inner and outer border spacing for this control.

The outer border determines the minimum distance to sibling controls. The inner border is the space between the BoundsRect and ClientRect for the control.

When a control sits in a cell of a table (Grid) control, its horizontal and vertical alignment inside the cell can be specified, too.

The Top, Left and Bottom, Right for the control, in client coordinates.

The BoundsRect rectangle describes the Top, Left and Bottom, Right coordinates for the control, relative to its parent.

The values are based on the Top, Left, Width and Height properties of the control.

Set BoundsRect to move and/or resize the control. This can reduce flicker, occurring otherwise when Top, Width etc. are set individually.

Temporary BoundsRect, used when the control e.g. is docked into a different Parent.

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

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

The text displayed for the control.

Caption is a TCaption property with the text displayed for the control. By default, Caption has the same value as the Name property used for the control. An explicit value can be assigned at design-time using the Object Inspector, or by the developer in program code.

Controls normally use the Caption or Text properties (they are equivalent in TControl) to read or write their textual value. The property value is retrieved using either the RealGetText method, or the GetTextBuf method when it has been overridden in a descendent class. Conversely, the property value is stored using either RealSetText, or an overridden SetTextBuf method in a descendent class.

When the value in Caption is changed, a CM_TEXTCHANGED message is performed for the control. Changing the value for the property causes the caption for the HostDockSite to be updated (when assigned).

Caption can be used to display an accelerator (or shortcut) key which allows the control (or an associate) to be given focus or executed. The shortcut key is identified by placing an Ampersand (&) character in front of the character used as the accelerator key. Use two Ampersand characters to display a single Ampersand which is not a shortcut key. For example:

{ var ALabel: TLabel; Form1: TForm; Memo1: TMemo; ... } ALabel := TLabel.Create(Form1); ALabel.ShowAccelerator := True; ALabel.FocusControl := Memo1; ALabel.Caption := '&Notes && Comments';

Displays the 'N' character with an underline indicating the accelerator key. Pressing Alt+N activates the shortcut key and causes the associated TMemo control to be given focus.

Set values in Font to specify the typeface, size, color, and style used to display the Caption text.

Indicates the mouse button(s) which are captured for the control.

CaptureMouseButtons is a TCaptureMouseButtons property with the set of mouse buttons which capture events for the control. It contains zero or more values from the TMouseButton enumeration. Up, down, click, double click, triple click, and quad click messages are handled for a mouse button when its value is included in the property.

The default value for the property is [mbLeft] and causes events to be handled for the Left mouse button.

Mouse capture is enabled for the button(s) when csCaptureMouse is included in the ControlStyle property.

ControlStyle and CaptureMouseButtons are used in message handlers which respond to mouse events, like: WMLButtonDDown, WMLButtonUp, WMLButtonDblClk, WMLButtonTripleClk, WMLButtonQuadClk, et. al.

The height for the client area on the control.

ClientHeight is an Integer property with the number of pixels needed for client area on the control. The property contains the value from the Bottom member in ClientRect. Changing the value for ClientHeight causes SetClientSize to be called to apply the existing ClientWidth and the new value for the property.

The value for ClientHeight is not stored or used to set the Height for the control during LCL component streaming. It is used, however, when AutoSizing is restored and when auto-layout policies using Anchors are applied to the control. For example, when Anchors is set to [akBottom] the value in ClientHeight is needed / used.

Screen coordinates of the Top, Left pixel (in the client area) of the control.

Only TWinControl has a client area. For other controls, ClientOrigin is the same as ControlOrigin. Uses the corresponding property in the Parent control to get the property value, and includes the values in Left and Top to get the effective origin for the control.

An EInvalidOperation exception is raised if Parent has not been assigned when reading the value for the property.

Note that this value is the position as stored in the object, not always in sync with the widget.

Raises an EInvalidOperation exception with the message in sParentRequired if Parent has not been assigned when reading the value for the property.
Size of the client area for the control.

Contains the size for the visual client area in the control. For example, the inner size of a TGroupBox. For a TScrollBox it is the visual size, and not the logical size.

The property value is a TRect instance with the Top and Left members set to 0, and the Height and Width members set to the corresponding property values for the control.

TRect
The width of the client area for the control.

ClientWidth is an Integer property with the number of pixels need for the width of the client area on the control. The property contains the value from the Right member in ClientRect. Changing the value for ClientWidth causes SetClientSize to be called to apply the new property value and the existing ClientHeight for the control.

The value for ClientWidth is not stored or used to set the Width for the control during LCL component streaming. It is used, however, when AutoSizing is restored and when auto-layout policies using Anchors are applied to the control. For example, when Anchors is set to [akRight] the value in ClientWidth is needed / used.

The background color of the control.

The default value in Color is the same as the value in the parent window Color. If the color is clDefault, the result will need to be passed through GetDefaultColor to resolve clDefault. Convenience routines which obtain the color by resolving clDefault and ParentColor are also provided as TControl.GetColorResolvingParent and TControl.GetRGBColorResolvingParent.

TColor
Contains the minimum and maximum Width and Height for the control.

Constraints is a TSizeConstraints property with the sizing constraints used for the control. Constraints contains properties like MinHeight, MaxHeight, MinWidth, and MaxWidth. They are applied (when assigned) to the corresponding control properties when its bounds or preferred size is changed, and during scaling operations.

The top, left pixel of the control in screen coordinates.
Contains state flags which indicate whether the control has been clicked, data is being read, or the control is being re-drawn, etc.

ControlState is a TControlState property which contains flags that indicate when actions are detected or handled for the control. It is a set type which contains zero or more values from the TControlStateType enumeration.

Values are added to the property when an event is detected. Values are removed from the property in methods which handle the event by performing some action on the control.

For more information about the values in the enumeration and their uses and meanings, please refer to TControlStateType.

Contains style flags which control the features or behaviors enabled for the control.

ControlStyle is a TControlStyle property used to enable features or behaviors for a control. Values from the TControlStyleType enumeration are added to the property to enable the corresponding feature supported in the control.

Values in ControlStyle are normally assigned in the constructor for a given control class.

Some controls implement properties which cause the values in the set to be changed when a new value is assigned to the property. For example, TToolBar.Transparent includes or excludes csOpaque in ControlStyle as needed to reflect the value for the property. Values in the property may also be read and/or updated when methods in the control are called.

The visibility for the ControlStyle property is public, so it does not appear in the Lazarus Object Inspector. But it can be updated in program code as needed.

See TControlStyleType for more information about values in the enumeration and their intended usage.

Determines whether the control reacts on mouse or keyboard input.

Enabled is a Boolean property which indicates whether the control can respond to focus, input, or mouse events. The default value for the property is True. When Enabled is set to False, the control is displayed with a "grayed-out" appearance. It is unable to receive input focus, handle keyboard navigation or input, respond to mouse click events, or execute its Action.

Changing the value for the property causes additional actions to be performed. EnabledChanging is called to signal any chtOnEnabledChanging control handlers assigned for the control. The property value is updated, and a CM_ENABLEDCHANGED control message is dispatched for the control. The EnabledChanged method is called to signal any chtOnEnabledChanged control handlers for the control.

Use IsEnabled to check the effective enabled state for both the control and its Parent control (when assigned).

The font to be used for text display in this control.

Font is a TFont property with the typeface and display attributes used for textual values on the control. Use properties in the TFont instance to change attributes like Name (for the typeface), Charset, Color, Height, Orientation (rotation degrees), Pitch, Quality, Size, and Style. Assigning a new TFont instance to the property causes the control to be redrawn.

Some Font attributes may be ignored in TControl descendants. It depends on the drawing style for the specific control, and whether theme services are enabled for text on the control.

The PixelsPerInch property in Font is used to perform font size scaling in methods like Scale96ToFont, ScaleFontTo96, ScaleScreenToFont, and ScaleFontToScreen.

TFont
Not used in the current LCL implementation.

IsControl is provided for Delphi code compatibility. It is not used in the current LCL implementation.

True when the mouse has entered the control. (Deprecated)
Deprecated. Use MouseInClient instead.
True when the mouse is in the client area for the control.

MouseInClient is a read-only Boolean property which indicates if the mouse pointer has entered the client area for the control. The value for the property is updated when CM_MOUSEENTER or CM_MOUSELEAVE messages are handled for the control. The property value is set to True in CMMouseEnter, and set to False in CMMouseLeave.

Use the OnMouseEnter or OnMouseLeave event handlers to perform actions needed when the mouse control messages are handled for the control.

Event handler signalled when the Bounds of the control have been changed.

OnChangeBounds is signalled from the DoOnChangeBounds method (when assigned). It occurs after the internal control flags have been updated to excelude cfOnChangeBoundsNeeded, and before DoCallNotifyHandler is called to notify handlers for the chtOnChangeBounds type.

TNotifyEvent
Notification handler for mouse clicks.

A mouse click is associated with the default action for a control, and is often the only event handled in user code.

The action performed for a click can be specified by a user supplied method, or by selecting an Action from a supplied ActionList.

OnClick is signalled (when assigned) from the Click method. It occurs when an Action has not been assigned using the ActionLink for the control. When Action is assigned, the Execute method in the ActionLink is called.

TBasicAction TNotifyEvent
Notification handler for a resize of the control.

This event is triggered after the Width, Height, ClientWidth or ClientHeight of the control has changed, and before the LCL sends the new size to the widgetset. The size of the underlying widget (e.g. unit LCLIntf function GetWindowSize and GetClientRect) may differ from the control's Width/Height/ClientRect during OnResize. During auto-size the size can change multiple times, but only the last change triggers the OnResize.

Use OnResize to react on size changes. To also react on moves, use the OnChangeBounds event.

If you want to customize the resize behavior, use OnConstrainedResize instead.

Common mistake: Keep in mind that ClientWidth and ClientHeight can change even when Width and Height stay the same. For example when the theme changes, the Width and Height remain the same, but the changed frame reduces the ClientWidth and ClientHeight. 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.

TNotifyEvent
Event handler signalled when a hint window is displayed for the control.

OnShowHint is a TControlShowHintEvent property with the event handler signalled when a hint window is displayed for the control. Arguments to the event handler include the control instance for the event notification, and a pointer to the structure with the Hint details for the control.

OnShowHint has public visibility in TControl, but may be redeclared in descendent classes to make it visible in the object inspector. An application must implement and assign a handler routine to respond to the event notification.

OnShowHint is signalled from the DoOnShowHint method (when assigned), and occurs when the CM_HINTSHOW control message is handled for the control.

Set ShowHint to True to enable hint window display using the value(s) in the Hint property.

The control within which the control is shown.

When the Parent moves or hides, all its children move or hide together with it.

Every TControl must have a Parent, else it is never shown.

The Parent of a floating form is Nil.

Set the parent last to reduce updates. For example:

Button1 := TButton.Create(Self); Button1.Name := 'Button1'; Button1.Caption := 'Click me'; // parent is not set, so it does not update the whole form Button1.Parent := Form1; // set parent as last, the LCL now applies all properties

Delphi/VCL: Parent must be set first under Delphi, because many properties work differently if they are set before or after Handle creation. The LCL applies the properties when the Handle is created.

A context-sensitive menu that pops up when the right mouse button is clicked over this control.
TPopupMenu
Enables Hint display for the control.

ShowHint is a Boolean property used to enable or disable display of pop-up Hint text for the control. When set to True, the Hint text is shown when the mouse is hovered over the control. The default value for the property is False and disables Hint text in a pop-up window.

Changing the value in ShowHint causes the ParentShowHint property to be set to False. A CM_SHOWHINTCHANGED is performed to apply the new value for the property.

Use the Hint property to set the text displayed in the pop-up hint window when ShowHint is enabled. Use the OnShowHint event handler to provide custom text uses in the Hint display.

Use the ShowHint property in a TForm instance to enable or disable pop-up hint display for all controls on a given form. Use the ShowHint property in TApplication to enable or disable pop-up hint display for all forms and controls in an application.

TForm.ShowHint TApplication.ShowHint
Allows the control, and all of its children, to be displayed or hidden.

Visible is set to True by Show, or to False by Hide. Calling these methods is equivalent to setting the Visible property.

Reading the Visible property does not take into account control's parent visibility. Use the IsVisible method to get the real visibility.
The general message handler for this control.

Preprocesses several messages, then calls Dispatch to invoke the applicable message handler.

The message to handle.
The handler for all messages.

WindowProc is set to by default.

When you ever change WindowProc, then remember the previous setting and delegate all unhandled messages to that method.

TLMessage
How the control is currently docked. (horizontally, vertically, in a notebook, or not at all).

The property value is assigned when the control is inserted into a docking tree during a drag and dock operation. Its value is used when CalculateDockSizes is called to adjust the height or width for the host dock site.

Determines whether the control is floating (not part of a form).
The class for a floating host dock site for this control.
The host site (TWinControl) into which this control is docked. Nil if not docked.
The Width when last docked, with siblings to the left or right.
The Height when last docked, with siblings above or below.
Height for the control when undocked.
Width for the control when undocked.
True when BiDiMode is bdRightToLeft.
True when BiDiMode is not bdLeftToRight.
True when scrollbars appear at the left side of the control.
True when BiDiMode is not bdLeftToRight.
Customization (of text controls) in bidirectional reading environments.

In "normal" reading mode (left-to-right, LTR) text entry starts at the left, text is almost left justified, and vertical scrollbars sit at the right side of the control.

In right-to-left mode text entry starts at the right, text is almost right justified, and vertical scrollbars sit at the left side of the control.

In a bidirectional environment these different placements and adjustments can be configured (swapped) in various (but not all) ways.

(Allows RTL languages such as Arabic and Hebrew to be used)

Wild guess: The default mode is established by the platform, RTL reading is not supported on all (Windows) platforms.

Indicates whether the BiDiMode settings in the Parent control are used.

When set to True, the BidiMode property from the Parent control is copied into the BiDiMode property for the control. The default value for ParentBiDiMode is True.

Changing the value for the property causes a CM_PARENTBIDIMODECHANGED message to be performed to update the control.

See BiDiMode or UseRightToLeftAlignment for more information about the use of bidrectional text on the control.

Contains anchor aligment information used to position the control with its left edge anchored to another control.

AnchorSideLeft is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideLeft provides access to the array element in AnchorSide stored at the position in akLeft.

Contains anchor aligment information used to position the control with its top edge anchored to another control.

AnchorSideTop is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideTop provides access to the array element in AnchorSide stored at the position in akTop.

Contains anchor aligment information used to position the control with its right edge anchored to another control.

AnchorSideRight is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideRight provides access to the array element in AnchorSide stored at the position in akRight.

Contains anchor aligment information used to position the control with its bottom edge anchored to another control.

AnchorSideTop is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideTop provides access to the array element in AnchorSide stored at the position in akTop.

Contains the shape for the mouse pointer when the mouse is over the control.

Cursor is a TCursor property with the cursor shape displayed when the mouse pointer is hovered over the control. The default value for the property is crDefault.

Changing the value for the property causes a CM_CURSORCHANGED message to be performed to update the control. The value is applied ar run-time when the CMCursorChanged method handles the control message.

Use SetTempCursor to display a temporary cursor shape when an action is in progress for the control.

TScreen.Cursors TScreen.RealCursor
The client coordinate with the left edge for the control.

Left is an Integer property with the coordinate for the left edge of the control relative to its Parent. Changing the value for the property causes SetBounds to be called to apply the new value for the property along with the existing values in Top, Width, and Height.

The vertical size for the control.

Height is an Integer property with the vertical size for the control in pixels.

Setting a negative value in Height is not allowed, and the property defaults to 0 (zero). At design-time, setting Height to a value not in the range 0..9999 causes an ELayoutException to be raised (and handled in the IDE).

Setting a new value for the property causes SetBounds and ChangeBounds to be called. This ensures that the new value is is the range allowed in Constraints, and that the control is aligned on its Parent using the Anchors for the control.

A value assigned to Height is ignored when AutoSize is set to True; the control is automatically adjusted to the size needed for its aligned content.

Values in Top, Left, Width, and Height are used to calculate the display area for the control in GetClientRect. They determine the clipping rectangle used when the control is drawn on its Parent.

The text to show in the Hint window for the control.

Hint is a TTranslateString property with hint text displayed in a pop-up window when the mouse is hovered over the control. The pop-up window is displayed when the ShowHint property is set to True.

Assign a value to Hint to describe the usage or formatting conventions used for the value entered in the control. For example:

Edit1.Hint := 'Start Date in MM/DD/YYYY format';

Hint can be given a value that includes both short and long variants of the hint text. The values are separated by a '|' (Vertical Bar) character in the property. For example:

Edit1.Hint := 'Start Date | Start Date in MM/DD/YYYY format';

The short variant is used in the pop-up hint window for the control. The long variant is assigned to the Application.Hint property, or displayed on a form status bar when its AutoHint property is set to True.

As a TTranslateString type, Hint can be localized using the translation facilities built into the LCL and the Lazarus IDE. The property value is written using LCL component streaming when the hint text for the control is not linked to an assigned Action.

Hint is not the same value as the placeholder introduced as the TextHint property in descendent controls.
The client coordinate for the top edge of the control.

Top is an Integer property with the coordinate for the top edge of the control relative to its Parent. Changing the value for the property causes SetBounds to be called to apply the new value for the property along with the existing values in Left, Width, and Height.

The horizontal size for the control.

Width is an Integer property with the horizontal size for the control in pixels.

Setting a negative value in Width is not allowed, and the property defaults to 0 (zero). At design-time, setting Width to a value not in the range 0..9999 causes an ELayoutException to be raised (and handled in the IDE).

Setting a new value for the property causes SetBounds and ChangeBounds to be called. This ensures that the new value is is the range allowed in Constraints, and that the control is aligned on its Parent using the Anchors for the control.

A value assigned to Width is ignored when AutoSize is set to True; the control is automatically adjusted to the size needed for its aligned content.

Values in Top, Left, Width, and Height are used to calculate the display area for the control in GetClientRect. They determine the clipping rectangle used when the control is drawn on its Parent.

Indicates whether context-sensitive Help is selected by numeric ID or keyword.

HelpType is a THelpType property which indicates the mechanism used to locate and display a help topic for the control.

htKeyword
  Uses the value in HelpKeyword to locate help content for the control.
htContext
  Uses the numeric identifier in the HelpContext property to locate help content for the control.

The default value for the property is htContext.

The value in HelpType is updated when an explicit value is assigned to the HelpKeyword or HelpContext properties.

HelpType is used in the ShowHelp method to select the TApplication method called to display the help content. When set to htContext, the HelpContext method in Application is called. When set to htKeyword, the HelpKeyword method in Application is called. If the help request cannot be handled using the values assigned to the control, the ShowHelp method in Parent is called (when assigned).

TApplication.HelpContext TApplication.HelpKeyword TApplicationProperties.HelpFile TCustomForm.HelpFile THelpType
The context-sensitive Help keyword for the control.

HelpKeyword is a String type with the context-sensitive keyword used to locate and display a help topic for the control. When an value is assigned to the property, the HelpType property is set to htKeyword.

HelpKeyword is used in the ShowHelp method, and passed as an argument to the HelpKeyword method in the Application singleton.

Use HelpContext to specify a numeric context identifier for the help topic displayed for the control.

Use the HelpFile property, found on the parent form or in a TApplicationProperties instance, to set the help file with the content for the help topic.

TApplication.HelpKeyword TApplicationProperties.HelpFile TCustomForm.HelpFile
The numeric context-sensitive Help identifier for the control.

HelpContext is an Integer property with the numeric identifier used to locate and display a context-sensitive help topic for the control. The default value for the property is 0 (zero).

Setting a new value for the property causes HelpType to be changed to htContext.

HelpContext is used in the ShowHelp method, and passed as an argument to the HelpContext method in the Application singleton.

Use HelpKeyword to specify a string value with the help topic displayed for the control.

Use the HelpFile property, found on the parent form or in a TApplicationProperties instance, to set the help file with the content for the help topic.

TApplication.HelpKeyword TApplicationProperties.HelpFile TCustomForm.HelpFile
Integer type used for

TBorderWidth is an Integer type with the range of values that can be used as the width for a border on a control. TBorderWidth is the type used to implement the BorderWidth property in TWinControl and descendent classes.

Type used for a callback method, to be called for all children of a control.
The child control.
Defines how child controls are resized / aligned.
Using (Delphi compatible).

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

Scale children, keep space between children fixed.

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

Enlarge children equally, i.e. by the same amount of pixels.

Enlarge children equally. Children are resized to their normal/adviced 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).

Enlarge space between children equally.

Enlarge space between children equally. Children are resized to their normal/adviced 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.

Each child gets the same size (maybe one pixel difference).
Not implemented in the current LCL version.

Set each child to the same size (maybe one pixel difference). The client area is divided by the number of controls and each control gets the same size. The remainder is distributed to the first children.

Defines the logic used to wrap child controls.
No wrapping.
Arranges controls in a row filled from left to right, and then top to bottom. Uses the value in BiDiMode; when it contains bdRightToLeft the horizontal direction is reversed (Right to Left).
Arranges controls in columns, from top to bottom and then left to right.
How child controls are sized relative to their parent.

TControlChildSizing is a TPersistent descendant which provides properties and methods used to layout, align, and resize child controls relative to their parent. Properties are provide which define the horizontal and vertical spacing between controls, the preferred direction controls are aligned, and whether controls are scaled to fit in the parent control.

See and for details about the enumeration values used in the properties.

Notifies the Control and invokes the OnChange handler.
Constructor for the class instance.

Create is the constructor for the class instance. Create calls the inherited constructor, and sets the default values for properties including:

Control
  Set to the value in the OwnerControl argument
Layout
  Set to cclNone
EnlargeHorizontal, EnlargeVertical, ShrinkHorizontal, ShrinkVertical
  Set to crsAnchorAligning

Control which owns the class instance.
Copies property values from the specified persistent object into the current class instance.
Persistent object with the property values copied in the method.
Copies property values from the current class instance to the specified persistent object.
Persistent object where the property values are stored.
Determines whether the specified sizing contains the same values as the current class instance.

IsEqual is a Boolean function used to determine whether the TControlChildSizing instance in Sizing contains the same values as the current class instance. IsEqual compares the following properties to determine the return value:

- EnlargeHorizontal
- EnlargeVertical
- ShrinkHorizontal
- EnlargeHorizontal
- ShrinkVertical
- EnlargeVertical
- ShrinkHorizontal
- ShrinkVertical
- ControlsPerLine
- Layout
- LeftRightSpacing
- TopBottomSpacing
- HorizontalSpacing
- VerticalSpacing

The return value is True when the properties contain equivalent values in both class instances.

True when the specified sizing contains the same values as the current class instance.
TControlChildSizing class instance compared in the method.
Set all spacing to the same value.
The Control to which childsizing applies.
Number of controls per line.
Various ways to fit controls into the available Width.
Various ways to fit controls into the available Height.
Minimum space between children.
Allows to also arrange the child controls in rows or columns.
Minimum distance between children and client border.
Event handler for any change in the data.
Various ways to fit controls into the available Width.
Various ways to fit controls into the available Height.
Minimum distance between children and client border.
Minimum space between children.
Alias for the TControlActionLink type.

Since HelpContext and HelpKeyword are properties of TControl, this class is obsolete. To maintain compatibility with existing code, its declaration is aliased to TControlActionLink.

Class type used to create new instances of TWinControlActionLink.
State flags of TWinControl.
Client rectangle has been invalidated and needs to be updated.
The Color property in s control has been changed.
Set when the font was changed before handle creation.
Set during DoAllAutosize.
Set when the AlignControls method is called.
Set in the method Paint before the LM_ERASEBKGND message is performed.
Set while constructing the handle of this control.
Set while initializing during handle creation.
Set while constructing the handles of the children.
Set inside RealizeBoundsRecursive.
Set before bounds are sent to the widget; used to suppress subsequent size messages sent by the widget.
Set before a visible control and its children are updated during auto-sizing.
Set when a control is visible and not obscured on its parent.
Set when the adjusted ClientRect is valid.
Set when the LCL interface has already called SetBounds during size and move operations. Prevents a loop.
Only used for TCustomPairSplitter / TPairSplitter.
Only used for TCustomPairSplitter / TPairSplitter.
Set of TWinControlFlag enumeration values.

TWinControlFlags is a set type used to store zero (0) or more values from the TWinControlFlag enumeration. TWinControlFlags is the type used to implement an internal member in TWinControl. Values are added to and removed from the set as needed in TWinControl methods.

Flags for finding a control at a given (client) position.

TControlAtPosFlag is an enumeration type with values that indicate the mechanism used to locate a control at a given client position.

Values from the enumeration are stored in the TControlAtPosFlags type.

TControlAtPosFlag enumeration values are used in the implementation of the ControlAtPos method in TWinControl, and in the FindControlAtPosition function.

Include disabled controls when set.
Include both TWinControls and TControl instances when set.
Checks for hits are limited to the client area when set.
Recurse into grand-children controls when set.
Scroll offset is already included in the coordinates when set.
Include only TWinControls (and ignore TControls) when set.
Set type used to store values from the TControlAtPosFlag enumeration.

Passed as an argument to the ControlAtPos method in TWinControl. Used internally in the implementation of the FindControlAtPosition routine.

Used in custom alignment (alCustom).

This record was added for compatibility with Delphi releases after Version 7. It is used in CustomInsertBefore and CustomAlignPosition methods and handlers.

The list of controls currently being aligned.
Index of current control.
The kind of alignment currently processed (always alCustom).
For internal use.
Type of an OnAlignInsertBefore handler.
The handler determines the order used to align both controls.
True if Control2 shall be placed before Control1 is placed.
The Parent control.
Type of an OnAlignPosition handler.

Specified an event handler which positions the Control using the specified coordinates and alignment information.

TWinControl generating the event notification.
The control to position.
New Left coordinate for the control.
New Top coordinate for the control.
New Width for the control.
New Height for the control.
The remaining ClientRect.
Information about the current align process.
Implements an enumerator for TWinControl instances.

TWinControlEnumerator is a class used to implement an enumerator for TWinControl class instances. TWinControlEnumerator provides support the enumerator interface through its GetCurrent and MoveNext methods.

TWinControlEnumerator is the type returned by the GetEnumeratorControls and GetEnumeratorControlsReverse functions in TWinControl.

Member with the current position for the enumerator.
Member which indicates the order for the enumerator.
Member with the Parent for the enumerated values.
Gets the current enumerator value.
The enumerator instance.
Constructor for the class instance.
Control which is the Parent for the enumerator.
The enumerator uses ascending order when True (default).
Gets the enumerator for the class.
Moves to the next value using the ordering in effect for the enumerator.
Next value for the enumerator.
Gets the current value for the enumerator.
Implements a windowed control which can contain other child controls.

TWinControl is a TControl descendant which implements a base class for controls that can contain child controls. The name reflects the fact that (on Windows platforms) the controls are based on OS-provided widgets, which have window Handles.

TWinControl extends the ancestor class with new properties, methods, and events which are specific to the windowed control. It also provides overridden methods which re-implement the functionality for some inherited methods. The properties, methods, and event fall into categories like:

- Hi-DPI Awareness and Scaling
- Control, Window, and Notification Message Handlers
- Keyboard and Mouse Message Handlers
- Drag and Drop, Drag and Dock
- Sizing, Positioning, and Alignment
- Alternate Constructors and Class Functions used to create TWinControl Instances
- Forward and Reverse Enumerators for Child Controls

TWinControl is often used as the ancestor for control classes defined in the LCL. For example: TButtonControl, TCustomCalendar, TCustomComboBox, TCustomControl, TCustomEdit, TCustomGroupBox, TCustomListBox, TCustomListView, TCustomPage, TCustomPairSplitter, TCustomProgressBar, TCustomRubberBand, TCustomScrollBar, TCustomStaticText, TCustomTabControl, TCustomTrackBar, TPreviewFileControl, and TStatusBar.

The bounds as sent to the widget. Used to suppress feedback messages from the widget.
Aligns the control and its child controls.

AlignControl is a procedure used to align the control (and its child controls) relative to the control specified in AControl. AControl can contain the value Nil to indicate a containing control is not used to align the control instance.

AlignControl calls DisableAlign on entry, and EnableAlign prior to exiting from the method.

No actions are performed in the method when the control is being freed (the value csDestroying is in ComponentState).

AlignControl gets the client rectangle used to display the control, and calls AdjustClientRect to allocate border spacing when needed. AlignControls is called to align child controls relative to the control in AControl using the calculated client rectangle. Some widgetsets update their client rectangle when the first child is positioned; a second call to AlignControls is made if the client rectangle is altered in the initial call to the method.

AlignControl is used in the implementation of the DoAllAutoSize method in TControl.

Control which provides the relative position for the control and its children.
Implements the storage specifier for the DoubleBuffered property.

Contains True when a parent control has not enabled its DoubleBuffered property.

Gets the value for the IsSpecialSubControl property.
Value for the property.
Sets the value for the DesignerDeleting property.
New value for the DesignerDeleting property.
New value for the Handle property.
New value for the BorderWidth property.
New value for the ParentWindow property.
New value for the TabOrder property.
New value for the TabStop property.
Places a control at the specified position in the tab order for Controls.

UpdateTabOrder is a procedure used to place the current control at the position in NewTabOrder in its Parent control. Causes the TabOrder for child controls in Parent to be re-sequenced as needed.

No actions are performed in the method when Parent is unassigned (contains Nil).

New tab order for the current control.
Inserts or appends the specified control to the list of child controls.

Insert is an overloaded procedure used to insert or append the control specified in AControl to the list of child controls in the class instance. An overloaded variant has an Index argument which specifies the position in the list.

No actions are performed in the method when AControl has not been assigned (contains Nil).

Insert raises an exception if AControl already has an assigned Parent, or when AControl is the same as the current class instance.

The ListInsert routine is called to store AControl in the Controls property at the position contained in Index. If AControl is a TWinControl instance, it is added to the internal list which maintains the tab order for child controls. At design-time, the TabStop property in AControl is automatically set to True when its CanTab property is enabled.

Insert sets the Parent property in AControl to the current control instance.

Inserts checks to see whether auto-sizing has been disabled in the AControl argument. When disabled in the child control, it is also disabled in the current class instance.

Insert is used in the implementation for the InsertControl method.

Raises an EInvalidOperation exception when the inserted control already has a Parent.

Raises an EInvalidOperation exception when the inserted control is the same as the current class instance. Uses the exception message in rsAControlCanNotHaveItselfAsParent.

Control to insert or append as a child control.
Position where the new control is stored in the Controls property.
Removes the specified control from the list of child Controls for the class instance.

Remove is a procedure used to remove the control in AControl from the list of child Controls for the class instance. No actions are performed in the method when AControl has not been assigned (contains Nil).

Remove ensures that the value in AControl is removed from the Controls property, and the internal list used to determine alignment order of the child controls. When AControl is a TWinControl instance, it is removed from the internal tab order list for child controls.

Remove sets the Parent property in AControl to Nil.

Remove checks to see whether auto-sizing has been disabled in the AControl argument. When disabled in the child control, it is re-enabled for the current class instance.

Remove is used in the implementation of the RemoveControl method.

Control removed from the list of child Controls in the class instance.
Fills the list with the child controls which must be realigned.

The list is initialized with all child controls which have the given alignment and are visible.

List all controls with this alignment.
Member used to store the value for the DoubleBuffered property.
Contains various window control state flags.
Registers the class instance for use in the widgetset.

No actions are performed in the method when the class type has already been registered in the widgetset.

Calls the inherited method on entry to ensure that the TControl class type has been registered in the widgetset. Calls the widgetset routine used to register the TWinControl class type.

Registers properties in TWinControl which are ignored during LCL component streaming. These are Delphi / VCL compatibility properties like ParentDoubleBuffered, ImeMode, and ImeName. They are not used in the LCL.

TLCLComponent.WSRegisterClass
Override this method when the ClientRect for a control differs from the default value.

In TWinControl, the virtual method has an empty implementation. It can be overridden in descendent classes to perform actions needed for the class type. Such as:

- Shrink or grow the client rectangle to account for added or removed borders or bezels.
- Reserve space for companion controls or user interface elements.
- Set state or configuration flags which affect the client rectangle for the class.

AdjustClientRect can be called often, especially during auto-sizing and anchoring operations. Do not use expensive code here, or cache the resulting client rectangle for subsequent access.

The client rectangle examined and updated in the method.
Returns the adjusted logical ClientRect, using the cached value when available.
Repositions and resizes the control and child controls.

AlignControls is a method used to reposition and resize the specified control and the children in its Controls property. This includes using the DockManager (when assigned and enabled) to reserve space for docked controls in the client rectangle. It uses settings in the Align, Anchor, BorderSpacing, ChildSizing, and Constraints properties to determine the actions needed in the method for each of the controls.

AlignControls checks and updates the windowed control flags prior to starting the operation. No actions are performed in the method when wcfAligningControls is already included in the control flags.

The ControlsAligned method is called when the method is completed, and the control flags are updated to remove the value wcfAligningControls.

AlignControls is called from the private AlignControl method after the client rectangle has been adjusted and the logical display area for the control has been determined. AlignControl is the boss; AlignControls performs the heavy lifting.

Control examined and updated in the method.
The available space, becomes remaining space on exit.
Returns the placement order of custom-aligned child controls, using the OnAlignInsertBefore handler.
True if Control2 should be placed before Control1.
Returns the aligned position for a custom-aligned child control, using the OnAlignPosition event handler.

The derived coordinates take into account the anchoring for AControl.

The OnAlignPosition handler can update the coordinates as required.

The control to be placed.
The remaining client area, within which the control can be placed.
Information about the current align process.
Override this method to position / align all child controls for the specified control.

DoAlignChildControls always returns False in TWinControl. It can be overridden in descendent classes to perform any actions needed, and to set the return value to True to avoid the default handling performed in AlignControls.

True when all controls have been placed.
The alignment of all given controls.
Control with child controls and client rectangle used in the method.
The controls to be placed.
The unused client rectangle available for the child controls.
Called after a change in ChildSizing information to trigger further processing.
Flags the preferred sizes of all child controls as invalid (recursively).
Indicates whether the Tab key can be used for keyboard navigation in the control.

CanTab is an overridden method in TWinControl. The return value is True if the control is eligible to receive input focus. It must have a parent form and be both visible and enabled.

Set TabStop to indicate the control is omitted in the tab order for the parent form.

Implements the storage specifier for the ClientHeight property.

Re-implements the method inherited from TControl.

TControl.ClientHeight
True if ControlCount has a non-zero value.
Implements the storage specifier for the ClientWidth property.

Re-implements the method inherited from TControl.

TControl.ClientWidth
True if ControlCount has a non-zero value.
Sends the new Visible state to the widgetset class instance.

Called from the CMShowingChanged method.

Called from AlignControls when alignment for the control is completed.

ControlsAligned has an empty implementation in the current LCL version.

Sends the new bounds for the control to the widgetset class instance.
Called from RealizeBounds.
Checks for changes in BoundsRect, and sends the new bounds to the widget.

Calls DoSendBoundsToInterface to update the widget.

Sends changed BoundsRects to the widget, for both the control and all child controls.
Resets the realized bounds rectangle for the control.

Creates a new, empty TRect instance for the internal member passed to the widgetset class. Used in widgetset methods which apply changes to the Font for the control.

An empty implementation in the current LCL version.

An empty implementation in the current LCL version.

Creation parameters for the subclass.
Class name for the control added as a subclass.
Notifies the widgetset class instance when Constraints are changed.

DoConstraintsChange is an overridden method in TWinControl, and calls the inherited method on entry to size and position child controls to Constraints. Calls the ConstraintsChange method in the widgetset class instance when its Handle has been allocated.

DoConstraintsChange is called from the TSizeConstraints.Change method before it signals the OnChange event handler in the constraints class instance.

TControl.DoConstraintsChange
Object (TWinControl) instance for the change notification.
Updates the size and extent of the control as well as its ClientRect.

Changing the ClientRect here, to the most probable size, reduces unnecessary resize messages.

Normally, the ClientWidth / ClientHeight are adjusted automatically by the widget. But it is up to the widget when this will be done. GTK, for example, just puts resize requests in a queue. The LCL would resize the child components immediately after the GTK procedure to adjust the ClientRect. On complex forms with lots of nested controls, this would result in thousands of resize messages.

Shrinks or enlarges the control to accommodate its children.

Because this method is frequently overridden, the LCL calls the method instead; it checks whether DoAutoSize really should be called right now.

DoAutoSize performs the following:

- Checks whether Autosize is permitted
- Checks for unaligned child components and aligns them 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

Performs actions to resize and align the control and all of its children.

DoAllAutoSize is an overridden method in TWinControl.

No actions are performed in the method when wcfAllAutoSizing has already been included in the window control flags; in other words, the method has already been called. No actions are performed when AutoSizeDelayed returns True.

DoAllAutoSize checks to ensure that a Handle has been allocated for the control, and that it and its Parent are Visible. If AutoSizing is not possible, the flag is removed from the control and its children and the method is exited.

DoAllAutoSize calls the inherited method to change the bounds, invalidate the preferred size, and update flags for the control. RealizeBoundsRecursive is called to update the bounds for the all child controls. The child controls are made visible first, and then the current control instance.

DoAllAutoSize is called from the AdjustSize and EnableAutoSizing methods.

The inherited method raises an EInvalidOperation exception if Parent has not been assigned for the control.

Raises a catchable exception when cfAutoSizeNeeded is already included in the control flags when the method is called.

Called from DoAllAutoSize after all bounds are computed for the control.
TCustomForm.AllAutoSized
Override this method to return a different preferred height and/or width for auto-sizing.

Calls the inherited method to calculate the default / preferred width and height for a TWinControl instance. It is used by the LCL auto-sizing algorithms as the default size. Only positive values are valid. Negative or 0 (Zero) values are treated as undefined, and the LCL uses other values to perform auto-sizing.

TWinControl overrides this:

- If there are child components, their total preferred size is calculated
- If this value cannot 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 relies on the current theme and widgetset.

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

WithThemeSpace adds space for stacking when set to True. For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be space around each control. This space is theme- dependent, so it is passed as a parameter to the widgetset.

Indicates if additional space is reserved for theme services.
Calculates the width and height for the frame area around the control.

Calculated as follows:

- AWidth is the difference between Width and ClientWidth.
- AHeight is the difference between Height and ClientHeight.

Width used for the frame around the control.
Height used for the frame around the control.
Calls the specified procedure for each child control with Root as the Owner.

Iterates the value in Controls to locate any controls where Root is the Owner of the control instance. Calls the procedure in Proc using the control instance as an argument. An application must implement an object procedure using the signature in TGetChildProc, and pass the procedure in the Proc argument.

The callback procedure.
Owner of the controls passed to the procedure.
Checks whether the specified class type is allowed as a child control.

ChildClassAllowed is an overridden method in TWinControl used to determine if instances of the class type in ClassType are allowed as child controls. Returns True if the specified class type is allowed as a child control in the Controls property.

In TWinControl, the return value is True when ChildClass has been assigned (not Nil) and the class type is derived from TControl.

ChildClassAllowed does not call the inherited method which always returns False.

ChildClassAllowed is called from the CheckChildClassAllowed method in TControl.

True when ChildClass is allowed in Controls.
Class type examined in the method.
Paints all child controls which do not have a Handle as part of their Parent.

Controls which do not descend from TWinControl have no handle of their own; they are repainted when the parent control is redrawn.

No actions are performed in the method when the device context in DC is unassigned (0), the Handle has not been allocated for the control, or an internal TFPList has not been created to store the child controls in the Controls property.

PaintControls tries to locate and paint controls (starting with the control in First) not derived from TWinControl. When First is omitted (Nil) or not found in the internal list, all child controls in the list are examined. The control must be Visible and within the visible client area on the Parent to be painted.

Each eligible control is positioned on the device context using the Left and Top properties for the control. Its clipping rectangle is copied to the device context, and an LM_PAINT message is performed on the DC to redraw the parent control.

The ControlState property is updated prior to and following the paint operation for each child control to include or exclude the csPaintCopy value.

PaintControls is called from the PaintHandler method, and occurs when the WMPaint method handles an LM_PAINT message for a control.

The device context usable for painting child controls.
First of the controls in Controls[], which remain to paint.
Handler for TLMPaint, manages the painting of child controls.

PaintHandler is a method used to apply the LM_PAINT window message in TheMessage to the client rectangle for the control. The device context in TheMessage is used as the target for the paint operation. If the device context is unassigned on entry, the BeginPaint routine in the LCL interface is called to get a device context for the Handle in the control.

PaintHandler checks the list of child controls if any of the items are visible, opaque TControl class instances which need to be drawn using the Handle for the control. When found, a clipping rectangle for the child control is calculated on the device context.

PaintHandler calls the PaintSite method in the DockManager (when assigned and enabled) to paint the DockSite to the device context. The PaintControls method is called to force the all child controls to be painted to the device context.

PaintHandler calls the EndPaint routine in the LCL interface to free the device context prior to exiting from the method.

PaintHandler is called when the WMPaint method receives an LM_PAINT message for the control.

LM_PAINT window message handled in the method.
Paints a clipping region for the control on the specified device context.

PaintWindow is a method used to paint a clipping region for the control (or a child control) to the device context in DC.

PaintWindow creates a TLMessage instance using the LM_PAINT window message and the specified device context. The DefaultHandler method is called to pass the message to the widgetset class instance (and ultimately its message processing loop).

No actions are performed in the method when DC is unassigned (0), the Handle for the control has not been allocated, or the control is being freed.

PaintWindow is called from the PaintHandler method.

Device context with the requested clipping region.
Creates the Brush, if not already created.

Creates and assigns a TBrush instance used in the Brush property. The brush Color is updated using the resolved value in the Color property. clDefault in Color causes the default brush color value from the widgetset to be used.

CreateBrush is called when the value for the Brush property is read, and the member has not yet been assigned.

TBrush
Scales values for all child controls.

ScaleControls is a method used to scale the child controls in the Controls property using the specified multiplier and divisor. ScaleControls visits each of the class instances in Controls and calls its ChangeScale method using Multiplier and Divider as arguments.

ScaleControls is called from the overridden ChangeScale method. This causes all controls in the hierarchy to apply the scaling factor to values in their Constraints, Font, Left, Top, Right and Bottom properties. For top-level Forms, the values in Left and Top are not scaled.

Multiplier applied to a value to achieve a scaling factor.
Divisor applied to a value to achieve a scaling factor.
Scales (resizes) the control and all of its child controls.

ChangeScale is an overridden method in TWinControl used to ensure that child controls are scaled using the values in the Multiplier and Divider arguments.

ChangeScale extends the inherited method by calling DisableAlign before applying the scaling factor. It calls the ScaleControls method to apply Multiplier and Divider to the child controls. It calls the inherited method to apply scaling to the Bounds, Constraints, and Font in the control.

ChangeScale visits each of the control instances in Controls, and calls their UpdateAnchorRules method to update the BaseBounds in the control as needed.

EnableAlign is called prior to exiting from the method.

Multiplier applied to a value to achieve a scaling factor.
Divisor applied to a value to achieve a scaling factor.
Handles a CM_BIDIMODECHANGED control message for the control.

CMBiDiModeChanged is an overridden method in TWinControl used to handle a CM_BIDIMODECHANGED control message received for the control. It calls the inherited method on entry to invalidate the control when needed. It extends the inherited method to notify child controls of the change using a CM_PARENTBIDIMODECHANGED message.

If a handle has been allocated in the widgetset class instance, its SetBiDiMode method is called to reflect the values from UseRightToLeftAlignment, UseRightToLeftReading, and UseRightToLeftScrollBar.

AdjustSize is called to update the sizes for parent and child controls after the property value has been changed.

Control message examined and handled in the method.
Handles a CM_BORDERCHANGED message received for the control.

CMBorderChanged ensures that the size and client rectangle are adjusted when a border is added to or removed from the control. It calls DoAdjustClientRectChange and AdjustSize to update values in the control. It calls Invalidate to force the control to be redrawn with the new size and client rectangle.

Control message examined and applied in the method.
Handler for changes to the DoubleBuffered property.

CMDoubleBufferedChanged is the handler used to process CM_PARENTDOUBLEBUFFEREDCHANGED messages when the value in DoubleBuffered has been been changed.

CMDoubleBufferedChanged calls NotifyControls to apply the message in the widgetset class; the value in the Message argument is ignored.

CMDoubleBufferedChanged calls Invalidate to cause the control to be redrawn.

Message examined in the method.
Handler for changed Enabled message; notifies the widgetset.
Handles the CM_PARENTDOUBLEBUFFEREDCHANGED control message for the control (when enabled).

Sets the value in ParentDoubleBuffered to True. When Parent is assigned, the value in DoubleBufferred is set to the corresponding value from the Parent control.

No actions are performed in the method if ParentDoubleBuffered is already set to False.

Message handled in the method.
Handler for changed Showing message; notifies the widgetset.
Handler for changed ShowHint message; notifies all child controls.
Handles Focus changes, and forces UpdateControlState.
Handler for changed Visible message.
Handles the CM_ENTER control message for the control.

CM_ENTER and CM_EXIT messages occur when the active control is changed on a form.

Calls DoEnter to signal the OnEnter event handler (when assigned).

Message handled in the method.
Handles the CM_EXIT control message for the control.

CM_ENTER and CM_EXIT messages occur when the active control is changed on a form.

Calls DoExit to signal the OnExit event handler (when assigned).

Handler for an ContextMenu event; eventually delegates handling to the affected child control.
Erases the background, when required.
Handles (dispatches) notification messages.
Handler for receiving Focus event.
Handles the LM_KILLFOCUS message for the control.

WMKillFocus is a method used to handle the LM_KILLFOCUS control message received when a control loses focus. WMKillFocus ensures that the EditingDone method is called for the control when the parent form has been assigned and is Active.

No actions are performed in the method at design-time, or when the control is being freed.

GetParentForm
Message examined in the method.
Handler for changed visibility notification.
Handles the LM_ENTER message for the control.
Message handled in the method.
Handles the LM_EXIT message for the control.
Message handled in the method.
Event handler for a key press not handled by the widget; Tries
Event handler for system key presses not handled by the widget; tries
Event handler for key released, not handled by the widget. Tries .
Event handler for system key releases not handled by the widget; tries
Handler for messages sent by the widget, after it has handled the key press itself.
Handler for messages sent by the widget, after it has handled the key press itself.
Manages paint requests, and handles double buffering.
Handler for widget destroyed message; clears the Handle.
Handler for widget moved message; updates the Bounds.
Event handler for size messages.

This method is called whenever Width, Height, ClientWidth or ClientHeight have changed. If the source of the message is the interface, the new size is stored in the internal BoundsRealized member to avoid sending a size message back to the interface.

Event handler for size/move messages.

This method is called whenever left, top, width, height, clientwidth or clientheight have changed.

If the source of the message is the interface, the new size is stored in the internal BoundsRealized member. Avoids sending a size message back to the interface.

Handler for a key pushed notification; the message is handled by DoKeyDownBeforeInterface by default.
Handler for a system key pushed notification; the message is handled by DoKeyDownBeforeInterface by default.
Handler for a key released notification; the message is handled by DoKeyUpBeforeInterface by default.
Handler for a system key released notification; the message is handled by DoKeyUpBeforeInterface by default.
Handler for a key pressed notification; CNChar is sent by the widget before it has handled the key press itself.
Dispatches 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 the inherited method.

Handles a 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 True.
Adjust the Parent of a newly 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.
Called to check whether this control allows docking and where.

Called for messages from the DragManager including: dmEnter, dmLeave, and dmMove. Gets the DockRect to show.

Positions the DockRect, and invokes OnDockOver (via DoDockOver).

Everything can be overridden using the OnDockOver handler, when assigned.

Initially True, set to False to reject an drop.
Invoke the OnDockOver handler.
Override this method to take special actions on removal of an docked client.
The default implementation does nothing.
Notifies an OnUnDock handler and the DockManager of an undocked client control.

The OnUnDock handler can deny the undocking request for the control. This can cause problems; instead, the control better should not be draggable.

Set to False to deny undocking.
The new docksite, Nil for floating.
The control being undocked.
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 for the dock site, and can be adjusted in the OnGetSiteInfo event handler.

The dragged control.
The screen rectangle within which a drop is allowed.
The current mouse position.
Can be set to False to reject an drop.
Gets the handle for the Parent control.

GetParentHandle is a HWND function used to get the handle for the Parent in the current control. The return value contains the handle for the TWinControl instance in Parent (when assigned). When unassigned, the handle in ParentWindow is used as the return value.

Control or window handle that is the parent for the current control.
Gets the window handle for the parent control at the top of the control hierarchy.

GetTopParentHandle is a HWND function used to get the window handle for the first control in the parent control hierarchy. The value in Parent is recursively searched until Parent is not assigned.

The return value is the ParentWindow property in the top-most control. If ParentWindow is 0 (the unassigned value), the value in its Handle property is used.

Window handle for the top-most parent control in the hierarchy.
Returns the docked control of the specified name.

This method is used during the restore of the layout of a docksite.

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

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

The name of the control to be docked.
The matching control.
Returns the DockManager for this control.

If DockManager is Nil, and UseDockManager is True, a new default DockManager is created.

The dockmanager for this site, can be Nil for an unmanaged site.
Sets the value for the DockManager property.
New value for the DockManager property.
Handler called when the control starts floating.

A TWinControl can be floated as a stand-alone window, unless they request a special FloatingDockSiteClass.

Returns the dock caption in AControl.

Asks the control for its default dock caption, then allows the OnGetDockCaption handler to adjust the string value.

The control whose dock caption string is requested.
The dock caption to use.
Signals the OnEnter event handler (when assigned) when the control receives focus.

DoEnter is called from the CMEnter method when a CM_ENTER message is received for the control. The event handler allows actions to be performed when the control receives focus, either by using keyboard navigation or by mouse click in the client area for the control.

Signals the OnExit event handler (when assigned) when the control loses focus.

DoExit is called from the CMExit method when a CM_EXIT message is received for the control. The event handler allows actions to be performed when the control loses focus, either by using keyboard navigation or by mouse click in the client area for another control.

Handles a KeyDown event before the widget processes the key.

Key event handlers are invoked in sequence, until a handler is located which responds to the key.

First, all application wide handlers are invoked (TApplication.NotifyKeyDownBeforeHandler).

Second, the form handler is invoked when KeyPreview is requested.

Third, the DragManager is used to determine the dragging status for the control. It interprets the ESC key as a cancel dragging request, and the CTRL key as a request to ignore drag targets.

Finally, the user handler is invoked.

If none of the handlers accept / respond to the key, the widgetset class is used to process the key.

TApplication.NotifyKeyDownBeforeHandler
Set to True when the key was handled.
Message examined in the method.
Handles key down messages which are not handled by the widget.
True if the key was handled.
Handles key up messages which are not handled by the widget.
True if the key was handled.
Performs actions needed to handle a key press message for the control.

DoKeyPress is a Boolean function used to handle a key press event received for the control. The return value is True if the character code in the specified Message is handled for the control.

DoKeyPress allows a TCustomForm instance in Parent with KeyPreview enabled to handle the notification message using its DoKeyPress method. If the character code is handled, the return value is set and no further actions are performed in the method.

The return value is False when standard events have been disabled by including csNoStdEvents in the ControlStyle property.

When not disabled, the KeyPress method is called using the character code in Message as an argument. If the character was handled in the OnKeyPress event handler, the return value is True.

DoKeyPress is called from the CNChar method when a CN_CHAR control notification message is received for the control.

True if the key press was handled for the control.
Control Notification message handled in the method.
Performs actions needed to handle a UTF-8-encoded key press message for the control.

DoUTF8KeyPress is a Boolean function used to handle a key press event for a UTF-8-encoded value received for the control. The return value is True if the character code in the specified Message is handled for the control.

DoUTF8KeyPress allows a TCustomForm instance in Parent with KeyPreview enabled to handle the notification message using its DoUTF8KeyPress method. If the character code is handled, the return value is set and no further actions are performed in the method.

The return value is False when standard events have been disabled by including csNoStdEvents in the ControlStyle property.

When not disabled, the UTF8KeyPress method is called using the character code in Message as an argument. If the character was handled in the OnUTF8KeyPress event handler, the return value is True.

At design-time, DoUTF8KeyPress redirects the key event to the active design surface in the Lazarus IDE.

DoUTF8KeyPress is called from the IntfUTF8KeyPress method when a CN_CHAR control notification message is received for the control. DoUTF8KeyPress is called after KeyDown has been executed.

True if the key was handled.
UTF-8-encoded character examined in the method.
Handles a KeyUp event before the widget processes the key.

For details, see the method.

True if the key was handled.
Message examined in the method.
Allows a parent form to process a keyboard message in one of its child controls.
WantChildKey in TCustomForm always returns False.
True if the key message was handled.
Child key message handled in the method.
Forwards the key message to the parent form to be handled as an accelerator (shortcut) key.

No actions are performed in the method when accelerator keys are not enabled for the LCL interface, or when ParentForm is unassigned for the control.

True if the key was handled.
Handles the specified key in Message as an accelerator or shortcut key.

DialogChar is an overridden Boolean function in TWinControl used to handle a character code in Message as an accelerator (or shortcut) key for a control. It re-implements the inherited method which always returns False. In TWinControl, the Message is sent to each of the children in Controls until one of them indicates that it responds to the accelerator key.

DialogChar is overridden in descendent classes to perform actions needed when the shortcut key is handled in the method. These classes allow the accelerator key to be defined using the Caption or Shortcut properties. Some examples include:

- TCustomGrid / TGrid
- TCustomButton / TButton
- TCustomLabel / TLabel
- TCustomStaticText / TStaticText
- TCustomSpeedButton / TSpeedButton

TControl.DialogChar
True if the key was handled.
Message with the character examined in the method.
Handles key down events for special navigation keys used in a control.

ControlKeyDown is a method used to detect and handle key down events for navigation keys used in the control. ControlKeyDown calls the corresponding method in TApplication to determine the actions needed for the key and modifier. The application handles Tab and cursor keys which may affect control or form focus.

ControlKeyDown is called from the DoRemainingKeyDown method to handle keys not otherwise handled by a control or its parent forms.

TApplication.ControlKeyDown TApplication.DoTabKey TApplication.DoArrowKey
Numeric key code examined in the method.
Shift, Ctrl, or Alt modifier for the key.
Handles key up events for special navigation keys.

ControlKeyUp is a method used to detect and handle key up events for navigation keys used in the control. ControlKeyUp calls the corresponding method in TApplication to determine the actions needed for the key and modifier. The application handles Return (Enter) and Escape keys which may affect control or form focus.

ControlKeyUp is called from the DoRemainingKeyUp method to handle keys not otherwise handled by a control or its parent forms.

TApplication.ControlKeyUp TApplication.DoReturnKey TApplication.DoEscapeKey
Numeric key code examined in the method.
Shift, Ctrl, or Alt modifier for the key.
Signals the OnKeyDown event handler (when assigned).
Numeric key code examined in the method.
Shift, Ctrl, or Alt modifier for the key.
Lets the application, parent forms, or control handle key preview before the LCL interface.
Numeric key code examined in the method.
Shift, Ctrl, or Alt modifier for the key.
An empty implementation in the current LCL version.

An empty implementation in the current LCL version.

Signals the OnKeyPress event handler (when assigned).
Character value for the key press event.
Signals the OnKeyUp event handler (when assigned).
Numeric key code for the key up event.
Shift, Ctrl, or Alt modifier for the key.
Invokes the OnKeyUp handler.
An empty implementation in the current LCL version.

An empty implementation in the current LCL version.

Signals the OnUTF8KeyPress event handler (when assigned).
UTF-8-encoded character value for the key press event.
Returns the preceding or next control in the tab order.

When CurrentControl is Nil, the first control (forward) or last control (backward) in the TabOrder is returned; direction depends on the value in GoForward.

The (next) control.
The control which has the focus. If Nil, the first control (forward) or last control (backward) in TabOrder is returned, depending on GoForward.
False to find the preceding control.
When True only a control with TabStop enabled is found.
When True only a control with Parent set to Self is found.
Returns the first control in the tab order for the parent form.
Gets the value for the BorderStyle property.
Value for the BorderStyle property.
Gets the top, left screen coordinates for the client area in the control.
TControl.GetClientOrigin
TPoint instance with the screen coordinates for the origin of the control.
Gets the value for the ClientRect property.

GetClientRect is an overridden method in TWinControl used to get the value for the ClientRect property. ClientRect contains the visual client area for the control.

GetClientRect extends the inherited method to synchronize values in the control with its widgetset class instance using the Handle for the control. It uses values in ComponentState and the control flags for the TWinControl instance to determine the actions needed in the method. If an action cannot be determined, or the handle is not available, values in ClientWidth and ClientHeight are used as the Width and Height in the TRect instance.

TControl.GetClientRect
Value for the ClientRect property.
Gets the value for the ControlOrigin property.

GetControlOrigin is overridden in TWinControl to get a window rectangle from the LCL interface. If the Handle for the control has not been allocated, the inherited method is called.

Returns the screen coordinates for the Top and Left coordinate 0,0 of the control area. (The top / left 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 to queue them.

TControl.GetControlOrigin
TPoint instance with the screen coordinates for the Top and Left properties.
Gets the device context for the control.

GetDeviceContext is an overridden HDC function in TWinControl used to get the device context used for the control.

The device context provides a Handle (yes another one) with information about the drawing region on a display or printer. In the LCL, this essentially identifies a clipping rectangle for a given window handle. In TControl, the device context for the WindowHandle in the Parent control is used (because it does not have its own handle). In TWinControl, the Handle for the control is used.

GetDevice context calls the GetDC routine in the LCL interface to get a device context for the value in its Handle property. On successful completion of the routine, the return value is also assigned to the WindowHandle argument (which is the member for the WindowHandle property for display purposes).

An EOutOfResources exception is raised when GetDC returns an unassigned device context (0).

GetDeviceContext re-implements the inherited method.

Device context created for the control, or 0 when unavailable.
Handle for the control represented in the device context. Updated in the method.
Gets the value for the ParentBackground property.
Value for the property.
Sends the mouse message to a child control.
True if a child control was found at the mouse coordinates.
Creates the Handle for the widget, if not already created.
Initializes the window creation parameter record with the settings for the control.

CreateParams is a procedure used to initialize and/or update creation parameters in the Params argument. CreateParams is called from the CreateWnd method when the window handle is allocated for the control.

CreateParams ensures that values in the TCreateParams record instance contain the values needed for the class instance. The following members in the record are update:

Caption
  Set to the value in the Caption property.
Style
  Includes flag values: WS_CHILD, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, and WS_TABSTOP when needed.
ExStyle
  Includes style values needed for the value in ControlStyle and BorderStyle.
WndParent
  Set to the handle in ParentWindow, or Parent.Handle when assigned.
X, Y, Width, Height
  Set to the property values in the class instance.

TCreateParams
Create parameters updated in the method.
Creates the interface object (widget) and assigns the value in Handle.

Raises a catchable debugger exception for various conditions, including:

- The control, or its Parent, has the value csDestroying in the ComponentState property.
- The method has been called recursively, as indicated by values in the window control flags.
- The method has been called at run-time before LCL component streaming has been completed.
- The Handle was not successfully created in the widgetset class.

Ensures that the realized bounds for the control is reset prior to creating the Handle for the control and any child Controls. An EInvalidOperation exception is raised if the handle for the Parent control is not valid when the method is called.

Calls the InvalidatePreferredSize method for the control, and any child controls, and calls AdjustSize. If an error occurred while creating the Handle, auto-sizing is not enabled for the control.

CreateWnd is called from the CreateHandle method.

Destroys the handle for the control and all child controls.
Destroys the interface object (widget).
Flip children horizontally (mirrors the Left position).

Child controls arranged in left-to-right order appear in right-to-left order after flipping. All anchors are adjusted accordingly.

Prepares to remove the window (called before the Handle is destroyed).
Assigns sequential TabOrder values to all child controls.
Implements the event handler signalled when the Font has been changed for the control.

FontChanged is an overridden method in TWinControl which implements the handler assigned for OnChange events in the Font for the control. The assignment occurs in the inherited constructor. FontChanged is called when a new value of assigned to the Font property in the control.

FontChanged ensures that the widgetset class instance uses the TFont instance in the Sender argument when its handle has been allocated. It also updates the control flags to remove the value wcfFontChanged when the widgetset class has been updated. If the widgetset handle has not been allocated, the value wcfFontChanged is included in the control flags.

FontChanged calls the inherited method. NotifyControls is called to notify child controls of the change to their parent font.

Object instance (TFont) for the event notification.
Copies cached control properties to the just created widget.

Called after the Handle is created, and before child handles are created.

Performs actions when a component has been loaded during LCL streaming.

Loaded is an overridden method in TWinControl used to perform actions needed when a component has been loaded from a resource during LCL streaming. It extends the inherited method to align and resize it child Controls, as well synchronize property values with those in the widgetset class instance when its handle has been allocated.

Loaded calls the inherited method to update the BaseBounds for control, and to apply property values dependent on the Parent control.

Loaded calls FixupTabList to populate an internal list with child Controls ordered by their TabOrder property.

Realizes all cached changes after a bulk update of the form. Calls the inherited FormEndUpdated method, then informs each child control.
The message handler for the control.

Used for controls which need features not yet supported by the LCL. MainWndProc has an empty implementation in TWinControl.

TApplication
Message handled in the method.
Called after all child handles for the ParentForm are created; notifies all children of the end of the handle creation phase.
Called after all child handles have been created; resets wcfCreatingChildHandles.
Gets the value for the MouseCapture property.

GetMouseCapture is a Boolean function used to get the value for the MouseCapture property. It is overridden in TWinControl to ensure that the Handle for the control has been allocated. The return value is True when HandleAllocated returns True, and GetCaptureControl returns the current class instance.

Value for the MouseCapture property.
Sets the text / caption for the control.

RealSetText is an overridden method in TWinControl. It ensures that the new value is applied to the widgetset class when its Handle has been allocated, and the control size is adjusted when needed/enabled. The inherited method is called to apply AValue to the Text and/or Caption properties for the control.

New value for the text / caption for the control.
Notifies the parent Form when the control cannot be focused.

RemoveFocus is a method used to notify the parent form when the control cannot be focused. RemoveFocus is called from methods like Destroy and RemoveControl, where the control will no longer exist on the parent form. It is also called from methods like CMEnabledChanged and CMVisibleChanged, where the parent form should no longer allow the control to be focused.

RemoveFocus calls GetParentForm to get the parent form instance, and calls its DefocusControl method to ensure that the control is removed as the ActiveControl (when assigned).

TCustomForm.DefocusControl TCustomForm.ActiveControl GetParentForm
True if the control is being freed, False when it is not enabled or not visible.
Sends Move or Size messages using the window message processing loop.

Send Move and Size messages through the LCL message paths. This simulates the VCL behavior and has no real effect.

TControl.SendMoveSizeMessages
Sets the value for the BorderStyle property.

Notifies the widgetset class instance of the new property value when its handle has been allocated.

New value for the BorderStyle property.
Sets the value for the Color property.

SetColor is an overridden method in TWinControl used to set the value for the Color property. It calls the inherited method on entry, and ensures that the new property value is applied to the internal TBrush instance used in the control. This includes translating the value clDefault to the actual brush color used for the platform.

If the Handle has been allocated for the control, the widgetset class is updated. Otherwise, control flags are updated to include the value wcfColorChanged.

The NotifyControls method is called to send the CM_PARENTCOLORCHANGED control message to the child controls.

Updates the position of the child control in the Z plane (i.e. front-to-back).
Control to locate and move in the method.
New ordinal position for the control in the Controls property.
Sets the value for the ParentBackground property.
New value for the ParentBackground property.
Displays the control on its Parent.

ShowControl is a method used to display the control on its Parent. When Parent has been assigned, its ShowControl is called. This is repeated until a control without an assigned Parent is encountered.

ShowControl is called from the Show method in a control instance. It occurs before the Visible property is set to True, and forces each of the parent controls to become visible before setting the value in the control.

A control to display. Ignored in this method.
Updates the visible state for the control, and notifies the widgetset class when available.

Calls AdjustSize when the Handle has been allocated for the control and the control is logically visible in the client area for the parent. This causes DoAllAutoSize and UpdateShowing to be called. If the control is not visible, UpdateShowing is called to hide the control.

Called from the SetParentWindow method.

Updates the Showing property with the visibility for the control, its Parents, and its child controls.

UpdateShowing is a method used to determine the visibility for the Handle in the control. It calls HandleObjectShouldBeVisible to check the handle state and visibility for both the control and each of its Parent controls. If the control should be showing and Handle has not already been allocated, CreateHandle is called.

When child controls exist in the Controls property, they are visited to call the UpdatingShowing method for each of the TWinControl instances.

If an auto-sizing request is not active, a CM_SHOWINGCHANGED message is performed to apply the new visibility for the control(s). The Showing property is updated prior to exiting from the method.

Adds special handling for focus and input messages, and notifies the DockManager.

Handles the following messages:

LM_SETFOCUS
  Gets the parent form and show this control as focused
LM_KILLFOCUS
  Removes focus from this control
LM_NCHITTEST
  Checks the transparency for the control, etc.
Mouse messages
  Sent to the DockManager

Sets the value for the Text property in the widgetset class.

Calls the SetText method in the widgetset class instance.

WSSetText is called from the Loaded and InitializeWnd methods after the control has finished loading using the LCL streaming mechanism or created its window handle. It is also called from RealSetText to apply a new value for the Caption property to the Text for the control.

The text to send.
For internal use; allows direct access to the Handle for the control, bypassing any getter/setter methods.
Indicates the border style displayed around the control.

BorderStyle is a TBorderStyle property which indicates whether borders are drawn for the control. bsSingle indicates that borders are drawn for the control. The default value for the property is bsNone, and indicates that borders are not drawn for the control.

Changing the value for the property causes the widgetset class to be updated when the Handle has been allocated for the control.

BorderStyle is used in the CreateParams method. It causes the WS_EX_CLIENTEDGE extended window style flag to be included in the control when the property is set to bsSingle.

BorderStyle is used along with BorderWidth in descendent classes which allow their borders to be drawn with a raised or lowered appearance.

Provides information about the DockSite for the control.

The handler can adjust the InfluenceRect, within which mouse moves are recognized by this control. The handler also can deny any drops, depending on the dragging operation for the control.

OnGetSiteInfo occurs before the OnDockOver event handler.

This handler can provide a special DockCaption, different than the Caption default.
Indicates if the control uses the background for its Parent control.

ParentBackground is a Boolean property which indicates if the background for the Parent control is drawn as the background for the current control instance.

ParentBackground is True when csParentBackground is included in the ControlStyle property. Setting the value in ParentBackground causes ControlStyle to be updated to include or exclude the csParentBackground enumeration value; it is included when True.

Width of the Border around the control; default is zero.

BorderWidth is a TBorderWidth property which contains the size for a border drawn on the control. The default value for the property is 0 (zero). Changing the value for the property causes a CM_BORDERCHANGED control message to be sent to the processing loop for the control.

BorderWidth is significant when BorderStyle is set to bsSingle. Descendent classes, which allow their borders to be drawn using a raised or lowered appearance, may use the property value when the control is drawn. It indicates the amount of space to reserve for the borders in the bounds rectangle for the control.

For internal use: When greater than zero, updates to the BoundsRect are blocked.
The Brush used to paint the background for the control.

Brush is a read-only TBrush property which provides the tool used to paint the interior of the control. The value in Brush is allocated and configured in the CreateBrush method, called when the value for the property is read but has not been assigned.

The Color property in Brush is updated when a new value is assigned to the Color property in the control.

Brush is used in the EraseBackground method and provides the Handle used to draw the background rectangle for the control.

TBrush
The intended ClientHeight, as sent to the widgetset class.
The intended ClientWidth, as sent to the widgetset class.
Parameters for child control arrangement and spacing.

ChildSizing is a TControlChildSizing property which contains the class used to apply sizing and layout for child controls in the control instance.

The number of child controls in the Controls property.

ControlCount is a read-only Integer property which contains the number of child controls stored in the indexed Controls property.

The value is updated when control instances are created using the current class instance as the Parent for the control. The value is used in the AlignControls method when the Controls are positioned, aligned, and resized. It is also used to determine whether additional actions are needed in methods like DoChildSizingChange, InvalidatePreferredChildSizes, DoAutoSize, and DoAllAutoSize.

Provides indexed access to the child controls for the class instance.

Controls is a read-only indexed TControl property which provides access to child controls by their ordinal position in the list.

The Index argument contains the ordinal position for the requested child control, and must be in the range 0..ControlCount-1. The index also indicates the display or tab order for the child controls. The physical order for the controls in the list my be changed when the FixupTabList method is called during LCL component streaming.

Ordinal position for the child control requested in the property value.
The default WndProc on Windows widgetset and platforms.
The number of clients docked into this control.

The docked controls can be accessed inDockClients[].

DockClientCount is equivalent to DockClients.Count, but handles the special case when DockClients is Nil.

The indexed list of controls docked into this control.
Index of the requested docked client.
The docking layout manager for this control.

A DockSite can be managed (using a DockManager), or unmanaged (positioning docked controls in the event handlers). The DockManager determines the placement for 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 is set to True. Setting UseDockManager to True creates the DockManager using the DefaultDockManagerClass for this DockSite, if not previously assigned.

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

Allows controls to be drag-dock'd into this control.

A DockSite reacts on controls dragged over this control, signals acceptance and where a dragged control would be dropped.

A DockSite should initially be empty, not containing any child controls.
Allows to reduce flicker in the painting of the control.

Paint requests are typically buffered in the message queue. When a paint message arrives, all elements of the control are drawn onto the screen, according to their type, style, state and content.

This can cause flicker, when stacked controls wipe out preceding paintings, e.g. when unchanged text is erased from the screen before it is painted again, when it takes some time to retrieve the text of list entries, or wrapping long text at the current control boundaries. Owner-drawing also can cause noticeable flicker.

To reduce such flicker, DoubleBuffered controls use a bitmap buffer into which all painting is redirected. When the bitmap has been updated, a paint request is queued for the control. When that paint request is received again, the prepared bitmap is output in one fast BitBlt transfer, eliminating any flicker.

All this happens automatically when DoubleBuffered is set to True; no additional changes are required in application or custom control code.

A reference handle to the widgetset class instance associated with this control.

Handle is a HWND property which represents the handle to the widgetset class instance for the control. It provides a bi-directional communication mechanism between an LCL component and the native control on a given platform or widgetset. Handle has a non-zero value when it has been allocated for the widget.

Read access to the property value calls the HandleNeeded method to create the handle if it does not already exist in the control (and its Parent controls). When the property value is changed, the InvalidatePreferredSize method is called to update control flags and clear the cached size for the control.

Use HandleAllocated to check Handle for a non-zero value. Use HandleNeeded when the LCL component needs to ensure that the control and Parent controls have an assigned Handle. Or call CreateHandle.

Use WindowHandle to access the unique identifier for a device context used in drawing operations for the widgetset class.

Used in Carbon and Cocoa widgetsets

IsFlipped is a read-only Boolean property. It is used in the Carbon and Cocoa widgetsets for the macOS platforms.

Indicates if the control is changing its size after the BeginUpdateBounds method has been called.

IsResizing is a read-only Boolean property which indicates if SetBounds has been called to resize the control, but the action has not been completed. An internal bounds lock counter is used to track the progress of a resize operation. It is incremented when BeginUpdateBounds is called and decremented in the EndUpdateBounds method. The property value is True when the internal bounds lock counter has a non-zero value.

IsResizing is used when a designer surface in the Lazarus IDE tries to select one of its components. It prevents the selection if the SetBounds operation is still in progress (IsResizing is True).

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

TabOrder is a TTabOrder with a numeric value which indicates the navigation order for the control when the user presses the Tab or Shift+Tab key. The default value for the property is -1 and indicates that an explicit value has not been assigned.

Each TWinControl has an internal list used to maintain the tab order for its child Controls. When TabOrder is -1 for a given child control, it added to the end of the tab order list. A non-zero value forces the control to be stored at that ordinal position in the tab order list. Setting a new value for the property causes the private UpdateTabOrder method to be called to maintain the sequence for the child controls.

Use TabStop to indicate if the control can be focused using tab order navigation request.

Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.

TabStop is a TabStop property which indicates if the control can be focused when using the Tab or Shift+Tab keys to navigate between controls on a form. The default value for the property is False. At design-time, the Lazarus IDE sets the value to True in newly created control instances.

When set to True, the windows style flags are updated to include the value WS_TABSTOP in the CreateParams method.

Changing the value for the property causes the internal tab order list to be updated, and a CM_TABSTOPCHANGED control message is performed for the control.

TabStop is used in methods like FindNextControl, and may be updated in methods like Insert.

Event handler signalled to determine the order and placement for custom-aligned child controls.
Event handler signalled to determines the position for custom-aligned child controls.
Notification handler for the drop of a control to be docked.
Event handler for moves of a control over this docksite; determines acceptance or rejection of an possible drop.
Handler for control receiving the focus.
Handler for control loosing the focus; This is a good place for checking the finished user input.
Handler for keyboard key pressed.

This handler can filter keys, for special use in e.g. non-textual controls. The handler receives all keystrokes, including control and other non-visual keys. Keys are encoded as virtual keys, with separate active modifier keys.

Text input should be checked in an OnKeyPress handler.

Handler for a character entered by the user.

This handler only receives characters, not control or other special key codes. Control keys should be handled by an OnKeyDown handler instead. The handler can also be used to convert the character into a different one.

We recommend using OnUTF8KeyPress to prevent data loss. Characters are converted from UTF-8 to the system encoding in OnKeyPressEvent, with possible loss of characters outside the ANSI codepage.
Event handler signalled when a key up event has occurred for the control.

Unlike OnKeyDown, this event occurs only once for auto-repeated keys.

For details see .

Event handler signalled before a control is undocked from its DockSite.

OnUnDock is a TUnDockEvent property with the event handler signalled before a control is undocked from its DockSite. The event handler arguments identify the control with the DockSite, the client control which will become undocked, the control that has the new dock site, and a Boolean which indicates if the operation is allowed.

The event handler can be used to disallow undocking by setting the Boolean argument to False in the handler routine.

OnUnDock is signalled from the DoUnDock method.

Handler for a character entered by the user.

This handler receives characters codes only, not control or other special key codes. Control keys should be handled by an OnKeyDown handler instead. The event handler can also convert the character code into a different value.

While OnKeyPress receives only ANSI characters (with possible loss of characters outside the ANSI codepage), the OnUTF8KeyPress handler receives the UTF-8-encoded character code.

Value for the DoubleBuffered property in a Parent control.

ParentDoubleBuffered is a Boolean property which indicates the value for the DoubleBuffered property in the Parent control. The default value for the property is True. Changing the value for the property causes a CM_PARENTDOUBLEBUFFEREDCHANGED message to be performed (for the control) when Parent has been assigned.

To disable double buffering for a single control, make sure both DoubleBuffered and ParentDoubleBuffered are set to False.

Double buffering is a technique used to reduce screen flicker when controls are redrawn. It uses an additional off-screen buffer to perform drawing operations, and transfers the content to the on-screen buffer when completed.

DoubleBuffered and ParentDoubleBuffered are implemented for the Win32 platform/widgetset. It is implemented for TWinControl (and descendants) and TApplication. In TApplication, the setting is applied to all forms and controls when assigned before the forms and controls are created.

The window Handle for the Parent widget.

ParentWindow is a HWND property with the window Handle for the Parent widget. A new value assigned to the property is ignored when Parent has already been assigned.

The property value is assigned when the CreateParented constructor or the CreateParentedControl class function is used to create a new TWinControl instance. Setting the property to 0 (zero) causes the handle to be destroyed. 0 is the unassigned handle value.

ParentWindow is used in the the CreateWnd method to form an association between the Handle in the widgetset class instance and the window handle value for a control.

Cached visibility for the widget. Not necessarily in sync with the widget.

Showing is a read-only Boolean property with the visibility for the Handle in a control or its Parent. The value for the property is assigned in the UpdateShowing method when the control hierarchy is checked for valid and Visible window handles for the control or its Parents. Showing may be updated when the DoAllAutoSize or UpdateControlState methods are called.

Determines whether a DockManager is used for this DockSite.

When UseDockManager is set to True, and DockSite is also set to True, a DockManager is created automatically. When set to False, an existing DockManager is ignored.

If you want to use a special DockManager, install it before setting UseDockManager to True.

Indicates whether the wcfDesignerDeleting flag is included in the flags for the control.

DesignerDeleting is a Boolean property which indicates if the wcfDesignerDeleting is includes in the control flags for the TWinControl instance. When set to True, wcfDesignerDeleting is included in the control flag values. When set to False, it is removed. Used in TPairSplitter only.

Indicates if the control has the wcfSpecialSubControl control flag.

IsSpecialSubControl is a read-only Boolean property. Its vale is True when wcfSpecialSubControl has been included in the WinControlFlags for the control. Used in TCustomPairSplitter only.

The number of visible docked controls.
Translates control state flags into AutoSizePhases.

The return value is a TControlAutoSizePhases set type. It is populated with values from the TControlAutoSizePhase enumeration based on window control flags and other internal members in the class instance. When Parent has been assigned, the values are derived by calling AutoSizePhases in Parent.

AutoSizePhases is called from methods like DoAutoSize and UpdateShowing. It is also called from window messgae handlers like WMMove, WMSize, and WMWindowPosChanged.

Set withe auto-size phase values enabled for the control.
Returns True if auto-sizing has been delayed until some other process is completed.

AutoSizeDelayed is an overridden Boolean function in TWinControl. It returns True when auto-sizing cannot or should not be performed at the current time, or when the value in Showing cannot be changed.

In TWinControl, it checks the ControlState flags for the value csDestroyingHandle when determining the return value for the method. AutoSizeDelayed calls the inherited method, and sets the return value to True if either condition is True.

The value from AutoSizeDelayed is used in methods like DoAllAutoSize and UpdateShowing.

True if auto-sizing cannot be performed at the current time.
Returns True if AutoSize should be skipped / delayed because of its handle.
Starts an update to the Bounds property; disables SetBounds by incrementing BoundsLockCount.
Ends an update to the Bounds property; decrements BoundsLockCount and eventually calls SetBounds.
Disables sending bounds to the widget, by incrementing the internal FRealizeBoundsLockCount.
Enables sending bounds to the widget again, eventually updates the widget.
Get the child control at the given client position.

WinControls are found before Controls (if overlapping).

The found control, Nil if none found.
The client coordinates.
Allow finding disabled controls.
Allow finding TWinControls, in addition to TControls.
Only search in client areas.
Encoded Allow... conditions.
Returns True if the control is a parent for the specified control.
True when we are a parent of Control.
The control examined as a child control.
Asks the widget if ClientRect has changed since the last AlignControl execution; calls AdjustSize on change.
The ClientRect is cached; call this procedure to invalidate the cache, so that the next ClientRect value is fetched from the widgetset class.
Also invalidate all child controls, if True.
The ClientRect is cached - check if the cache is valid.
True if update needed.
Sets the control bounds and adjusts child and docked controls.

SetBounds is an overridden method in TWinControl. used to set the bounds for the control to the values in the ALeft, ATop, AWidth, and AHeight arguments.

No actions are performed in the method when the internal BoundsLockCount member has a non-zero value. In other words, when BeginUpdateBounds has been called and EndUpdateBounds has not been called.

At design-time, SetBounds checks to ensure that negative is not present in the Width or Height properties when the user has changed the bounds for the control.

SetBounds calls DisableAutoSizing to reduce the overhead for recomputing/moving/resizing when the bounds are changed. The inherited method is called to apply the new values in ALeft, ATop, AWidth, and AHeight. EnableAutoSizing is called to re-enable auto-sizing when the operation has been completed.

SetBounds is called when any one of these Left, Top, Width or Height properties, or the BoundsRect property has been changed.

Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

The X coordinate for the left side of the control.
The Y coordinate for the left side of the control.
The width for the control.
The height for the control.
Returns the Client rectangle relative to the controls left, top.

If Scrolled is True, the rectangle is moved by the current scrolling values (for an example see TScrollingWincontrol).

TControl.GetChildrenRect
Disables auto-sizing when aligning the control and its parent.
Re-enables auto-sizing after aligning the control and its parent.
Adjusts the size and placement for the control and all of its children.

Calls the inherited AdjustSize method.

Scrolls the control using the handle for the widgetset class.
Raises an Exception if the handle has not been allocated for the widgetset class instance. Raised with the message 'TWinControl.ScrollBy_WS: Handle not allocated'.
Scrolls the control (and all child controls) by the specified amounts.
Increment for Left.
Increment for Top.
Automatically adjusts the size and layout for the control (and all of its children).

AutoAdjustLayout is an overridden procedure used to automatically adjust the size and layout for the control. All children in the Controls property also call their AutoAdjustLayout method, and the inherited method is called to adjust and resize the current control instance.

AutoAdjustLayout calls DisableAutoSizing on entry, and EnableAutoSizing prior to exit from the method.

Layout mode applied in the method.
Fixes the design-time PPI settings for the control font, and applies the changes to child controls.
Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited method using TheOwner as the owner for the class instance. Create allocates resources needed in the class instance, and sets the default values for the following properties:

ParentDoubleBuffered
  Set to True
ChildSizing
  Sets DoChildSizingChange as the OnChange event handler
Brush
  Set to Nil; few controls require a brush, and it is created on DoRemainingKeyDown
TabOrder
  Set to -1
TabStop
  Set to False

Create calls the InvalidateClientRectCache method to invalidate a cached client rectangle, and to force the value to be read from the LCL interface.

Owner of the class instance.
Constructor for a control that is the child of the given widget.
Destructor for the class instance.

Destroy is the overridden destructor for the class instance.

Destroy call RemoveFocus to ensure that the control cannot receive focus from a Parent control. If a handle has been allocated for the windowed control, the DestroyHandle method is called.

Destroy iterates over Controls to remove the value in the Parent property for each child control, and to remove an assigned HostDockSite. It does not actually free the child Controls; they are freed by the owner of the control instance (usually a TForm instance).

Destroy ensures that any controls in the DockClients property remove the current class instance from their host dock site.

Destroy frees resources allocated in the constructor, or in other class methods, including the DockManager and DockCients. Destroy calls the inherited destructor prior to exiting from the method.

Handler for a DragManager dmDragDrop message, sent when a dragged control has been dropped onto this docksite.

Asks the dropped control to dock itself into this docksite, updates its Parent, HostDockSite, and the DockClients for the old and new DockSite.

When a DockManager is installed, it is used to position the docked control (InsertControl).

Finally, an OnDockDrop event is signalled.

Is this control allowed to receive the focus when parent form is visible?

Checks if the control can get focus when parent form is visible, i.e. if all its parents except the form are visible and enabled.

A possible usage:

if FormFoo.EditBar.CanFocus then FormFoo.ActiveControl := FormFoo.EditBar;
CanFocus returns True even if the parent form is not actually visible, and a subsequent SetFocus call could throw an exception. Use CanSetFocus in this case.
Is this control allowed to receive the focus?

Checks if the control can receive focus, i.e. if all its parents are visible and enabled.

A possible usage:

if MyControl.CanSetFocus then MyControl.SetFocus;

CanSetFocus should be preferred over CanFocus if used in CanSetFocus/SetFocus combination because it checks also if the parent form can receive focus and thus prevents the "cannot focus an invisible window" LCL exception.

Finds the position for the specified control in the Controls property.

Calls the IndexOf method in Controls to find the child control in AControl. The return value contains the ordinal position in Controls where AControl is stored, or -1 when not found or Controls has not been assigned.

TFPList.IndexOf
The ordinal position in Controls, -1 if not found.
The child control to locate in the method.
Checks whether the control has focus.

Focused is a Boolean function which indicates whether the control can be and is the currently focused control. The return value is True when the control can become focused during tab order navigation, has a valid Handle, and is the currently focused control in the widgetset class instance.

True when the control has focus.
Changes the focus to the next (or preceding) control.
True when the focus has been transferred.
The direction of Tab movement; True for the next control in the TabOrder, False for the preceding control.
Finds a child control with the specified name.
True when the control has been found.
The Name of the control to find.
Transfers the focus to the next child control.

The search wraps around on the boundaries of the TabOrder array. When no next control can be found, the focus remains unchanged.

The control which is assumed to have the focus.
False when the control preceding CurControl shall be found.
When True, only select a control that can receive the focus.
Posts the specified message to all of the child controls.

Allows the specified method to be handled by one of the child Controls. The ToAllMessage argument is untyped; any TLMessage descendant can be passed as the value for the argument.

The method name is a misnomer. Broadcast implies delivery of the message simultaneously to all of the recipients. Actually, it is more like a telegraph. The message is posted sequentially to child controls until one of them handles the message using its WindowProc method.

Use NotifyControls to post a message with a specific message identifier constant to child Controls in the class instance.

The message sent in the method.
Sends a message to all child controls.

Calls the BroadCast method to deliver a TLMessage instance with the identifier in Msg.

The message ID.
Handles all messages that the control doesn't fully handle itself.

This implementation sends the message to the widget's message handler.

Override this method to implement your own message handling. If the message Result is non-zero, the message already has been handled; otherwise, set the Result to a non-zero value (depending on the message ID) when the message has been handled.

TObject.DefaultHandler
The message to process.
Schedules a repaint request.

Invalidate is an overridden method in TWinControl. It re-implements the inherited method to call the Invalidate method in the widgetset class instance when its Handle has been allocated. It does not call the inherited method.

Tells the widgetset to add a Handle object representing the current control.
Inserts the specified control into the Controls property.
The control to insert.
Insert at index (optional).
Removes the specified control from the Controls property.
The control to remove.
Gets an enumerator for the Controls property.
The TWinControlEnumerator instance.
Gets a reverse-order enumerator for the Controls property.
The TWinControlEnumerator instance.
Ensures that the control or window handle has focus.

SetFocus is a procedure used to give focus to the current control. SetFocus calls GetParentForm for the control instance, and uses its FocusControl method to change the focused control.

If the parent Form is unassigned (contains Nil), the LCL interface is used to change focus to the handle for the control. No actions are performed in the method when Form is unassigned and the control does not have an allocated handle.

Flip children horizontally. That means mirroring the Left position and anchoring.

Child controls arranged in left-to-right order appear in right-to-left order after flipping. All anchors are adjusted accordingly.

Flip recursive?
Returns the docking caption for the specified control.
String the docking caption for the control.
Control instance examined in the method.
Updates the Caption to reflect the names for the docked clients.

Called when this is a HostDockSite and either the list of docked clients have changed, or one of their captions has changed.

If the control is being undocked, but still is in the DockClients list, it is excluded from the docking caption and the Exclude argument is set to True.

Control to exclude from the DockCaption.
Fill the list with all TabStop controls, recursing into child controls.
The list to which the controls shall be added.
Checks whether a handle for the widget has been allocated for the control.
True when a widget exists and its Handle is not Nil.
Returns True if all Parents have handles allocated, and are not being destroyed.

ParentHandlesAllocated is an overridden method in TWinControl which checks whether Handles are valid for all controls in the component hierarchy for the current control.

ParentHandlesAllocated visits each of the controls, starting with the current class instance, and checks whether the control has an allocated handle and is not being destroyed. It navigates to the next Parent control in the hierarchy, and exits when the Parent control is unassigned.

The return value is True when all of the controls in the hierarchy have an allocated Handle and are not being destroyed. The return value is False if any control is found in the hierarchy that does not have a valid handle allocated, or ComponentState indicates its handle is being freed.

True when all of the controls in the Parent hierarchy have a valid handle.
Call this method when your code requires a valid Handle for this control.

An attempt is made to create a widget, when not already done.

In certain situations it may be impossible to create a widget right now!
Indicates whether a Brush has been created for the control.
True when a Brush has been created.
Fills the display rectangle for the control with the color and pattern in Brush.

EraseBackground is called during Paint requests from the WMEraseBkgnd method, which provides a valid device context in the DC argument. No actions are performed in the method when DC contains 0 (unassigned).

The FillRect routine is called to perform the operation using the Width, Height, and the handle in the Brush property.

The device context to use; may be clipped to a certain shape.
Called by the interface after the navigation and specials keys are handled; i.e. after KeyDown but before KeyPress.

Essentially expands a repeat count into multiple keystrokes. Cannot be used for SysKeys.

True when multiple keystrokes have been processed.
The UTF-8 encoding of the character.
Must be greater than zero, the exact value is ignored.
Must be False, else nothing happens.
Searches for a Parent form that can be used as a file drop target.
The TCustomForm instance that allows file drop actions, or Nil when file drag/drop is not supported.
Paints the control using the handle for the widgetset class.

PaintTo is a procedure used to draw the control using the handle for the widgetset class. An overloaded variant is provided which uses the handle in a TCanvas instance as the target for the drawing operation.

Device context (or Handle) used for the operation.
Horizontal coordinate where the control is drawn.
Vertical coordinate where the control is drawn.
TCanvas instance with the handle used in the operation.
Specifies the non-rectangular shape of the widget.

SetShape is an overloaded procedure used to set the shape for the control to the non-rectangular value in AShape. The overloaded methods allow AShape to be either a TBitmap or a TRegion value.

When TBitmap is used, the widgetset class calls its SetShape method to apply the TBitmap handle to the handle for the widget. No actions are performed in the method when a handle has not been allocated for the widgetset class.

When TRegion is used, SetWindowRgn in the LCL interface is called to apply the region in AShape to the handle for the control.

Shape for the control; TBitmap or TRegion in overloaded methods.
TGraphicControl
is the base class for all lightweight controls.

TGraphicControl supports simple lightweight controls that do not need the ability to accept keyboard input, and do not contain other controls. Since lightweight controls do not wrap GUI widgets, they use fewer resources than controls based on TWinControl. If you want to accept keyboard input, or need to support child controls, use a TCustomControl instead.

TGraphicControl provides a Canvas property for access to the control's drawing surface and a virtual Paint method and an OnPaint handler, called in response to paint requests received by the parent control.

Override the Paint method, or supply your own OnPaint handler, to do the actual drawing of the control.

TCanvas
Handles a LM_PAINT message for the control.
Message handled in the method.
Performs actions needed when the Font for the control has been changed.

FontChanged is an overridden method in TGraphicControl used to perform actions needed when the Font for the control has been changed. It is the routine used as the OnChange event handler for the Font property, and is assigned in the inherited constructor for the class instance.

Sender contains the object instance for the event notification, and is provided to maintain compatibility with the TNotifyEvent signature for the event handler. It is not used in TGraphicControl, but is passed as an argument to the inherited method.

FontChanged ensures that the new value for the Font property is also applied to the Canvas for the control. This includes the PixelsPerInch setting for the Font. FontChanged calls the inherited method prior to exit.

TFont.PixelsPerInch
Object instance for the event notification.
Implements the default handler used to draw the control.

Paint is a method which causes the control to be drawn using the drawing mechanism for the control. In TGraphicControl, like TCustomControl, the OnPaint event handler is used (when assigned). Assign a routine to the OnPaint handler to perform the drawing operations needed for the control.

Performs action needed when the bounds for the control have been changed.

DoOnChangeBounds is an overridden method in TGraphicControl. It calls the inherited method on entry to update control flags and signal OnChangeBounds event handlers for the control. The Handle in Canvas is freed prior to exiting from the method. The handle is re-allocated the next time it is accessed.

DoOnChangeBounds is called when the component is loaded using the LCL streaming mechanism, and from the ChangeBounds method when the control is resized.

Performs actions when the handle for the parent control is freed.

DoOnParentHandleDestruction is overridden in TGraphicControl to re-implement the method in the ancestor class. It ensures that Handle for the Canvas is freed when the parent handler is destroyed.

Event handler signalled to paint the control.

OnPaint is a TNotifyEvent with the event handler signalled to paint the control. Applications must implement and assign a routine to the event handler to perform the drawing operation. TGraphicControl does not provide a default drawing mechanism.

Use the Canvas for the control to perform drawing operations. The Font and Brush in Canvas are automatically configured to use values assigned to the corresponding properties in the control. BorderStyle, however, is not automatically applied. Use the Pen in Canvas as needed to draw the BorderStyle for the control.

OnPaint is signalled (when assigned) from the Paint method.

Handles the CM_CURSORCHANGED message for the control.

CMCursorChanged is an overridden method in TGraphicControl. It ensures that the control is Visible before the temporary cursor shape is changed.

Visible must be set to True, and the Parent control (with the window handle) must be assigned before the control can be displayed. No actions are performed in the method if Visible is False, or Parent is Nil.

In addition, the mouse must be over the control to apply the cursor shape using SetTempCursor and the value in the Cursor property.

Constructor for the class instance.

Create is the overridden constructor for the class instance. It calls the inherited method on entry using AOwner as the owner of the class instance. Create allocates a TControlCanvas instance used for the Canvas property.

Owner of the class instance.
Destructor for the class instance.

Destroy is the overridden destructor for the class instance. It ensures that resources allocated for the Canvas property are freed. It calls the inherited destructor prior to exiting from the method.

A clipped window into the parent Canvas.

Don't paint on the entire Canvas! Instead use the dimensions of the TGraphicControl stored in the ClientRect.

If you ask for the Canvas.Width or Canvas.Height, you are actually getting the Canvas dimensions from the Parent control.

TCanvas
The base class for windowed controls which paint themselves.

In contrast to TGraphicControl, a TCustomControl can accept keyboard input (and receive Focus), and can have child controls.

Override the Paint method or supply your own OnPaint handler, to do the actual drawing of the control.

Handles LM_PAINT messages for the control.

Re-implements the method from the ancestor class to update ControlState prior to handling the specified Message. Includes the value csCustomPaint in ControlState before calling the inherited method. Removes csCustomPaint from ControlState after the message has been handled.

No actions are performed in the method when the control is being freed, or when a Handle has not been allocated for the control.

Message handled in the method.
Destroys the handle for the Canvas and the interface object.

DestroyWnd is an overridden method in TCustomControl. It ensures that the Handle in Canvas is freed before calling the inherited method.

The Paint handler plug-in, intercepting paint requests.

PaintWindow is an overridden method in TCustomControl. It ensures that Canvas has an allocated Handle which matches the device context specified in the DC argument. If the Canvas handle does not match DC, the value in the argument is assigned to Canvas.

PaintWindow calls the Paint method to signal the OnPaint event handler (when assigned).

If Handle value in Canvas was changed in the method, it is reset to 0 (unassigned) prior to exit.

PaintWindow does not call the inherited method.

The Device Context used to draw on the Canvas.
Performs actions needed when the Font for the control has been changed.

FontChanged is an overridden method in TCustomControl used to perform actions needed when the Font for the control has been changed. It is the routine used as the OnChange event handler for the Font property, and is assigned in the inherited constructor for the class instance.

Sender contains the object instance for the event notification, and is provided to maintain compatibility with the TNotifyEvent signature for the event handler. It is not used in TGraphicControl, but is passed as an argument to the inherited method.

FontChanged ensures that the new value for the Font property is also applied to the Canvas for the control. This includes the PixelsPerInch setting for the Font. FontChanged calls the inherited method prior to exit.

TFont.PixelsPerInch
Object instance (TControl) for the event notification.
Sets the value for the Color property

SetColor is an overridden method in TCustomControl used to set the value in the Color property. It calls the inherited method on entry, and applies the new color value to the Brush in the control Canvas.

TControl.Color TWinControl.SetColor
New value for the Color property.
Implements the default handler used to draw the control.

Paint is a method which causes the control to be drawn using the drawing mechanism for the control. In TCustomControl, like TGraphicControl, the OnPaint event handler is used (when assigned). Assign a routine to the OnPaint handler to perform the drawing operations needed for the control.

Paint called from the PaintWindow method, and occurs when a LM_PAINT message is handled for the control.

Constructor for the class instance.

Create is the overridden constructor for the class instance, and calls the inherited constructor on entry. Create allocates resources for the TControlCanvas instance used in the Canvas property.

Owner for the class instance.
Destructor for the class instance.

Destroy is the overridden destructor for the class instance.

It calls RemoveFocus to prevent the Parent control from giving focus to the free control. It destroys the Handle for the control, and ensures that the control is removed as a Parent or DockSite for its child controls. It does not free the child controls; they are freed by their owner.

Controls in the DockClient property are updated to remove the class instance from the HostDockSite property in the docking clients.

Destroy frees resource allocated in the constructor, and calls the inherited method proper to exit.

The drawing surface for the control.

Canvas is a TCanvas property which contains the drawing surface for the control. Resources for the property are allocated in the constructor for the class instance. A TControlCanvas descendant is created and assigned to the member for the property. The Handle for the Canvas is updated when PaintWindow is called for a specific device context.

Changing values in the Font or Color properties causes settings in Canvas to be updated. A new value assigned to Font is also assigned to the Canvas in the control, and includes the PixelsPerInch setting for the Font. A new value assigned to Color is applied to the Brush in Canvas. A value assigned to BorderStyle must be handled in the routine assigned to the OnPaint event handler.

TCanvas
Event handler signalled to paint the control.

OnPaint is a TNotifyEvent property with the event handler signalled to draw the control on its Canvas. An object procedure which draws all aspects of the control must be implemented and assigned to the property.

The Sender argument provides access to properties and methods for the control instance. It must be cast to a TCustomControl to access members for the class type.

Use Canvas to render the control in the event handler. The values from Font and Color are already applied to the corresponding properties in Canvas. The BorderStyle property must be applied in code for the handler.

OnPaint is signalled from the Paint method.

Implements a multi-resolution container for images used in an application.

TImageList is a TDragImageList descendant, and sets the visibility for properties in ancestor classes (like TCustomImageList). As a TDragImageList descendant, it provides support for using images in the list during drag-and-drop or drag-and-dock operations. Most of the features and functionality for the list are inherited from the TCustomImageList class.

TCustomImageList
Implements the abstract ancestor class used to get the property list for a control.
Parses the string into the given list.
Represents a node in a TDockTree

It encapsulates a dock zone, containing either other zones or a single control.

This implementation is specific to . Another DockManager can (and should) use its own class instead.

Gets the value for the Height property.
Value for the Height property.
Gets the value for the Left property.
Gets the value for the Left property.
Gets the value for the LimitBegin property.
Value for the LimitBegin property.
Gets the value for the LimitSize property.
Value for the LimitSize property.
Gets the value for the Top property.
Value for the Top property.
Gets the value for the Visible property.
Value for the Visible property.
Gets the value for the VisibleChildCount property.
Value for the VisibleChildCount property.
Gets the value for the Width property.
Value for the Width property.
Sets the value for the LimitBegin property.
New value for the LimitBegin property.
New value for the LimitSize property.
New value for the LimitSize property.
Sets the value for the Height property.
New value for the Height property.
Sets the value for the Left property.
New value for the Left property.
Sets the value for the Top property.
New value for the Top property.
Sets the value for the Width property.
New value for the Width property.
Constructor for the class instance.

Stores values passed in the TheTree and TheChild arguments to the Tree and ChildControl property. Sets the initial bounds for the dock zone to an empty rectangle. This causes the Top, Left, Width, and Height properties to contain 0 (zero).

The dock tree to which this zone belongs.
The control in this zone (or Nil when unassigned).
Returns the dock zone containing the given control.
The zone containing AControl as ChildControl.
Control to locate in the dock tree.
The first visible child zone.
The next visible zone.
The zone, or Nil if none found.
The next visible zone.
The preceding visible zone.
Inserts NewZone as preceding or following sibling.
The zone to add.
How to add the zone.
Adds the given zone as the first child.
The zone to add.
Adds the given zone as the last child.
The zone to add.
Replace the OldChild zone by NewChild.
The zone to unlink.
The zone to link in place of OldChild.
The last child zone.
Calculates the index of the zone within its parent zone.
Unlinks the given child zone.
The control docked in this zone.
A zone can contain nothing, a control, or child zones.
The number of child zones.
The first child zone.
The height of the zone.
The left coordinate of the zone.
The free coordinate of the DockZone (Left or Top).
The free size of the DockZone (Width or Height).
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 zone in the DockTree.
The top coordinate for the dock zone.
The dock tree of which this dock zone is a part.
A zone is visible if it contains a visible control, or if any child zone is visible.
The number of visible child zones.
The width of this zone.
The next sibling zone.
The preceding sibling zone.
Class of
The type for a ForEachZone callback procedure, currently unused.
The iterated zone.
Represents flag values used in TDockTree.
Set type used to store values from the TDockTreeFlag enumeration.
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.

The TLazDockTree implementation never was finished, due to problems with the anchor "docking" mechanism. Use the EasyDockManager (examples/dockmanager) instead.

This is an abstract class. A real implementation is e.g. in ldocktree.pas.

Docking means here: Combining several windows to one. A window can here be a TCustomForm or a floating control (undocked) or a TDockForm. A window can be docked to another to the left, right, top, bottom or "into". The docking source window will be resized, to fit to the docking target window.

Example1: Docking "A" (source window) left to "B" (target window)

+---+ +-----+ | A | -> | B | | | | | +---+ +-----+

Result: A new docktree will be created. Height of "A" will be resized to the height of "B". A splitter will be inserted between "A" and "B". And all three are children of the newly created TLazDockForm of the newly created TDockTree.

+------------+ |+---+|+----+| || A ||| B || || ||| || |+---+|+----+| +------------+

- If "A" or "B" were floating controls, the floating dock sites are freed.
- If "A" or "B" were forms, their decorations (title bars and borders) are replaced by docked decorations.
- If "A" had a TDockTree, it is freed and its child dockzones are merged to the docktree of "B".

Analog for docking "C" left to "A":

+------------------+ |+---+|+---+|+----+| || C ||| A ||| B || || ||| ||| || |+---+|+---+|+----+| +------------------+

Example2: Docking A into B

+-----+ | | +---+ | B <+--| A | | | +---+ +-----+

Result: A new docktree will be created. "A" will be resized to the size of "B". Both will be put into a TLazDockPages control which is the child of the newly created TDockTree.

+-------+ |[B][A] | |+-----+| || || || A || || || |+-----+| +-------+

Every DockZone has siblings and children. Siblings can either be:

- horizontally (left to right, splitter),
- vertically (top to bottom, splitter),
- or upon each other (as notebook pages).

InsertControl - undock a control and dock it into the dock site. For example, to dock Form1 left to a Form2:

InsertControl(Form1,alLeft,Form2);

To dock into a TDockPage, use:

Align=alCustom;

PositionDockRect - calculates where a control would be placed, if it would be docked via InsertControl.

RemoveControl - removes a control from the dock site.

GetControlBounds - TODO: for Delphi compatibility.

ResetBounds - TODO: for Delphi compatibility.

SetReplacingControl - TODO: for Delphi compatibility.

PaintSite - TODO: for Delphi compatibility.

The width of the border around a dock zone.
Destroys the zone and its child zones.
Returns the control and the part of the dockzone at the given coordinates.
The docked control.
The client coordinates.
Returns the zone part at MousePos.
Paints the dock header of the zone containing AControl.
Updates the internal TDockTreeFlags to reflect the update status for the control

UpdateAll is a procedure used to update the internal TDockTreeFlags member to reflect the current update status for the control. UpdateAll checks an internal counter, incremented in BeginUpdate, to see if dtfUpdateAllNeeded needs to be included in or excluded from the set of flag values. It is included when the update count is greater than 0 (zero). Otherwise, it is excluded from the set.

UpdateAll is called from the EndUpdate method.

Constructor for the class instance.

Create is the overridden constructor for the class instance. TheDockSite contains the windowed control handled in the docking tree. Create calls the inherited constructor using TheDockSite as the owner for the class instance.

Creates allocates resources needed for the RootZone property, and sets the value for its border width to 4.

The window control to be managed.
Destructor for the class instance.

Frees resources allocated to the RootZone property, and calls the inherited destructor.

Starts an update process for the class instance.

BeginUpdate is an overridden method in TDockTree. It increments the internal update counter for the class. It is used to consolidate calls to the UpdateAll method until the internal counter reaches zero (0).

Finishes an update process for the class instance.

EndUpdate is an overridden method in TDockTree. BeginUpdate and EndUpdate are used to consolidate calls to the UpdateAll method. EndUpdate decrements the internal update counter, and when it reaches zero (0) calls UpdateAll to remove dtfUpdateAllNeeded from the docking tree flags.

Adjusts the zone 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.

Positions 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 horizontal 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.

The control beneath which to place DropControl.
How to insert DropControl.
The control to add.
Has an empty implementation in TDockTree.
Has an empty implementation in TDockTree.
Stores the layout in an file.
The class of all dock zones in this tree.
The parent control whose docked clients are managed
The root zone for the DockTree.
Class type used to create new splitter class instances.

Normally contains a reference to the TSplitter class, as assigned in the initialization section for the extctrls.pp unit.

TSplitter
Provides access to properties of the Mouse.

Contains information about the current mouse position, whether messages are captured by a window, whether it is dragging an object, and how far the mouse must move before a control starts dragging. TMouse is the type used for the Mouse global unit variable.

Handle for the control with mouse capture.
The screen position for the mouse cursor.
True while dragging an object.
The number of lines to scroll with every notch or unit on the mouse wheel
Does dragging start immediately (True), or only after a mouse move?
The minimum distance the mouse must move before dragging starts (in delayed mode)

The default value is 5 (pixels).

Array with sets of anchors used for a given alignment option.

AnchorAlign is an array constant that contains elements with TAnchors set values. Values in AnchorAlign are indexed by TAlign enumeration values. This allows the TAlign value to retrieve the set of Anchors used for the specified align option. For example:

AControl.Align := AnchorAlign[alRight]; // contains [akRight, akTop, akBottom]
Gets the drag target at the specified screen position.

Disabled controls should be excluded, but are not due to an bug in FindControlAtPosition.

The control at Position; Nil if none.
The screen position.
Also finds disabled controls, if True.
Gets the control at the specified screen position.

FindControlAtPosition is a TControl function used to get the control at the specified screen position. When AllowDisabled is True, a disabled control can also be located in the routine. 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.

The control found at the specified Position; Nil when not found.
The screen position examined in the routine.
Finds disabled controls when True.
Find the window and its owning control at the given screen coordinates.

FindLCLWindow is a TWinControl function used to find the window (and its owner control) at the specified screen coordinates.

FindLCLWindow gets the Handle for the window and checks to ensure it is enabled. When it is not enabled, or AllowDisabled is False, parent handles are examined until a suitable window is located. FindOwnerControl is called for the handle to get the return value. The return value is Nil if a Window was not found at the specified position.

The control that owns the window at the specified screen position; Nil when a window is not found.
TPoint with the screen coordinates examined in the routine.
Allows a disabled window to be returned.
Return the TWinControl for 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!

The function recursively tries GetParent(Handle), so the result depends on the implementation (meaning) of a parent handle.
Returns the TControl that currently is visible at a screen position.
The result is not reliable during resizing.
Moves the origin for a windowed control.

MoveWindowOrg is a procedure used to move the origin for a windowed control to the specified position. dc contains the device context for the Window handle used in the routine. X and Y contain the new coordinates in pixels used as the origin (Left and Top respectively) for canvas drawing operations.

Device context updated in the routine.
Left coordinate for the new window origin.
Top coordinate for the new window origin.
(Re-)Creates the widgetset class instance for a TWinControl.

This function was originally a member of TWinControl.

From a VCL point of view, that made perfectly sense since the VCL knows when a Win32 widget has to be recreated when properties have changed.

The LCL, however, does not know when properties values are changed. But the widgetset does. To avoid the old VCL behavior, and to provide a central function for use in the widgetset, it has been moved here.

The default class used to create a DockManager in .
Cancels an active drag operation.

CancelDrag is a procedure used to cancel an active drag operation. CancelDrag calls the DragStop method in the currently active DragManager.

No actions are performed in the routine when DragManager has not been assigned (contains Nil), or when DragManager returns False from its IsDragging method.
Set the mouse capture to AWinControl or its child at the given coordinates.
Returns the TControl instance with mouse capture enabled.

Please note: For the interface, only a Handle for TWinControl can capture the mouse. The LCL extends this to allow TControl to capture the mouse.

Used in SynEdit.
NewStyleControls
is a Boolean variable. Currently used only by SynEdit in synedit.pp.
The global TMouse instance for the unit.

Allocated in the initialization section for the unit, and freed in the finalization section.

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.
Calls the specified procedure for each of the cursor identifiers.
String procedure called in the routine.
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.
Checks whether the handle for a windowed control (or a parent control) is transparent.

CheckTransparentWindow is procedure used to check whether the handle for a windowed control (or a parent control) is transparent. CheckTransparentWindow uses the current mouse position to locate controls or forms under the mouse rectangle. The LM_NCHITTEST message is performed for AWinControl to determine if the handle is drawn transparently. Additional Forms in the Z-Order are visited until an opaque windowed control is located. Parent controls are searched too (when needed).

CheckTransparentWindow updates the values in Handle and AWinControl to reflect the results from the search. When an overlayed control is not located, the value in Handle is set to 0, and AWinControl is set to Nil.

Checks for multiple mouse click events for the specified control.
Gets a set of state values for current modifier keys.

GetKeyShiftState is a TShiftState function used to get a set with the current state values for modifier keys. GetKeyShiftState calls GetKeyState to capture the values in the set for the following virtual keyboard keys:

VK_CONTROL
  Includes ssCtrl when the Control key is pressed
VK_SHIFT
  Includes ssShift when the Control key is pressed
VK_MENU
  Includes ssAlt when the Alt key is pressed
VK_LWIN or VK_RWIN
  Includes ssMeta when one of the WIN keys (or Alt+GR on Mac) is pressed

The return value is an empty set ([]) when none of the virtual keys have a non-zero value.

Adjusts the space around the border for the 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.

Determines if the color for the control is the system default (GTK).

Used by GTK-based widgetset classes to determine if the color in a control needs to be compares to the SYS_COLOR_BASE value used in the widgetset.

Gets the inverse alignment value when BiDiMode is enabled.

Applies to TAlignment value taLeftJustify and taRightJustify. taCenter is always taCenter regardless of BidiMode.

TAlignment value converted in the method.
True to flip the alignment value when BiDiMode is enabled.
Swaps left and right anchor side settings for the specified control when BiDiMode is enabled.
Flips the left and right coordinates relative to the ParentRect when Flip is True.
Flips the value Alignment to reflect the value needed for BiDi mode.
TAligment value updated in the method.
Converts items of several data types into strings, for debug output.
[The parameters should have unique names, for every type]
The string representing the given parameter(s).
TAlign value converted in the routine.
Set of TAnchorKind values converted in the routine.
Anchor side enumeration value converted in the routine.
Auto-size phase converted in the routine.
All elements in this set will be shown as a comma-separated list.
Control style flag converted in the routine.
Set of control style flags converted in the routine.
Form style value converted in the routine.
Declares an assignment operator used to convert a Variant type to a TCaption type.

Declares an assignment operator used to convert a TVariant value to a TCaption value during assignment. Casts the value in AVariant to a String type and assigns it as the return value for the operator. For example:

var AVariant: Variant; AControl: TControl; // ... AControl.Caption := AVariant;
TCaption value for the assignment operator.
Variant value converted to a TCaption value prior to assignment.
Compares the specified pointers containing a Lazarus accessibility object and a accessibility object data.
Compares the specified pointers containing Lazarus accessibility object data and a accessibility object.
Register the components provided by this unit or package, so that they can be instantiated.

Register is a procedure used to register components in this unit in the Lazarus IDE. Register adds the TImageList component on the Common Controls tab. In addition, the TCustomControl and TGraphicControl components are registered without icons.

Register can also be used to register the controls required by an application.

RegisterComponents
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 is essentially the same as TWinControl.DoAutoSize. But since DoAutoSize is commonly overridden in descendent components, it is not useful to perform all tests, which can result in too much overhead. To reduce the overhead, the LCL calls AdjustSize instead.

When setting AutoSize to True, the LCL auto-sizes the width and height for the control. This is one of the most complex parts of the LCL, because the result depends on nearly a hundred properties. Let's start with a simple scenario:

The LCL will only auto-size the Width or Height if it is free to resize. In other words, the width is not auto-sized 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 Constraints can also be overridden 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 auto-size 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 and 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. Others do 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, and maximum somewhere around 10,000 pixels or more.

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

During resizing, or when moving, the Left and Top coordinates are not always in sync with the coordinates for the Handle object.

When Parent is unassigned (contains Nil), Left and Top depend on the widgetset and the window manager. Until Lazarus 0.9.25, this is typically the screen coordinate of the left, top of the client area for 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 starts the movement instantly. If you want to change both Left and Top, use the following instead:

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

Width and Height

The Size in pixels must not be negative; most widgetsets do not allow Width and/or Height to be Zero (0). Some controls (on some platforms )define a larger minimum constraint. Instead of sizing a control to Width=0 and/or Height=0, set Visible to False. During resizing and 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.

FLastDoChangeBounds: TRect

Used to avoid calling OnChangeBounds with the same coordinates. This reduces user defined auto-sizing.

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

Used to avoid calling OnResize with the same coordinates. This reduces user defined auto-sizing.

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.

SetBoundsRectForNewParent(const AValue: TRect);

Used to set FBoundsRectForNewParent. 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 overridden 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.

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 holds the designed Bounds, to be used e.g. when a scale factor is set later.

GetControlOrigin returns the origin in screen coordinates. These values are not always in sync with the True screen position, managed by the widgetset.

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

ClientToScreen returns the screen coordinates for an point in client coordinates.

How multiple controls can be aligned and resized together, at run-time.

The tree-style layout of a form allows one to specify table-style areas, with a common width or height of all controls in the same area (using container controls like e.g. TPanel).

Delphi introduced control anchoring to the sides of the Parent control. This means when a control in a form has Anchors[akRight]=True, its right side keeps its distance from the right side of its Parent, when its Parent is resized.

The default anchors [akLeft,akTop] keep every control anchored to the origin (TopLeft) of their Parent control (of form). This will cause controls to disappear when the form is shrunken, or the user has to scroll through the form's client area.

When a control shall e.g. use the available space, left over to its right, Anchors=[akLeft,akRight] will result in a variable-width control.

The Align property allows one to stack controls at their Parent's sides, e.g. all controls with Align=alTop are stacked at the top of their Parent. The remaining space in the Parent can be occupied by a single control, of Align=alClient.

Both Anchors and Align are tightly coupled, changing one property will affect the other one. This is harmless in so far, as the IDE (form designer) keeps all adjustments in sync, free of conflicts.

Some people found this approved layout method too restrictive, and too complicated to use, and now LCL controls also can be anchored freely to each other. This layout management is traditionally referred to as "Anchor Docking", even if it is not related to docking at all.

This freedom requires that the GUI designer is responsible for consistent anchor specifications, which do not result in unresolvable cyclic references or other contradictions.

Anchor docking allows one to anchor every side of a control to an arbitrary side of another control, i.e. the left side of an Edit control can be anchored to the right side of its associated Label.

Example1

If you want to have the top of B the same as the top of C:

    +-----+  +-----+
    |  B  |  |  C  |
    |     |  +-----+
    +-----+

use:

B.AnchorSide[akTop].Control:=C; B.AnchorSide[akTop].Side:=asrTop;

When you want to have a gap between both controls, set e.g. B.Borderspacing.Right to the desired amount. Setting C.Borderspacing.Left will have the same effect, and both can be used together; the resulting gap then reflects the maximum value of both properties.

BorderSpacing is in effect even for controls without special anchoring, when AutoSize is used.

Anchor docking also allows one to center a control relative to another control.

Example2

For centering A relative to B:

    +-------+
    |       | +---+
    |   B   | | A |
    |       | +---+
    +-------+

use:

A.AnchorSide[akTop].Side:=asrCenter; A.AnchorSide[akTop].Control:=B;

Or use this, it's equivalent:

A.AnchorSide[akBottom].Side:=asrCenter; A.AnchorSide[akBottom].Control:=B;

TControlChildSizing and TControlChildrenLayout offers additional means for aligning and separating controls.